Problem Instantiating Bullet Projectile

Hello,
When I Instantiate the bullet projectile from the shoot point, it appears on the shoot point before the animation starts. If I include a delay (with a coroutine) it works. Does it exists any other solution? Could I have made a mistake at an earlier point?
Thank you!

You mean the ShootPoint moves in the first frame of your Shoot Animation and you want the Bullet to be spawned on that new position and not on the Idle ShootPoint?
I’m actually not entirely sure on the timing of the Animator, when you call SetTrigger(); I’m not sure if the animator triggers the transition immediately or not.
So the quick test is just spawn the bullet after calling SetTrigger(); Does that solve it?
If not then yes the only options is to add some kind of delay, I would assume by the next frame it’s already on the ShootAnimation

However the bullet moves super quickly (at least how I made it in the course) so the difference between the Idle and Shoot isn’t noticeable, but if you use slower bullets or different animations with a bigger distance between Idle and Shoot then yes you might need that delay.

1 Like

Hello,
Reviewing my code i just made an error placing the Invoke event method.
Sorry!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms