Download

Physics Handle grab problem

Hi,

I have problem with physics handle grab operation. As long as I click on object everything is ok, but when I click somewhere else (nothing should happen) object jumps/moves in random direction.

Here is video with my problem:
Video with problem

Here is my blueprint:
2736790bd5eae6fe4aaf39fb5144aa83425fc9db.png

Trace Function
0af5207aa3d825ddc3daf183df270e15f41013bf.png

Do you have any ideas what is wrong?

Thanks in advance

Any ideas? This problem is rather urgent. For me it seems like problem is inside trace function. Bad component is returned but dont know why and what should I do to fix it because everything seems normal there.

PS. Verry sorry to bump this but 3 days passed from first post

How can you click on anything else if when you release the button it drops the item?

You should branch on the return value of your single line trace, it’s false when nothing is hit, that’s why you would get accessed none, only continue if it’s true, you wouldn’t need the IsValid macro then.

If hit object does not have the tag (i presume this means it isn’t grabbable), you should return and not continue, have your function return a bool, true if it got on an a grabbable actor, and false otherwise. All failures here should return false.
After the trace function you branch on the trace result, and only grab component if it’s true. This will also stop accessed none errors.

Possibly you should set grabbed component to none if it didn’t hit a grabbable actor. Your event tick should only continue if PhysicsGrabbedComponent is valid AND physcicshandle is active, that might be redundant but, just to be sure.

I done this in the character, so replace reference to self with your character:
pretty much the same except the branch:

sM2tKmn.png

the trace: (note the multiple return nodes)

CVuGbRF.png

This should fix any problems with accessed none. It works fine for me, if it doesn’t for you,. there musn’t be something else wrong. I notice you are using the old trace? Don’t know how that will affect it.

Thank you very much! It seems to work now. That’s how great community helps bring creative projects to life.