How to rotate bullet in the air?
I make a turret, who aims it's head at character. The new problem I have is turning a bullet. When it spawns, it gets impulse and flies away, but don't rotate. I want to make it rotate with cone's nose parallel it's moving like real. Thanks!
asked Jul 11 '18 at 08:23 AM in Blueprint Scripting
You can use "Find Look At Rotation" to rotate the bullet, giving the vector values:
Setting this once will give you a fixed rotation that won't change, so it assumes your bullet does not have physics rotation that will change it. You can also update this rotation per frame if you wish to, which involves changing the first vector value to the current bullet location, which updates. This means the rotation will be pointing toward the target location at all times, even if the target moves.
You can also use the VELOCITY (Get Velocity / Get Component Velocity) of your bullet to determine which direction it should face. Using "Find Look at Rotation", first value as your bullet location, and second value as the bullet location + velocity. You can either make sure that this rotation happens after the bullet receives an impulse (and has already a velocity higher than zero) or call it every frame (reducing performance).
answered Jul 11 '18 at 10:03 AM
Give the bullet actor a "rotational movement" component and set the rotation of the "X" axis (roll) to whatever speed you would like. This way when the bullet is spawned it will rotate around the forward vector axis like a real bullet.
answered Jul 11 '18 at 10:26 PM
Nebula Games Inc
Follow this question
Once you sign in you will be able to subscribe for any updates here