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.

Author
Message
Simwad
18
Years of Service
User Offline
Joined: 9th Oct 2005
Location: Zoo Station
Posted: 27th Mar 2007 13:35
I'm a little confused(nothing new) on how to have a dynamic object not be affected by gravity. For example have a floating platform that moves between to static object which the player can hope on and off. My platforms slowly fall down (affected by gravity) and for the life of me I cant work out how to stop some objects from being affected by gravity.

Do I need to apply a force or is there a command I'm missing?
Philip
20
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 27th Mar 2007 14:52
Just negate the effect of the default gravity, i.e.

set phy gravity 0, 0, 0
(I may have misspelt the command - check the command files)

Cheer if you like bears! Cheer if you like jam sandwiches!
"I highly recommend Philip" (Philip)
Hoozer
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bremerhaven (Germany)
Posted: 27th Mar 2007 18:14 Edited at: 27th Mar 2007 18:22
@ Philip: I think he only wants to exclude the object (plattform) from the gravity and not disable the whole gravity in the scene!
This is what is written in the help-file for this command:
Quote: "
PHY SET GRAVITY
Set global gravity vector.
Syntax
phy set gravity x#, y#, z#
Parameters
x# acceleration of gravity on the x axis
y# acceleration of gravity on the y axis
z# acceleration of gravity on the z axis
Returns
This command does not return a value.
Description
When using this command you can set the global gravity acceleration vector. By default this is set to 0.0, -9.8, 0.0 .
"


@ Simwad: I would say that disabling the gravity might solve the problem, but as soon as your "caracter/player" jumps on it (influenced by a seperate "hand-made" gravity) the plattform will move into the same direction as your player is falling (to say it simple: it will fall with your player untill it hits an other object) and this is surely not what you want, right?

You might can use some joints to prevent the platform from falling, but still have it react to changes of the weight that is resting on it (player) and movements. You maybe need to hide this "joint-help-objects" from the scene/eye of the player. The plattform would be connected with some other surrounding static objects which are "holding" to plattform at its location. A spring-like joint is maybe the one that might be usefull for your plattform-thing (no idea, if this is the right sort of joint, but you should have a look at the different sorts of joints to find the one usefull for your problem):
Quote: "
PHY SET DISTANCE JOINT SPRING
Set spring properties for the distance joint which will have the effect of making the joint springy.
Syntax
phy set distance joint spring ID, target#, spring#, damper#
Parameters
ID identification number of the joint
target# target value ( angle / position ) of spring where the spring force force is zero
spring# spring coefficient
damper# damper coefficient
Returns
This command does not return a value.
"


I never used joints so far, so I can't tell you anything more usefull! It was just an idea!


I hope it was at least a bit usefull.

Hoozer

AMD 64X2 4800+ (939); 2GB; GF 6800LE (@12PS, 6VS; 380 MHz, RAM: 434 MHz)
DP-Sw-Mode-Comp-Entry (updated to V. 1.3):
http://forum.thegamecreators.com/?m=forum_view&t=93582&b=5
GenlyAi
18
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Parma, Italy
Posted: 27th Mar 2007 19:05
You can use the
PHY SET RIGID BODY KINEMATIC

There is also a demo Kinematic Objects that show it's use.
If you set an object with this property, this is not affected from forces (infinite mass) but you can move it with
PHY SET RIGID BODY KINEMATIC ROTATION
and
PHY SET RIGID BODY KINEMATIC POSITION
Simwad
18
Years of Service
User Offline
Joined: 9th Oct 2005
Location: Zoo Station
Posted: 27th Mar 2007 23:16
Thanks for the feedback guys, I'll have a look into it tonight. Having a quick look at the Kinematic example looks like it holds the answer.
Philip
20
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 28th Mar 2007 00:49
Or, if you just want to disable the default gravity for one object, each game loop add a force to the object that is the inverse of the gravity vector. Job done.

Cheer if you like bears! Cheer if you like jam sandwiches!
"I highly recommend Philip" (Philip)

Login to post a reply

Server time is: 2024-04-18 14:37:59
Your offset time is: 2024-04-18 14:37:59