My turret is supposed to fire non-homing missiles at the player location. The rotation works fine but I can’t seem to figure out how to get the missiles to move. Upon spawn, the missiles are rotated at the player but they dont move at all.
Any idea how to use the ProjectileMovement to do that?
Anyone knows? I am trying to get the projectile to spawn facing the player and then move in that direction. It is not a homing projectile. I am open to any solutions.
Sorry but I don’t understand how to attach the Projectile Movement to the base. In the screenshot above, I’ve already created the Projectile Movement component and placed it as such.
Is that considered “attached to its base”?
On a side note, I’ve managed to get it moving using an event tick and updating vector but there’s a weird problem now. Most of the time the projectile doesn’t register a collision with the player or anything in the world.
Could it be due to the way I’m updating the projectile movement using a vector?
Ah sorry, I didn’t see you actually had the projectile BP going. I would temporarily remove all logic/events you have in the projectile BP and see if you can get it moving just by spawning it in another blueprint.
Please also add a screenshot of your spawner blueprint.
The rotation of the missile is not set by the missile, it is set by the spawner(turret). Put the find look at rotation from your missile to your turret bp, and attach it to the spawn actor, right click on the transform and press the split struct, then attach it to the rotation.
For the collision problem, your collision component is changing location and teleporting somewhere else. Delete the collision sphere in the graph as target, so it becomes “self”
Ok the rotation is now in the turret bp but the projectile just zips overhead in a straight line and not at the player’s last position.
As for the projectile BP, target self does not compile unless I change from SetRelativeLocation to SetActorLocation. This will make it now aim accurately but the collision problem still persists.
I also realised that the collision only works when I am moving around. (Registers a hit and then gets destroyed) Otherwise, the missile will nudge me a little sometimes and go throught me if I am standing still.
Your get actor location in the turret bp should be connected to the (CAST TO which ever character you want to hit) instead of the get player character.
As for the projectile, use set world location, not relative location.
I’m done that like what you have suggested but it still doesn’t work…the projectile still collides only when I am moving. If it moves towards me while I am standing still, it will nudge me.
One question though, do you want a projectile that travels by movement or by teleporting?
By teleporting (from the turret instantly to your target). On your projectile bp your set world location target should be self. NOTE: this might not produce hit event unless you make your collision component big enough to hit your target. That’s why sometimes it does’t hit.
By movement (like a bullet). I suggest you delete set world location because what it does is it teleports the projectile to the set location. Your projectile movement component already takes care of the movement, it will move to the set rotation from the turret spawn actor.