ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Help with CopperCube
forum topic indicator FirstPlayerCamera - Behavior on Ladder?
person icon
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!

person icon
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.

person icon
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)

person icon
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.

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

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

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

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

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

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

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


person icon
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.

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

Thank you Samgrady

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

i would just use a lift .. much cooler

but nice behavior SamGrady!

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

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

person icon
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.

person icon
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:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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