A
AtomicToilet
Guest
Hello!
I'll preface this with: I've eyeballed a whole bunch of related tutorials, but for some reason can't seem to find (or correctly tweak) an existing one to fit with what I'm doing:
I'd like to trigger a projectile within an attack script.
I can't seem to figure out how to tell the projectile to
a) fire in the right direction
b) animate
c) only create one projectle when the player changes to the attack state
------------------
I have an attack script set up and the animation and state change work perfectly, but...
I use instance_create(obj_player.x,obj_player.y,obj_projectile) at the start of the attack script, and of course this works, except it fires out a string of projectiles and they don't animate ( have object speed and image speed set in the obj_projectile's create event, but only the object speed works).
To perhaps clarify, a lot of the tutorials seem to have the relevant projectile code in the player step and/or create event - I understand how these work, but because I want to create a projectile in the attack script, I can't get my head around what code needs to go where. If anyone can point me in the right direction, that'd be ace!
I'll preface this with: I've eyeballed a whole bunch of related tutorials, but for some reason can't seem to find (or correctly tweak) an existing one to fit with what I'm doing:
I'd like to trigger a projectile within an attack script.
I can't seem to figure out how to tell the projectile to
a) fire in the right direction
b) animate
c) only create one projectle when the player changes to the attack state
------------------
I have an attack script set up and the animation and state change work perfectly, but...
I use instance_create(obj_player.x,obj_player.y,obj_projectile) at the start of the attack script, and of course this works, except it fires out a string of projectiles and they don't animate ( have object speed and image speed set in the obj_projectile's create event, but only the object speed works).
To perhaps clarify, a lot of the tutorials seem to have the relevant projectile code in the player step and/or create event - I understand how these work, but because I want to create a projectile in the attack script, I can't get my head around what code needs to go where. If anyone can point me in the right direction, that'd be ace!