Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.
    Last edited by tancen; 03-25-2020, 10:42 AM.

    #2
    This should help
    https://www.unrealengine.com/en-US/b...sion-filtering
    https://www.casualdistractiongames.com

    Comment


      #3
      Originally posted by OptimisticMonkey View Post

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

      Comment


        #4
        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?

        Comment


          #5
          Originally posted by Antidamage View Post
          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.

          Comment


            #6
            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.

            Comment


              #7
              Yes:

              Code:
              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.

              Comment


                #8
                Originally posted by Antidamage View Post
                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.

                Thanks.
                BTW, How to adjust the collision response at runtime with C++?
                And it isn't a grid-based game.
                Last edited by tancen; 03-31-2020, 12:51 PM.

                Comment


                  #9
                  Originally posted by TheJamsh View Post
                  Yes:

                  Code:
                  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.
                  But Your solution doesn't seem like a good idea
                  Last edited by tancen; 03-31-2020, 12:44 PM.

                  Comment


                    #10
                    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.

                    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);

                    Comment


                      #11
                      Originally posted by tancen View Post
                      But Your solution doesn't seem like a good idea
                      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.
                      Last edited by TheJamsh; 04-01-2020, 05:52 AM.

                      Comment


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

                        Comment

                        Working...
                        X