playMaker

Author Topic: Setting Rigidbody Player to move up and down slopes like a Character Controller  (Read 5465 times)

HyperThermal

  • Playmaker Newbie
  • *
  • Posts: 13
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?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
So, you're not using gravity... But you want to use gravity?..
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

HyperThermal

  • Playmaker Newbie
  • *
  • Posts: 13
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.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
You can adjust the Gravity power in the Physics settings.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

HyperThermal

  • Playmaker Newbie
  • *
  • Posts: 13
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.

MaeSaeDev

  • Playmaker Newbie
  • *
  • Posts: 1
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!

« Last Edit: December 01, 2016, 04:18:11 PM by MaeSaeDev »