coa Registered User |
Quote
|
2022-01-16 16:54:04 |
|
Im trying to make the player fly. but i cant find a way.
I tried each 1ms when variable is set, move node by vector up but it acts like a jump not increasing height each 1ms I have gravity on
|
coa Registered User |
Quote
|
2022-01-16 17:48:29 |
|
so i figured out that i need to turn off gravity for this to work .. is that possible with action? turn gravity on off
|
coa Registered User |
Quote
|
2022-01-16 18:00:27 |
|
the collide when moved gravity
|
just_in_case Moderator |
Quote
|
2022-01-17 13:58:24 |
|
You can use javascript to turn on or off the gravity but I don't know if the bug was fixed or not, In past there was a bug that prevents changing the gravity value during runtime. You can give it a try.
var root = ccbGetRootSceneNode(); ccbSetSceneNodeProperty(root,"Gravity", your desired gravity value here);
use the above code in execute javascript action to check if it works or not, don't forget to change the value of the gravity, delete the text in bold and put your gravity value there.
I am not sure if it will work, if it will work then it will change the gravity of the whole scene. you can't set per object gravity in Coppercube.
|
coa Registered User |
Quote
|
2022-01-17 14:16:48 |
|
ok thanks good to know the code worked,, i dont really need it now but maby someday. I added platform creation instead in my game
|
Robo Guest |
Quote
|
2022-03-17 00:47:00 |
|
In case anyone wants to know, gravity will change with the above code if physics is turned off. If on, then it wont do anything...
|
hadoken Guest |
Quote
|
2022-03-17 09:37:13 |
|
If physics turned on you could use ccbSetPhysicsVelocity(sceneNode, x, y, z) with corresponding negative or positive y-values to make your nodes fly or land.
|