Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Ball not sliding

Author
Message
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 15th May 2012 23:55
Hi,
I'm having this movement code. It is copied from the example in the sparky's directory. But I have a problem the ball doesn't slide when on tilted surfaces? Is it an error in the code, or i have to add something, because in the comments I can see that there is some code for sliding.
Forward thanks!
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 16th May 2012 00:58
Sparky's doesn't really calculate physics, it just does collision and simple gravity. I am assuming you want the ball to roll down the slope?
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 17th May 2012 13:46
Yes, i want it to roll down the slope, or slide. But i was thinking that this
makes the ball slide down a slope.
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 17th May 2012 16:24 Edited at: 17th May 2012 16:25
That is just for sliding collision, if you want actual physics try DarkDynamiX
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 17th May 2012 21:49
So it doesn't affect the position of the ball on the slope?
If not, could I put on the else side some code to make if slide, right?
Brendy boy
18
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 18th May 2012 00:33
instead of this
Quote: " //STEEP, slide x = x - oldx; z = z - oldz; oldx = SC_GetCollisionSlideX(); oldy = SC_GetCollisionSlideY(); oldz = SC_GetCollisionSlideZ(); x = x + oldx; z = z + oldz;"


try this:


Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 18th May 2012 14:58
Thank you, but the ball is stil not sliding on tilted surfaces.

Login to post a reply

Server time is: 2024-05-06 04:17:27
Your offset time is: 2024-05-06 04:17:27