Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: HyperThermal on February 04, 2015, 05:25:18 PM

Title: Setting Rigidbody Player to move up and down slopes like a Character Controller
Post by: HyperThermal on February 04, 2015, 05:25:18 PM
I'm using a rigidbody with no gravity, not set to kinematic. The player is moved by setting velocity. How can I get proper slope movement, allowing the controller to move up slopes, but also go down without switching to the falling state?
Title: Re: Setting Rigidbody Player to move up and down slopes like a Character Controller
Post by: Lane on February 04, 2015, 05:32:33 PM
So, you're not using gravity... But you want to use gravity?..
Title: Re: Setting Rigidbody Player to move up and down slopes like a Character Controller
Post by: HyperThermal on February 04, 2015, 07:51:15 PM
So, you're not using gravity... But you want to use gravity?..
The reason why I've chosen to disable gravity is because of issues I have run into with using SetVelocity. If the gravity is set on, gravity pulls the rigidbody down at a snail's pace. I suspect that this is related to how the Vector3 variable's Y vector is affected by SetVelocity.

The falling state uses "unofficial" gravity set by SetVector XYZ.
Title: Re: Setting Rigidbody Player to move up and down slopes like a Character Controller
Post by: Lane on February 04, 2015, 07:52:18 PM
You can adjust the Gravity power in the Physics settings.
Title: Re: Setting Rigidbody Player to move up and down slopes like a Character Controller
Post by: HyperThermal on February 10, 2015, 05:12:15 PM
I'm afraid I haven't made my issue clear.

Setting the velocity negatively affects the gravity of only the specific game object. If I were to change the universal gravity to make the player work correctly, it would make everything else worse.

The issue is with how I'm using set velocity. Because the vector3 for movement has the Y value set to 0 by default, the object is not affected by gravity much, if at all. If the Y value is modified by including a downwards velocity, the player can not move outside of a small space.
Title: Re: Setting Rigidbody Player to move up and down slopes like a Character Controller
Post by: MaeSaeDev on December 01, 2016, 04:09:21 PM
Bump

I'm also having issues with Set Velocity poorly effecting gravity. I'm wondering if I should somehow make the Vector 3 a Vector 2 without the Y axis so that the Set Velocity doesn't touch the Y velocity.

Edit**
So, I found a solution to my issue (using a gamepad btw) for future people with this issue.

First instead of Get Axis Vector (that creates a vector 3) use two Get Axis' and store two float variables. One for Vertical input and the other for Horizontal input.

Then when you use Set Velocity put in your two float variables. Leave y and vector blank.

Now gravity works with a 2d controller in 3d space!