#Rigid Body Movement system, need help and explanation

1 messages · Page 1 of 1 (latest)

leaden sigil
#

Hello! I'm VERY new to unity development, and I've been watching a bunch of tutorials (Atleast as many as I could find using the new movement system) on how to make rigidbody movement. I have since then tried to program my own movement system by tearing off bits from each video I've watched, adding them to my code, then losing my mind trying to figure out "Ok, why hasn't this worked?". All the tutorials I've found don't explain what they're doing, how it works, the functions they call on, etc.. i have a 2 goals for my movement system (Because of this video: https://www.youtube.com/watch?v=z3dequX5g_E), I want to use a rigid body (I want a swinging grappling hook so I need characters to be affected by physics), and I want to use rigidbody.AddForce (Because of the aforementioned video, and because I'd like the movement to be a little realistic) meaning I have to solve the problem of sliding with a force dampener, meaning i have to make a method to detect when my player is grounded (Which I needed for jumping anyways), I'll also need a way to stop the character from sliding on slopes, learn how to make stairs work, etc.. My biggest problem right now is just that I haven't really been able to find any tutorial that uses the new input system on rigid bodies, follows my goals, and actually explains what's happening, why they're doing it, what the thing does. So, if there's anyone willing to actually teach me, I would be forever grateful.

If you're using a Rigidbody for your player controller, this video is definitely for you! Here are some tips and tricks to help you build a better character controller in your Unity game!

#unity

--
Music used:
Tokyo Music Walker - Gotta Go
A Hat in Time - Train Rush [Remix] - Qumu
Blue Wednesday - New Shoes
Art Of Silence - Uniq
Nutcracker by ...

▶ Play video
uneven quiver
#

Hello, I am also not the most experienced with Unity, but I do know the solution to some of your problems if you still need help with it. For checking if the player is grounded, a raycast works really well. You can make this raycast be sent straight down from the bottom of your character (only about 0.1f maxDistance) and detect if there is something beneath it. If you only want them to be able to jump when on the ground, and not enemies or other non-ground game objects, you can set the layer of your ground objects and use a layerMask on the raycast. For stairs, the best way to make them is to cheat by having the collider just be a ramp even though the mesh is of stairs.
https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Physics.Raycast.html