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:
- Start picking up object by pressing the gamepad trigger.
- Create a line trace.
- Obtain the component that the line trace hits on first encounter.
- Disable simulation physics flag. <-------------------------------------------------
- Start manipulating the pitch, yaw, and roll of the object.
- When satisfied, release the gamepad trigger.
- Enable simulation physics flag of the object <---------------------------------
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?
Thanks.