# Is there an easy way using simple physics?

**URL:** https://forum.castle-engine.io/t/is-there-an-easy-way-using-simple-physics/1466
**Category:** Uncategorized
**Created:** [December 15, 2024, 6:08pm UTC](https://forum.castle-engine.io/t/is-there-an-easy-way-using-simple-physics/1466 "2024-12-15T18:08:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Recongalina](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/recongalina/32/1530_2.png) [@Recongalina](https://forum.castle-engine.io/u/Recongalina)
#### Post date: [December 15, 2024, 6:08pm UTC](https://forum.castle-engine.io/t/is-there-an-easy-way-using-simple-physics/1466/1 "2024-12-15T18:08:07Z")

</div>

I’m trying to write a navigation class to implement my third person character control system. I was inspired by the game Ragnarok Online 2: GOTW. The idea is that when I press the direction buttons, the character turns and moves in the selected direction relative by the camera direction, and not the character itself.

For not to bother with writing a system for handling collision reactions, I used physics with TCastleRigidBody. But for my task this system is too physical. I don’t like how the character skids on turns, bounces off walls, etc.  
If I understand the code of TCastleWalkNavigation and TCastleThirdPersonNavigation correctly, these classes implement their own simple physics that cannot be reused in user navigation classes.

Maybe I just misunderstood the situation and there is a way to use simple physics in my navigation classes?

PS: Also, my character and camera has different navigation classes. This is makes so that the camera can be controlled in different ways depending on the context, and the character control is the same.  
 ![image](https://forum.castle-engine.io/uploads/default/original/2X/3/3c1cf148436edc5f7f585798ec270eb6e68c3181.png)

---

<div class="post-metadata">

### Author: ![Recongalina](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/recongalina/32/1530_2.png) [@Recongalina](https://forum.castle-engine.io/u/Recongalina)
#### Post date: [December 16, 2024, 2:23pm UTC](https://forum.castle-engine.io/t/is-there-an-easy-way-using-simple-physics/1466/2 "2024-12-16T14:23:04Z")

</div>

I reworked my character navigation by using velocity, it became much smoother and clearer. There are some difficulties with maintaining gravity - direct setting of velocity resets the vertical speed received from gravity. I had to save the component of velocity from gravity direction and seems to it work.

PS: Yes, I know, I needs some serious rework for walking animation

---

<div class="post-metadata">

### Author: ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)
#### Post date: [December 16, 2024, 3:21pm UTC](https://forum.castle-engine.io/t/is-there-an-easy-way-using-simple-physics/1466/3 "2024-12-16T15:21:38Z")

</div>

Having a physical-based navigation components in CGE is our important TODO, and it has actually been already done by _Andrzej Kilijański_ and now waits for my review + merge for over a year. (I know, way too long! – things take me time, and I know there are things there I’d like to tweak first, e.g. it relies on new TCastleAxis, which I want to extend). See

- roadmap point: [Roadmap | Manual | Castle Game Engine](https://castle-engine.io/roadmap#_in_progress_new_navigation_components_that_support_physics_out_of_the_box)

- pull request: [New physics based first/third person 3d and platformer like modular navigation + input axis and others by and3md · Pull Request #533 · castle-engine/castle-engine · GitHub](https://github.com/castle-engine/castle-engine/pull/533)

- You can checkout the PR branch (`physics_third_person_navigation`) and see how it’s implemented there. See the PR description for overview. You can also just use the branch (let me know if you want to do so, I can rebase it based on latest CGE).

Indeed, the current `TCastleWalkNavigation` and `TCastleThirdPersonNavigation` by default use our “own simple physics” (documented as _" 13. Old system for collisions and gravity"_ section of this manual: [Physics | Manual | Castle Game Engine](https://castle-engine.io/physics#_old_system_for_collisions_and_gravity) ). These are not realistic / really physical.

The `TCastleThirdPersonNavigation` has a mode to move using physics, see

- [TCastleThirdPersonNavigation.ChangeTransformation](https://castle-engine.io/apidoc/html/CastleThirdPersonNavigation.TCastleThirdPersonNavigation.html#ChangeTransformation)
- [TChangeTransformation](https://castle-engine.io/apidoc/html/CastleThirdPersonNavigation.html#TChangeTransformation)

This does part of the job, but the new components in PR [New physics based first/third person 3d and platformer like modular navigation + input axis and others by and3md · Pull Request #533 · castle-engine/castle-engine · GitHub](https://github.com/castle-engine/castle-engine/pull/533) are better 🙂

Once we merge the new components, `TCastleWalkNavigation` and `TCastleThirdPersonNavigation` will be deprecated.
