Does IgnoreActorWhenMoving() actually work?
I have a Ship Pawn (Physically represented by a UStaticMeshComponent, Collision = BlockAll) that shoots projectiles (Actors with a SphereComponent as its root, Collision = BlockAll). Since the muzzle of the guns are actually inside the hit box of the ship, it crashes into its own Bullets everytime I shoot.
I read about IgnoreActorWhenMoving() and thought that this sounds like just what I needed. I wrote a BeginPlay() override in my Projectile Actor that looks as follows:
But they still collide! I double checked that GetMoveIgnoreActors() returns the correct actors. It is not an option for me to set one or both of them to "OverlapAll" or "NoCollision" since I want them to collide with everything else.
I tried doing the same thing in Blueprints with exactly the same effect (which is none at all).
Edit: Here is my AProjectile Constructor (Actually much simpler than the UT projectile you posted...):
Any suggestions are greatly appreciated.
I know this is a very old question, but I couldn't find an easy answer to this on any other questions, so I thought I should answer for posterity's sake.
The API page for the IgnoreActorWhenMoving call says
"Components on the other Actor may also need to be told to do the same when they move."
I just coded up an example of an actor spawning a projectile, and I called IgnoreActorWhenMoving on the projectile's static mesh, but I also used MoveIgnoreActorAdd on the Actor responsible for spawning the projectile to make sure they don't collide with each other.
I have that code in the Controller for the actor responsible for spawning the projectile, and it seems to work great.
Hope this is helpful.
answered Jul 02 '17 at 03:59 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here