playMaker

Author Topic: Align vehicle to ground  (Read 2764 times)

Hum

  • Playmaker Newbie
  • *
  • Posts: 2
Align vehicle to ground
« on: March 18, 2014, 05:38:26 PM »
Because I'm quite proud of myself for getting this to work and just to say hi I figured I'd post this up.
This action allows you to align a vehicle to the ground using empty gameobjects that follow a character controllers movement.
Maybe somebody will find it useful.  Sample scene attached.

Just started using Playmaker a few days ago and I'm fairly new to coding so if you try it out and find any problems let me know. For my purposes(aligning an AI tank to the floor) it's working out just fine.


« Last Edit: March 19, 2014, 01:36:11 PM by Hum »

rojosedano

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Align vehicle to ground
« Reply #1 on: March 19, 2014, 12:03:55 PM »
Hello, I've tried but get nothing, can add an example?

thanks

Hum

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Align vehicle to ground
« Reply #2 on: March 19, 2014, 01:45:22 PM »
Added a sample scene for ya.  It's pretty simple. 

Just add an FSM to the gameobject you want to align. 
Add the wheels to the FSM as gameobject variables. 
Set the wheels array count in the action to the number of wheels you're using and add the wheels gameobjects to the list.
You can use the layermask option to add as many layers as you want to be treated as ground.

If your wheels are static in your mesh, like in my case, you can use empty gameobjects aligned to the wheels and parented to the vehicle body instead.
Let me know if you have any trouble with it :)