playMaker

Author Topic: Aligning an object to the floor  (Read 522 times)

gamesbinbun

  • Playmaker Newbie
  • *
  • Posts: 2
Aligning an object to the floor
« on: February 14, 2026, 11:10:43 AM »
Hello! Im trying to make an arcadey car game, and im using a sphere rolling as the base movement(i like the feel of this best, with all the sliding/drifting around)
so far the way the game works is the sphere rolls about and then the car object has a 'set position'/'get position' to follow the sphere.

My issue is that the car model isnt aligned to slopes/ramps. Does anyone know how to align it so i can drive on different surfaces and the car model will always follow?

THANK YOU!!!
« Last Edit: February 14, 2026, 11:12:31 AM by gamesbinbun »

LordHorusNL

  • Beta Group
  • Sr. Member
  • *
  • Posts: 479
Re: Aligning an object to the floor
« Reply #1 on: February 17, 2026, 04:20:06 PM »
Rotating the model to the ground normal is pretty straightforward, the UnityPackage below includes a simple way to align the model the floor.

There are various ways to achieve the same result, but this should do the trick.

gamesbinbun

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Aligning an object to the floor
« Reply #2 on: February 20, 2026, 12:53:27 PM »
Thank you so much! @LordHorusNL This is working great.
I somehow got quite close to this solution just guessing, but all the quaternion stuff is baffling. i'll have to look into it more!

Thanks again!

LordHorusNL

  • Beta Group
  • Sr. Member
  • *
  • Posts: 479
Re: Aligning an object to the floor
« Reply #3 on: February 20, 2026, 06:06:13 PM »
No problem, glad you got it to work.

Alternatively I believe you can also use a (Smooth) Look At action in combination with Vector3 Project On Plane to achieve the same result so you don't have to mess around with Quaternion actions. This is what I'm doing in PlayMaker2 to smooth things out when there are changes in the ground angle.