playMaker

Author Topic: how to keep object on ground  (Read 4447 times)

wallaceb68

  • Junior Playmaker
  • **
  • Posts: 87
how to keep object on ground
« on: September 26, 2013, 03:17:45 PM »
i have an object that i need to move over uneven terrain to an itween path.
it does fine once it gets to the path but on the way there it doesnt follow the terrain, it takes a straight bee line path there. how can i get it to stay grounded getting to the path?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: how to keep object on ground
« Reply #1 on: September 27, 2013, 01:55:51 AM »
Hi,

 Is it a character? It should conform to the terrain.

 else, you need to raycast down from the gameObject, and get the hit position, that's the position you would set the gameobject. Warning this will have a side effect of having the gameobject half under the terrain, so you likely want a dummy gameobject representing the bottom of the gameObject and attach the gameobject to that. and have that dummy follow the terrain. Or you translate the hit position accordingly.



bye,

 Jean

wallaceb68

  • Junior Playmaker
  • **
  • Posts: 87
Re: how to keep object on ground
« Reply #2 on: September 27, 2013, 09:42:20 AM »
jean it is just a sphere. and that is what im using it for. can you elaborate  on using the raycast? how to set it up.

wallaceb68

  • Junior Playmaker
  • **
  • Posts: 87
Re: how to keep object on ground
« Reply #3 on: September 27, 2013, 02:00:36 PM »
ok let me reword this.(sometimes i get it all wrong)

i have a Ball(sphere) that i want it to go from point A to point B but follow an uneven terrain. what would be the suggestion for the component's to get it to follow the uneven terrain?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: how to keep object on ground
« Reply #4 on: September 30, 2013, 02:09:10 AM »
Hi,

 If your ball is a physics object, then it will follow the terrain naturally. Study the m2h game port to playmaker to see how it works.

https://hutonggames.fogbugz.com/default.asp?W881

If your ball is not a physics entity, then you need to raycast down and position the sphere using the hit point - the sphere radius, then your sphere will follow the terrain.

bye,

 Jean

wallaceb68

  • Junior Playmaker
  • **
  • Posts: 87
Re: how to keep object on ground
« Reply #5 on: March 22, 2014, 01:17:12 AM »
OK i'm back to this problem, i'm just not getting it, i have it set up where the sphere follows the itween path and the object gets parented to the sphere, but i just cant get the object to move over an uneven terrain, does anyone have a step by step instruction on how to do this? thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: how to keep object on ground
« Reply #6 on: March 25, 2014, 09:11:22 AM »
Hi,

 can you precise exactly what is not working here? is it the placement, is the raycasting? is it the combination of itween and moving it then back to the terrain?

bye,

 Jean