Home Tutorials Download Beta Store Forum Documentation KnowledgeBase Wiki Blog

ShiVa3D

Return to Game programming

slippy moving platform  [SOLVED]

All about the StoneScript

slippy moving platform

Postby freezer » 28 May 2012, 19:29

this one is confusing, basically we have a dynamic platform (actually currently static), it has the following in an ai
Code: Select all
dynamics.setKinematic(this.getObject(), true)


our user though just slides straight off, but a standard dynamic ball put on it acts like it should.

we see nothing out of the usual on the user, what could be causing it to slide so? any ideas?
freezer
Gold Boarder
Gold Boarder
 
Posts: 216

Re: slippy moving platform

Postby broozar » 28 May 2012, 20:02

setKinematic makes an object "immune" to any external force, bodies with this flag move only when you adjust their velocity.
if you want to move anything on top of such a platform, it is probably safest to either parent it or set it as kinematic as well and match velocities. besides that, your player and the "standard dynamics ball" (whatever that is) certainly have different setups, otherwise they would not behave differently. i also don't understand how something slips off a "currently static" "moving" platform....
User avatar
broozar
Platinum Boarder
Platinum Boarder
 
Posts: 3568
Location: Berlin - Germany

Re: slippy moving platform  [SOLVED]

Postby freezer » 28 May 2012, 20:11

right, i've found it...

a ray is cast to check if on the ground and control radically changes when in the air...


scene.getFirstHitCollider() was being used, so, as well i've now checked for sensor and added one to the platform...

had to be silly, oops ;)
freezer
Gold Boarder
Gold Boarder
 
Posts: 216


Return to Game programming