1
\$\begingroup\$

Sometimes in video games the players can walk up to certain objects for example boxes and barrels and shove them around.

How can I recreate this system? What function do I have to use to apply force in the direction I want, and make the object fall over, rotate etc... ?

Here is an example of what I want to achive: https://youtu.be/dVr2BUg_oes?si=BdZ6rtGNZ0loGnnN

https://youtu.be/eqH70ytL4Fs?si=HacUvbzPxvj5j1jl

\$\endgroup\$
3
  • \$\begingroup\$ Are you looking for how to provide force and push a box or barrel one space at a time, or are you looking for a mechanism to push something so that it continues until it hits an edge, similar to an Ice Block Puzzle? \$\endgroup\$ Commented Feb 21, 2024 at 7:37
  • 1
    \$\begingroup\$ I want to do something like this:youtu.be/dVr2BUg_oes?si=BdZ6rtGNZ0loGnnN or this youtu.be/eqH70ytL4Fs?si=HacUvbzPxvj5j1jl \$\endgroup\$
    – Nagy Lala
    Commented Feb 21, 2024 at 10:05
  • \$\begingroup\$ Ah, after a bit of searching, while I don't know that this will solve the issue, I might recommend trying to add the "Box" or "Barrel" Rigid Body to the player entity when picking it up, then applying force vial the RigidBodyConstructionInfo with the related details - basing that on here - though this may be incorrect for that library (Unfortunately, was having issues tracking it down their documentation, and haven't used it personally myself.). \$\endgroup\$ Commented Feb 21, 2024 at 10:49

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.