pmndrs / ecctrl

πŸ•ΉοΈ A floating rigibody character controller
MIT License
530 stars 63 forks source link

Is there a way for the camera to follow the player's rotation (always be in his back) #71

Closed NicolasBrondin closed 3 months ago

NicolasBrondin commented 3 months ago

My goal is to have someone be able to play without ever touching the mouse, so the camera would always follow the player position AND rotation, I tried all the different modes but I can't find any that actually does that with a third person POV.

Did I miss something? I would love to help implementing it if needed, but for now it's hard for me to know where to start looking at in the whole code πŸ™‚

Have a nice day!

ErdongChen-Andrew commented 3 months ago

Something like Coastal World? It’s not available yet, I’ll consider adding this feature. πŸ€”

NicolasBrondin commented 3 months ago

@ErdongChen-Andrew Exactly like that !

kenil84 commented 3 months ago

I also want the same. I want to move the camera rotation by clicking on the arrow and the character should also move in that direction. Let me know if there is any cheat to do that for now.

kenil84 commented 3 months ago

Can you please share an example with me for reference? That would be a great help. Thanks!

kenil84 commented 3 months ago

This is inspiring! can you share the code snippet for this kind of implementation that the camera follows character.

I tried different approaches, but it doesn't worked for me.

ErdongChen-Andrew commented 3 months ago

Added to the Ecctrl. Try the new mode with <Ecctrl mode="FixedCamera">

NicolasBrondin commented 1 month ago

@ErdongChen-Andrew Thank you for the amazing work πŸ™

Is there any possibility to set a minimum height for the camera when using FixedCamera? Otherwise the camera is always positioned horizontally to the player.

I know there is "CamLowLimit", but it doesn't seem to work with the FixedCamera mode

ErdongChen-Andrew commented 1 month ago

@NicolasBrondin you can try using this prop: camInitDir={{ x: 0.3, y: 0 }}

NicolasBrondin commented 1 month ago

Same, the camera is still at the player's level as in the picture

Screenshot 2024-08-18 at 20 10 43
ErdongChen-Andrew commented 1 month ago

@NicolasBrondin What are your prop settings? Did you set a limit for the camera?

NicolasBrondin commented 1 month ago

@ErdongChen-Andrew For some reason, it's working now with camInitDir! I think hot reloading was messing with the prop value...

Thanks!