I’ve been away from Unreal Engine for a while, but with the new engine release I decided to get back into it. I wanted to build something simple to clear off the rust in my programming skills, so I decided to make a Gravity Gun, similar to the one from Half Life 2.
First, I set everything up in C++ and just set the Actor Location directly. This worked, of course, but it allowed the object to phase through other solid objects. So I did some research and found a lot of people trying to recreate this same functionality by using UPhysicsHandleComponent. I attempted to replicate this, and got pretty far, but my implementation wasn’t moving the object quickly enough.
I couldn’t really understand why, so I decided to watch many blueprint tutorials (most of them follow the same procedure) and replicate their exact steps. However, even following their blueprint exactly as they had done, I still encountered this problem.
An example tutorial is: Let's Create Half Life 2! Gravity Gun - Blueprints #12[Unreal Engine 4] - YouTube
At around the 12:10 mark, he demonstrates the Gravity Gun and you can clearly see the object move in sync with the center of his screen, such that there is no delay between when he moves and when the object moves.
However, using the same exact blueprint logic, my implementation looks like this:
You can also see at the top left corner a print statement every time I press the button that is supposed to pick the object up. When the object is stationary, SetTargetLocation does not move the object at all. I have to launch the cube into the air, and only then will SetTargetLocation do something. But you can clearly see after that, that the object does not follow as quickly as the tutorial shows.
The only difference I can immediately think of is the fact that this is UE5 and the tutorials were done in UE4, but other than that I can’t spot any other differences.
Is anyone else having this problem?