Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+7 votes

I want my character to climb a tree and want his Character2DBody Physics to change from a grounded state to a floating state so he can climb freely, anyone know how to do this?

asked in CSC380Jan2024 by (2k points)

3 Answers

+6 votes

did you try changing the motion mode from grounded to floating?

answered by (3.8k points)
+5 votes

In the Character2D inspector there should be the motion mode setting. If you right click it will let you copy the path so you can change the mode during runtime in the script.

answered by (562 points)
+1 vote

you can switch between different states for your character's physics behavior through GDScript.

var state: PlayerState = PlayerState.GROUNDED

answered by (2k points)