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.
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!
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.
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.
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.
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.
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.
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.
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.