Dose UE4 has functions like Unity3d's 'Physics.IgnoreCollision'?

Hi, guys!
I have a problem that how to make an actor can overlapping with specific another actor sometimes, such as skill ‘invisibility’ be cast.
So, Dose UE4 has functions like Unity3d’s ‘Physics.IgnoreCollision’?

Best.

This should help

That is can’t solve my problem. It can’t be colliding or not colliding at the time that I want.

What is the time that you want to ignore collisions? Can you explain what you’re trying to do exactly?

Are you trying to only have overlaps with certain actors? Do you want it to react physically to other actors that aren’t that actor at all?

I am making a game like ‘Bomberman’, A actor’s position doesn’t be adjusted and a collision event not be shot if A-bomb is placing on the actor’s position from itself. And if the actor moves out of the bomb, The actor will never be able to move in.
SO, I don’t need a preset way, I need a dynamically way.

Is it grid-based? I wouldn’t use physics there, I’d use movement logic to prevent game rules being broken.

If it isn’t grid-based then that’s something I’d have to look up, but you can probably adjust the collision response at runtime.

Yes:



UPrimtiveComponent::SetCollisionEnabled(...);


Personally I prefer creating new Profiles in the project settings and setting those instead via SetCollisionProfileName(). That way it’s easier to maintain collision responses accross the whole project over time.

Thanks.
BTW, How to adjust the collision response at runtime with C++?
And it isn’t a grid-based game.

Thanks.
But Your solution doesn’t seem like a good idea

I tried using profiles but they do not seem to work when objects spawn. Profile are set at BeginPlay() and the object has already been spawned and it is stuck in the wall or something. :frowning:

If you want a certain actor to ignore another certain actor: actor->MoveIgnoreActorAdd(otherActor);

If you want a certain actor to not collide with anything: actor->SetActorEnableCollsion(false);

If you want a certain component not to collide with anything: component->SetCollisionEnabled(ECollisionEnabled::NoCollision);

It’s the correct method to disable/enable collision on an actor or a primitive component.

Profiles can be set at any time, obviously if the object has already been spawned beginplay will be too late - that goes for anything. The profile determines everything from whether the objects collision is enabled, it’s collision type and it’s responses. You should set the default profile in the constructor. It makes no sense at all to set an objects “default” collision in BeginPlay().

If you need to disable collision between two specific actors, you can do so with Move Ignore Actors / Move Ignore Components - but frankly that should only be used for very specific circumstances. If you really want to go mad, you can even modify physics contacts by registering an FContactModifyCallback.

Now, It is worked.
Thanks to the people who helped me.