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 / Sparky's slide- Object isn't moving...

Author
Message
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 18th Jun 2008 01:48
I am trying to make a code where an object can move around, go up slopes, and down them, and also jump. I saw sparky's slide code and it seemed like the idea I was looking for. Se here is the code-


It is practically a replica of sparky's code. The problem is that my object won't move, or jump. It is like it is glued to the ground.

How would I change this so that it isn't stuck???

Thanks.

Your signature has been erased by a mod - 120 high maximum please
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 18th Jun 2008 17:44 Edited at: 18th Jun 2008 17:45
yeah.. its not gonna work...
you see at the end of the function it says:
dbPositionObject ( 2, x, oldy, z );

Therefore it will always position the object there, not allowing it to move.
You have replaced a vital part... You cant say

if(dbDownKey())
{
dbMoveObject ( 2, 1.0f);
}

the sliding demo would do something like this:
if (dbDownKey()== 1 ) { vx = vx - dbSin(angy); vz = vz - dbCos(angy); }

thus you get a value that would be used in the end for
dbPositionObject( 2,x,oldy,z );
that is how the object moves...
You don't have to understand it that much, just be aware if it
here is your same code with that thing in it, look closely at the diffrences:

programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 18th Jun 2008 22:43
That explanes a lot.....

Thanks

Your signature has been erased by a mod - 120 high maximum please
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 18th Jun 2008 23:43
Wait, now the sphere flys above everything and isn't getting affected by anything...

Also, it goes forward, but it doesn't stop, it goes on and on and on and on, with momentum, although I can turn it...

What is going on??

Thanks

Your signature has been erased by a mod - 120 high maximum please
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 19th Jun 2008 00:50 Edited at: 19th Jun 2008 01:06
Wait, I got it, I forgot to include something. Now, I have one more problem. My level has a tunnel system that runs underground, but when I try to go into it, my character falls. Is there something I have to do in order to make it so that sparky's collision realizes that tunnels count as ground too?

Thanks.

[edit]Wait, there is another question, when the object is on flat ground, it can't move. How would I change that? I can't figure it out....

Your signature has been erased by a mod - 120 high maximum please

Login to post a reply

Server time is: 2024-11-20 13:22:08
Your offset time is: 2024-11-20 13:22:08