Rotating Projectile

Good day
In my project I have a spear actor that I throw. I apply a linear velocity to it, and it gets thrown forward. However, when I throw it, it doesn’t rotate along its arc. Does anyone know how to get it to rotate to the direction its moving? I’ve tried attaching a projectile movement component but that did nothing. Any help would be appreciated.

Isn’t there a tickbox on the projectile component to orient to movement?

I have ticked that (rotate to velocity), but nothing happened

  • Is the projectile aligned along the x axis?
  • does the ProjectileMovmentComponent have “Rotation Follows Velocity” checked set to true?
  • does the ProjectileMovmentComponent have “Initial Velocity in Local Space” checked set to true?
  • are you setting the motion through ProjectileMovmentComponent => set velocity?

Here is what I have setup as projectiles with PMC and they follow prediction perfectly

2 Likes

With projectile movement, how do i stop it despawning my spear after it lands?

It should not de-spawn automatically

Do you have “Initial Life Span” set to greater than 0 on your projectile actor?
Do you use “Destroy Actor” with reference to self in the spear blueprint

I think it has something due to bounce velocity stop simulation, in projectile bounces? It causes onprojectilestop? Cause the spear gets destroyed when it hits a certain velocity, cause it also deletes mid air

Lifespan is 0 and code works fine without projectile movement. Its only the rotating midair i cant get working

Well you must have Destroy somewhere in your BP. Try looking for it by opening it’s blueprint and in find results type in destroy and see if anything is found.
Maybe you have a kill volume setup somewhere?

Is that not what the projectile component does? destroy the projectile after it stops moving? Also, with the image you sent 3DRaven, I have it arcing like that, the problem is that while in that arc it wont rotate

Maybe try using “set updated component” from the projectile movement component & point it to your static mesh within the projectile?

Okay, i got the rotation to work with the projectile movement, it seems that activiating the compenent in the code just doesnt work. However, it instantly throws (I want the player to be able to hold it until they left click) and it still despawns, and finally im unable to rotate the spear in the x-axis, right now it is 90 degrees to the side. Thanks for all your help so far

The best solution I could find to this is just spawning a new item using the projectile movement component then deleting that and spawning in a normal item on collision
Not the best solution but I cant find an alternative