pmndrs / ecctrl

🕹️ A floating rigibody character controller
MIT License
564 stars 64 forks source link

bug: needs a way to supply followLight DirectionalLight object #119

Open elisherer opened 1 month ago

elisherer commented 1 month ago

this code

      dirLight = characterModelRef.current.parent.parent.children.find(

assumes the directionalLight is at a specific level, Ecctrl might be lower in the components tree. Can we supply a ref somehow, through context maybe?

ErdongChen-Andrew commented 4 weeks ago

I know the followLight setup wasn’t ideal 😅. It’s better to give ecctrl a ref and control the light to follow its position manually.

elisherer commented 4 weeks ago

@ErdongChen-Andrew do you want a PR?

ErdongChen-Andrew commented 3 weeks ago

For the followLight? I don’t think it’s necessary, users can easily get the ecctrl position and have more flexibility to adjust the light themselves. I plan to remove this feature in a future version, but thanks for asking.