I'm using AnimationTree for my character and im trying make him shoot to the global mouse position.
Shooting itself is working fine and animation for one direction is working, with simple code.
if Input.is_action_pressed ("Shoot"):
state_machine.travel("shoot")
Im using guides from youtube
Then I add different animations for different directions like this
if Input.is_action_pressed ("Shoot"):
if fire_direction <=30 and fire_direction >=-30:
state_machine.travel("shoot")
if fire_direction <=30 and fire_direction >=90:
state_machine.travel("shoot45")
if fire_direction <=-30 and fire_direction >=-90:
state_machine.travel("shoot-45")
And it crashes
"Invalid operands 'Nil' and 'Int' operator '<='"
What I found from the google it relates to mousepos not co-oping with something?
