S
Sroft
Guest
So this is my first time coding anything and I think its going really well... but i do have a problem.
Switch statements- I made one successful switch but now im really stuck with the statement im using right now here it is
create
//weapons
enum WEAPONS_MODE
{
HANDS,
PLASMA
}
weapons = WEAPONS_MODE.HANDS
step
//Animation
switch (weapons)
{
case WEAPONS_MODE.HANDS:
{
weapons = WEAPONS_MODE.HANDS
Unarmed();
}
case WEAPONS_MODE.PLASMA:
{
weapons = WEAPONS_MODE.PLASMA
Plasmagun();
}
}
im trying to make the player start out with no gun(aka unarmed) then i have a collision event where when the player runs into the gun on the floor they go to plasmagun. the problem is when i start the game the player is already holding the plasmagun and skips unarmed.
unarmed and plasmagun are scripts plz comment back if i need to add those too
thank you
Switch statements- I made one successful switch but now im really stuck with the statement im using right now here it is
create
//weapons
enum WEAPONS_MODE
{
HANDS,
PLASMA
}
weapons = WEAPONS_MODE.HANDS
step
//Animation
switch (weapons)
{
case WEAPONS_MODE.HANDS:
{
weapons = WEAPONS_MODE.HANDS
Unarmed();
}
case WEAPONS_MODE.PLASMA:
{
weapons = WEAPONS_MODE.PLASMA
Plasmagun();
}
}
im trying to make the player start out with no gun(aka unarmed) then i have a collision event where when the player runs into the gun on the floor they go to plasmagun. the problem is when i start the game the player is already holding the plasmagun and skips unarmed.
unarmed and plasmagun are scripts plz comment back if i need to add those too
thank you