Currently I’m trying to have a projectile which fires in a straight line, and when it collides with the world, it sticks there and from that point will home onto any enemy player that comes near it.
I have all the various parts working, but the homing code is all vector math, and having played around this for a bit I’ve realized the problem is that for some reason the projectile movement component ignores any velocity change after it’s triggered a hit event. I’m assuming this is an optimization tweak, which makes sense in most situations, but if there’s anyone around who knows exactly what it’s doing to switch that off, or how I could switch it back on, that would be much appreciated.
Ok so the hit event on projectile movement components unlinks the projectile movement component from the root component so that any update events move nothing.
Fortunately the stop delegate for this happens after so you can easily fix this by calling “Set Updated Component” on your projectile movement component in the projectile movement component delegate and giving it your root component.
For example:
Now your projectile will stop when hitting an object (and still call all of its hit events) and will still be able to receive velocity changes.
Thank. You. So. Much. Spent a long time looking at print strings stating that the velocity of the projectile was what I had calculated; the projectile was stuck in place. This solved that problem.
Dude, you saved my ■■■.
Knew there was something funky going on with hit events, getting stuck, and projectile movement.
Been trying to sort this problem for days now, great stuff.