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 Physics & Dark A.I. & Dark Dynamix / (GDK + Physics) Easy jumping with dynamic objects (raycasts)

Author
Message
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 4th Oct 2010 01:37 Edited at: 8th Oct 2010 01:55
ATTENTION MODS: Could you please change the name to
"(GDK/DBpro + Physics) Easy jumping with dynamic objects (raycasts)"
Thank you


DarkBasic Pro version at bottom

Well I just got it working today
Ok well let's get to it, this is a pretty accurate way to make a dynamic object (your player for example if your not using character controllers) jump easily!

Object 1 is my dynamic object
coly is the variable for the raycasts

First of all you need to declare to objects position if you already haven't, must be inside your loop.


Next, after that, inside your loop place this.


Alright after that simply place this (This will make the spacebar the button for the player to press to make the object jump)


You guys can edit the codes to your liking, some of the main things you will want to edit are:

and

mainly the 50 in dbPhyAddRigidBodyForce because that chooses how high the player will jump, the coly's can also do that but it's simpler to just change the 50s.


This is a demo of it working, with this you can jump around, and move the sphere using the arrow keys.



This is the Darkbasic Pro version of it (Thank HowDo for this):


Thanks to (for helping me with my errors on the forum with this particular thing):
HowDo
Fatal Berseker

I want coke, not Pepsi!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Oct 2010 12:08
if you can stick your working demo of this I and I'll see if can make it do the same in Darkbasic.

Cheers.

Dark Physics makes any hot drink go cold.
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 4th Oct 2010 17:37
Ok, i'll add it at the end, after you have it working, if you want, you could give me the code and I could just make it here in this thread then get a mod to change the name

I want coke, not Pepsi!
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 7th Oct 2010 01:19
I thought this would be more helpful.

I want coke, not Pepsi!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 7th Oct 2010 16:55
here we are a basic version of the above.



Dark Physics makes any hot drink go cold.
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 8th Oct 2010 01:51 Edited at: 8th Oct 2010 05:32
Thank you HowDo, I appreciate that and will add it above.

I want coke, not Pepsi!

Login to post a reply

Server time is: 2024-11-24 12:37:27
Your offset time is: 2024-11-24 12:37:27