playMaker

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

wallaceb68

  • Junior Playmaker
  • **
  • Posts: 87
    • View Profile
how to keep object on ground
« on: September 26, 2013, 12: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: 14564
  • Official Playmaker Support
    • View Profile
Re: how to keep object on ground
« Reply #1 on: September 26, 2013, 10:55:51 PM »
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
    • View Profile
Re: how to keep object on ground
« Reply #2 on: September 27, 2013, 06: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
    • View Profile
Re: how to keep object on ground
« Reply #3 on: September 27, 2013, 11:00:36 AM »
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: 14564
  • Official Playmaker Support
    • View Profile
Re: how to keep object on ground
« Reply #4 on: September 29, 2013, 11:09:10 PM »
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
    • View Profile
Re: how to keep object on ground
« Reply #5 on: March 21, 2014, 10:17:12 PM »
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: 14564
  • Official Playmaker Support
    • View Profile
Re: how to keep object on ground
« Reply #6 on: March 25, 2014, 06: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