Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
FirstPlayerCamera - Behavior on Ladder?

drnibbert
Registered User
Quote
2023-12-25 09:44:57

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!


Guest
Guest
Quote
2023-12-25 11:38:56

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();
ccbSetSceneNodeProperty(s,"Gravity", 0);


and when you are done with the climbing, set back the scene gravity to whatever it was earlier.


drnibbert
Registered User
Quote
2023-12-25 12:46:09

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)


Sam Grady
Guest
Quote
2023-12-25 13:10:44

Just changed speed of movement to 0 and move character on y axis on 'W' and 'S' key.


drnibbert
Registered User
Quote
2023-12-25 13:16:12

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! :-)


Sam Grady
Guest
Quote
2023-12-25 13:33:52

Idk if any extension exist but I can try write one.


drnibbert
Registered User
Quote
2023-12-25 13:59:21

That would be incredible - thanks a lot for your help! :-)


SamGrady
Guest
Quote
2023-12-25 14:57:56

https://samgrady.itch.io/fps-cli...
🔎︎



SamGrady
Guest
Quote
2023-12-25 15:07:25

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.


Monks
Guest
Quote
2023-12-25 23:04:03

Thank you Samgrady


o139
Registered User
Quote
2023-12-26 08:45:31

i would just use a lift .. much cooler

but nice behavior SamGrady!


drnibbert
Registered User
Quote
2023-12-27 07:59:34

Wow thanks for posting it so fast :-) :-) Thanks a lot!


writer
Guest
Quote
2024-01-19 17:54:31

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.


writer
Guest
Quote
2024-01-20 07:51:42

because my guess on how to fix the work in physics simulation was not successful


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inter?ational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact