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 / Dark Physics - Character Controller and gravity

Author
Message
Quantum Fusion
16
Years of Service
User Offline
Joined: 1st Aug 2008
Location: The Great White North
Posted: 10th Nov 2008 04:48
I've tried for a while now to get the character controller to work correctly with gravity.

I've searched the forum and tried the examples and ideas people have posted, but none of them successfully get the correct gravity outcome on the character controller.

No matter what I try, gravity will not affect the controller. It affects everything else in the map, but not it. (and it always falls a slow speed, while other things do not)


When I experimented with adding this "phy make rigid body dynamic box CharID" to the controller, it made it unstable and tumbled around as I walked through the map.


So has anyone successfully gotten gravity to work normally with the character controller?

Dual-Core Pentium D @ 3.00GHz, 1.0 GB nVidia GeForce 8500 GT, 20" Wide screen LCD @ 10,000:1 Contrast, 4.0 GB DDR2 SDRAM, Triple-boot: 32-bit Windows XP MCE, 64-bit Vista, 64-bit Linux Ubuntu
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 10th Nov 2008 07:45
have tried move the mass of the object from the center to its feet, I know someone had do this as a quick fix.

Dark Physics makes any hot drink go cold.
Tv Xxx
17
Years of Service
User Offline
Joined: 23rd Sep 2007
Location: Behind You!
Posted: 10th Nov 2008 14:36
yes i have, and its simple really, u may of noticed that when you move, the character controller falls normally, but when your still, it hardly falls at all,

so in your main loop, move it forward a little bit, then back a little bit, havnt use charactor controller in a while, but i seem to remember it being something like...



That Should Make It Fall With Gravity, Obviously Changing The Amount It Moves Effects The Speed of the falling, and i normally change

Phy Set Gravity 0, -98, 0

Making Gravity 10 Times Stronger, as gravity is 9.81(ish)

Yours Tv.

Quantum Fusion
16
Years of Service
User Offline
Joined: 1st Aug 2008
Location: The Great White North
Posted: 10th Nov 2008 16:55
Tv Xxx: Yup! That did the trick! Thank you. Its a simple solution, and quite clever.


To those who will run into this problem in the future:

Simply replace all instances of;

PHY MOVE CHARACTER CONTROLLER CHARACTERID#, 0.0

With;

PHY MOVE CHARACTER CONTROLLER CHARACTERID#, 1
PHY MOVE CHARACTER CONTROLLER CHARACTERID#, -1

Dual-Core Pentium D @ 3.00GHz, 1.0 GB nVidia GeForce 8500 GT, 20" Wide screen LCD @ 10,000:1 Contrast, 4.0 GB DDR2 SDRAM, Triple-boot: 32-bit Windows XP MCE, 64-bit Vista, 64-bit Linux Ubuntu
roka
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location:
Posted: 10th Nov 2008 19:36
i use this in my FPS and work perfect

for the force Y



for my jump



Roka The French Boy
Tinyschu
18
Years of Service
User Offline
Joined: 31st Dec 2005
Location: Toxin Games Studio
Posted: 19th Nov 2008 04:29
Quote: "Phy Set Gravity 0, -98, 0"


What I use is the code:

phy set fixed timing 100

to make it seem the gravity is stronger to fit the proper scale in the scene. The reason being, by expierence, is that when you boost up the actual gravity, it will sometimes cause strange behavior towards dynamic rigid bodies like having them jitter up and down even though they are not being touched by another entity. This happens mostly towards larger rigid bodies. I just wanted to let you know about that.

Dark Fire
16
Years of Service
User Offline
Joined: 23rd Jun 2008
Location: In the code you write
Posted: 19th Nov 2008 18:02
@Quantum Fusion - I used a dynamic object and used:



So the object didn't roll over.

Also, I used phy set fixed timing to speed up the simulation.

Just position the dynamic object at the position of the character controller. (Except for the y coord)



Don't forget to make it the dynamic object also kinematic!

Hope that helps!

Dark Fire

My future self met up with one day to teach me what I know today.

Login to post a reply

Server time is: 2024-11-24 18:54:28
Your offset time is: 2024-11-24 18:54:28