[TUTORIAL] Physics Handle / Pick Up Physics Objects

Hey I tried following your tutorial but I got as far as Add Physics Handle Component and ran into a problem, I don’t have the transform input,any ideas whats wrong?

cheers.

R5Lbeng.png

Hey Bowen,

Firstly, Right-click and Get Actor Transform, from the orange transform node drag it out and then type Add Physics Handle Component.

Pretty sure that’s it.

Hey, that has solved my problem and given me the correct box, thanks

Update: Just got this thing working,

Had to set Physics Object Types as an array and add PhysicsBody as an object type to solve another problem, I don’t think this is mentioned.

yl4WQdA.png

Hi there, thanks a lot for the the tutorial it was a great help for me. I’ve got just one question if you don’t mind, I need to get this to work on a tablet where when I touch on the tablet grabs an a object and when I release it drops the object, please see below for my noobish attempt. any ideas where I’m going wrong?

I’ve also tried it with a duplicate equals enum and a branch off that with the true going into the physics handle active and the false going into the physics handle deactive which didn’t work also

thanks

923e399310ee370f69f0c4150b780004eaa30605.jpeg

First Trace sends object moving?

Hi ,
This is a great tutorial which has helped me a lot. I have my character BP set up so it can push and pull objects. However on the first trace it moves the target object. My character blueprint is almost identical to the tutorial. I only want the actor to be able to push and pull the box, so I have left out the controls for impulse.

I also posted the details in this thread. Maybe someone can see something obvious I am doing wrong? Thanks in advance.

  1. when I send out the first trace to detect physics objects, it sends the object moving.
  2. all subsequent traces work as expected and do not move the box.
  3. when I trace (T key for testing) and hold down the move key (A or D) I can push and pull the box. The box moves relative to the actor.

Any ideas why the first trace would cause the box to move? ( subsequent ones do not and perform as expected) I am guessing I am missing something simple?
Notes: I am constraining the box on the Y axis. Also note this is a side scroller and not 3rd person.


image 1

image 2

image 3

Hi Renderdog,

Do you have any of the variable set to a non-default value that could be effecting this? Most of the variables are set to zero/false.

Here is a list of all variables and their default values.

https://wiki.unrealengine.com/Pick_Up_Physics_Object_Tutorial

hi TJ,

Thank you very much for responding. I appreciate any insight you may have.

  1. I checked all of my default values. Everyone matched except for “pick up distance” was set to 0 as a default.
    2)I changed it to 250 to match my set distance. (I also tried with 500 default value) I was hopeful, but when I tried it a again I got the same behavior. The first trace still moved the box in the same way as described above.
  2. using 4.76 with the 3d scroller template as a starting point
  • I have also tried re-arranging where the “SET otherItemLocation” lives in the chain. IE between the LineTrace ForObjects and the Branch , or further down the chain. I have watched the simulation in the event graph and I am stumped. What is so strange is that after that 1st trace , everything performs as expected. My goal is pretty simple, I want the actor to be able to push and pull the box to new locations, which works after the first trace. My setup “appears to be” the same as the tutorial however I am not using the impulse.

If you have any other insights they would be greatly appreciated. Thanks -Greg

TJ, is it possible to bind the physics object to a socket?

So when i activate the pickup, it goes straight to the hand and fires out from there?

Im looking to simulate a dice throw effect.

Good idea, didnt think of that ;), ill see how it looks cheers.

I haven’t actually implemented this tutorial myself, but reading through the blueprint image I have a couple of questions/observations.

From the BreakHitResult node, the HitComponent is fed into various other nodes, a couple of which are on a separate execution path from that in which the LineTraceForObjects node was executed. I’m primarily a C++ programmer and don’t use blueprints a lot, but to me this looks like it shouldn’t work. I would have assumed that return values did not persist across different events. Even if the value from the previous execution remains valid, this still looks unsafe since the line trace could potentially have failed.

Also, it looks like a new Physics Handle component is created with every new mouse click, but nowhere are they destroyed. Wouldn’t this result in a continually increasing stack of components?

Is it possible to use this tutorial as base and modify it something similar to Portal 2?
I would need this pick up object interaction, but the object being held in place and always snaps back to it’s original rotation(XYZ).
I also had an issue with this. When I hold an object, when I rotate, the object does not rotate with the player, instead it stays in it’s rotation when it was picked up.
So in summary, can this be modified to be something like in Portal 2?
If yes, then can some1 guide me through please?

Hi

I follow all steps, but I’ve not tested yet. I built this tutorial into a new brank blueprint class. Because I intend to understand how I can access through the “ThirdPersonCharacter” external classes like any movement or input action within PlayerController for example.

Could you, please, to exemplify how I can achieve it? Will be of great help.

Thanks

B

This is just such a great Tutorial. I’m currently leaning quite heavily on this so thank you!

I’d like to be the first to express interest in a C++ tutorial of this.

I think it would be a great learning tool, to be able to do it first in BP and then, to take it over to C++!

I wonder if anyone else is also interested?

Hi @TJ_Ballard I stumbled across a problem in this blueprint… when ever i try to pick up objects nothing happens and the message log gets filled whit “Accessed none ‘physics handle’ from set target location and rotation in graph blah blah blah

Never mind the last post, now they just automagically launch off in space when i try to grab

Sorry to reply so long after you posted the tutorial, but I just started up. Does this blueprint work in 4.7.6? I recreated everything inside my FirstPersonCharacter blueprint and doesn´t seem to do anything when I testplay.
Thanks in advance

Hi, first of all, thanks for the tutorial. For some reason whenever I try to pick up something in the default First Person map, specifically the white cubes, they seem to be anchored to the floor. They won’t get lifted up for than a foot or so, and give me trouble moving them around. Do you know what could be wrong? Thanks in advance.

Hi

I am not well versed in blueprint communication.
I made a external blueprint to PhysicsHandle only. But I can not imagine how to call this external blueprint within the thirdpersoncharacter pressing any key,

What kind of casting I should to use to call the PhysicsHandle function in my thirdpersoncharacter pawn?

Hi all.
I’m interesting is there any solution to save rotation of grabbed object? I mean when I grab it, it saves it’s rotation but rotates relatively player rotation. As if use “Attach Actor To Actor”.
Ty.

I don’t know if this thread is still active but I hope so! I Tried your tutorial in a Blank Template and put in my own animations and movement inputs (so no First Person Camera) I instead used just “camera” Which was mounted on a boom. Is this why It isn’t working for me?? I have tried this tutorial three times just to be sure it wasn’t me, but no dice. I think its the camera node.