Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hey Gang, i want my FPS-Controller to be able to climb up on a ladder. My idea was to set up the Ladder with a collision-box and when the player enters the Area, the "CanFly" - Property of the FPS-Behavior gets set to true and "Affected By Gravity" gets set to false. How can i implement this? I tried ccbSetSceneNodeProperty, but since "CanFly" and "Affected by Gravity" are properties of the Behavior, not the scene node itself, it didnt work. Or are there any other ways of implementing Ladder-Behavior for an FPS-Controller? Thanks for your help! |
||||
|
You don't need to change those properties. Those 2 parameters for the behaviors are unnecessary. try setting the gravity of the whole scene to 0. use this command. var s = ccbGetRootSceneNode(); and when you are done with the climbing, set back the scene gravity to whatever it was earlier. |
||||
|
Thanks for you idea! Unfortunately that doesnt produce the result i was looking for... It only prevents the player from falling after a jump, but i cant "walk upwards" like in other FPS-Games (Quake etc. is my reference) |
||||
|
Just changed speed of movement to 0 and move character on y axis on 'W' and 'S' key. |
||||
|
Thanks for your idea! :-) It just gives me the same problem: How can i change a parameter of a behavior/action at runtime? Thanks for your help! :-) |
||||
|
Idk if any extension exist but I can try write one. |
||||
|
That would be incredible - thanks a lot for your help! :-) |
||||
|
https://samgrady.itch.io/fps-cli... |
||||
|
I need to fix the rotation because, for now, you can turn the camera in any direction while you climb. Anyway, it works, not perfectly, though. |
||||
|
Thank you Samgrady |
||||
|
i would just use a lift .. much cooler but nice behavior SamGrady! |
||||
|
Wow thanks for posting it so fast :-) :-) Thanks a lot! |
||||
|
SamGrady You could do something similar with a physics simulation,well, or a first-person simulation of ascent without switching the camera with a volume in 3D space, just when I turn on the physics simulation, the camera falls to the bottom after the ascent, if it works, it will be very useful. |
||||
|
because my guess on how to fix the work in physics simulation was not successful |
|