Download

Can Unreal players pick up objs as players can in HL2?

Thanks in advance for your replies :slight_smile:

r7874

What are you after? Gravity gun mechanics? Here’s a high level overview, though it’s definitely not enough to create the effect from scratch it might be enough to get you started. :slight_smile:

On click:

  • Line/sphere trace out from the player’s screen (I wish the cone cast available in the behavior system was available here…) however far you want the gravity gun’s range to be. Then apply a force in the opposite direction to pull the hit object near the player.
  • At the same time enable a trigger volume near the player. When a pulled object enters this volume, stop its momentum.

On release:

  • Disable trigger volume.
  • Apply a large forward force to the object to launch it away.

On right click:

  • If holding an object:
    • Disable trigger volume.
    • Stop holding that object, and allow it to fall to the floor.
  • Else:
    • Line/sphere trace out from the player’s screen however far you want the gravity gun’s range to be. Then apply a force in the forward direction to push the hit object away from the player.

If you check out the Content Examples and look after a map called Physics it holds Blueprint functions that allow a player to “pickup and hold” objects.

This is great, it’s good to know it can be done.
Thanks a million guys! :slight_smile:

r7874