Projectile Movement + capsule collision = can't rotate capsule = usless

It seems to be the simplest task:
to make an arrow with a capsule collision and a projectile movement.
But if I make capsule collision the root, then I won’t be able to rotate it and the arrow will fly vertically. But if you add the Scene component as the root, then the projectile movement stops working.

I can probably call SetUpdatedComponent and set a collision in it, not the root scene, but WTF.
No, it’s useless anyway.
nothing changes, even if I set it via SetUpdatedComponent. The Rotation will disappear.

Hey @Kamikadza1313!

If you make the capsule collision the root, you then want to rotate it to have the top be level with your forward on the actor. Then put the arrow in as a child of the capsule, add projectile movement component and give it a speed… and that should be it. Can you show us the code you’re working with, your hierarchy, et cetera? Also make sure it doesn’t spawn inside your actor that’s spawning it!

1 Like

Hey @Kamikadza1313! Did you get it figured out? Let us know how it’s going or if you got it figured out for future answer seekers!

I just don’t understand how everything can be SO broken.

Let’s start with a simple one -
In order for the projectile movement to work properly, something with a collision must be at the root.

Make new Root + ctrl+z + make again = bug?

Gif Explanation:
Everything that is the root cannot be rotated - let’s take this as a feature of the engine.
If you just create a capsule, then it can be rotated (obviously).
If I make a capsule with the root, it stands up vertically.
but! If I first rotate the capsule, make it the root, cancel the action via ctrl+z, and then make it the root again, the capsule remains horizontal.

And I think I got what I wanted - now the capsule is rooted and positioned horizontally.
But it still doesn’t work as it should.
If you just spawn the actor, then yes, it is horizontal.



And I can even make it move as I need to.
see red arrow gizmo z axis


This already shows that some kind of nonsense is going on. After all, it is clearly visible on the capsule that the horizontal movement along the x-axis.
But for proper movement, you need to set the z-axis.

arrow_shoot

But if I turn on the “follow velocity” rotation, I see a broken movement.


arrow_shoot_follow_velocity

Let’s consider another option -
If the capsule is vertical.


I can use the construction script to change the rotation.



Now the shells are flying up. It didn’t do anything.
Well, or if we change the direction of movement properly, they still fly vertically.

In fact, did I come to this position, which I got through a bug? and explained in the comment above.
A fundamentally different solution is needed here.

Hi there,

Thats the correct approach and you can simply not use as root your capsule. Try another object as root and attach to that then rotate.

  1. For your projectile base root component of your projectile actor is not collision
  2. You have your root component as a mesh or scene component
  3. Your collision is subobject of the root.
  4. Your Projectile movement is set to root or your actual parent mesh.

Something like this for shoot 3rdPerson (Ofcourse deployment should be improved)

This option does not work:
I tried to use it. But the collision starts working EXTREMELY strangely.
Through walls that have a Block All - arrow passes through and does not trigger events. But sometimes arrow runs into the main character.






I’m tired of trying to figure out why it works this way (it doesn’t work)
The ProjectileMovement is just broken.

So you seem to be fix the rotation which is good still it’s my bad misdirected you about the node name, sorry for that. You should be setting

Here is a replicated version of your setup even I would like to show why you don’t need a rotation even.

A new projectile bp actor

Add a collision and movement component.

Additionally i check only rotation follows velocity on component.

No Collision on Mesh

Box is blockall since you made like that however depending on the setup can be something else. ProjectileMovementComponent generally works on block however on some advanced setups overlaps are required, for penetration, multi body overlaps etc. Out of the box “BlockAll” will work.

On projectile logic ther is nothing but a print name on hits.

On my player pawn we do something like this to spawn

I set transform to a bit away from player so we make sure that it doesn’t hit player on start on this setup.

Should be working like this without major issues. There are some problems with the ProjectileMovementComponent itself and I feel generally some design decisions around it however core fundamentals should be working as demonstrated.