Disable "Set Simulate Physics" but still allow collision response channel on WorldStatic and Pawn?
I'm implementing a Pick Up Object blueprint scripting taken from Content Examples, but has come to a problem where when the following order of operations are given, it is kind of wonky:
Note that the arrows pointing at the simulation physics flag order of operations.
Note about why I need to disable physics simulation. If I did nothing to it, what would happen is the when the object is picked up, because the physics simulation isn't disabled, the object will continue to swing around wildly according to the momentum the player moves the object around in the air. It will however, collides with all surrounding obstacles, which is good, but I don't want the object to spin around wildly in the air, and not being able to let the player control the pitch, yaw, and roll of the object. Disabling the physics somehow works.
I can disable the physics simulation of the object just fine, but what happens is the object will clip through walls, floors, obstacles, pawns, players, and basically any objects with collisions when the physics simulation is disabled. The player has free range of pitch, yaw, and roll of the object, and that is great. Now I wanted to have the collision response enabled for the picked up object, but I don't know what to do or where to begin.
Looking in the AnswerHub, I don't see anyone asking this question, or asking similar/relevant questions about this.
Even though the blueprint is mostly a copy from the Content Example, Physics level section in the MyCharacter blueprint, all I did was I added a "Set Simulate Physics" node to grabbing objects and releasing objects. No changes were done other than that.
Does anyone know how to add collision responses to an object with physics simulation disabled?
asked Dec 07 '14 at 12:15 AM in Blueprint Scripting
Fixed this issue.
Used this method highlighted in orange to simulate collisions while still being able to control when to simulate physics.
First thing to do is to allow physics to simulate (which I will delve later on), and concentrate on the collision responses via setting angular and linear velocities to zero, and optionally, set anything related to angular and linear velocities to zero.
Disabling physics simulation will causes the collision responses to be ignored, no matter what you do, since I believed the flag that sets the physics simulation is in the outmost condition nesting all collisions-related functions.
Next thing to do is when you release the component, reset the physics simulation in order to initialize it back to the state before you grab the component.
Note that there's no need to disable/enable physics simulation of a grabbed component here.
All that is left for you to do, is to make your collision boxes for your static meshes be thicker and bigger in your levels, so that the grabbed component won't penetrate through the collision boxes and come out on the other side of the collision boxes.
Fixed this issue, but I do wish there are other better ways to do this, like really pushing the objects towards the player upon colliding with walls, and not having the objects go through the collision boxes to the other side. Levels with thin walls will be an issue, and there will be no other options with the collision boxes for the static meshes.
Basically, Portal 1/2 pick up objects physics simulation is impossible from this point on.
answered Dec 13 '14 at 09:30 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here