originalnicodr / RELit

Mod to spawn lights in RE Engine games
https://framedsc.com/GeneralGuides/relit.htm
25 stars 4 forks source link

Use `set_SameJointConstraints` to change the orientation of the spotlights #2

Open originalnicodr opened 2 years ago

originalnicodr commented 2 years ago

Quoting what I have been told when asking around about this:

You can probably move it by parenting the light's transform to the camera GameObject, then unparenting when finished moving it. When you change a transform's parent, you should call set_SameJointConstraints on the parent transform. Not to change it but just to call it, because calling it seems to do something that completes the parent-child relationship. Otherwise often the child wont move when you set its transform

Maybe this repo would help.

FransBouma commented 2 years ago

yes I know what they mean: first call set_Parent with the transform of the camera. Now the light moves with the camera (I did that yesterday). I didn't know what to do after that, so I ditched it but I saw in the RE8 modelviewer mod that they simply used set_Parent with nil to stop making the light move with the camera. So it's an alternative to what we currently do (writing the matrix).