Unreal Engine is currently on Version 4.14.3 and as I searched the code looking for “GrabComponent” I couldn’t find the reference as described in the lesson, but instead found:
HandleComp->GrabComponentAtLocationWithRotation(ComponentToGrab, NAME_None, -ComponentToGrab->GetOwner()->GetActorLocation(), ComponentToGrab->GetOwner()->GetActorRotation());
So I substituted the following in my code instead, tested, and everything works as expected. I’m sure the code supplied in the lesson still works, but I felt I wanted to be working with current info.
// If we hit something then attach a physics handle
if (ActorHit){
PhysicsHandle->GrabComponentAtLocationWithRotation(
ComponentToGrab,
NAME_None,
ComponentToGrab->GetOwner()->GetActorLocation(),
ComponentToGrab->GetOwner()->GetActorRotation()
);
}
If I misunderstand something, please let me know!