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.

Categories

+9 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 (1 point)

3 Answers

+6 votes

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

answered by (1 point)
+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 (1 point)
+1 vote

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

var state: PlayerState = PlayerState.GROUNDED

answered by (1.1k points)
...