Fixing weird grabber behaviour

Hey,
I’ve noticed an issue with the grabber: grabbing the object not exactly on the lineTraceEnd makes it acting weird.
I managed to fix it by replacing

if(hitResult.GetActor())
	{
		physicsHandle->GrabComponentAtLocation(componentToGrab, NAME_None, lineTraceEnd);
	}

by

if(hitResult.GetActor())
	{
		physicsHandle->GrabComponentAtLocation(componentToGrab, NAME_None, hitResult.Location);
	}

Now the object slowly moves to the lineTraceEnd location and no longer has an offset between the lineTraceEnd and it’s actual location.
Maybe it has been fixed later in the course but I hope it can be useful to someone.

6 Likes

That actually fixed my weird problems completely. Thanks for this.

Before when I was using LineTraceEnd to grab component at location, if I had the grab distance too large, it wouldn’t want to really follow at all, or would lag behind greatly. It also prevented me from decoupling grabbing distance from a holding distance.

After your change, I can set whatever grab and hold distance I want and it zooms right to the hold distance after I grab it from far away. Awesome!

Privacy & Terms