• 0
nissouma55

Velset my projectile towards the opponent

Question

 

Hi everyone,
Well... I would like to make it so that my projectile goes toward the enemy, its not a homing projectile it just shoots toward the enemy s position without following him if he moves or dodge or something. Tryed using p2Dist X and p2Dist Y for this but sometimes it doesnt work and even if it does its not always at the same speed like if p2 is close to the projectile before it velsets it gets faster... Thats not what I want, I want the speed to be constant regardless of the p2 s position. So help please :/

Thanks

Here is my helper: (Didnt add hitdef yet)

 

 

[statedef 20002]
type = U
movetype = A
physics = N
velset = 0,0
anim = 20002

 

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S8,0

 

[State 0, Turn]
type = Turn
trigger1 = animelem = 5 && enemy, pos X < pos x
;ignorehitpause = 
;persistent = 

 

[State 0, VelSet]
type = VelSet
trigger1 = time = 21
x = P2DIST X
y = P2DIST Y

Share this post


Link to post
Share on other sites

0 answers to this question

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now