New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lookat component doesn't work with spotlight #1625
Comments
Looks like the threejs spotlight has a .target object by itself. That also explains why you can't set a spotlight's orientation. Either the orientation and lookat components will have to take this into account ( which would nicely abstract this away from the user), or an additional component that sets this target is required. Or maybe the light system can keep track of them. |
been playing a bit with a quick spottarget component... if the spotlight.target is added as a child of the light, and it's pos set to 0 0 -1 orientation works as expected ( with the spot pointed along it's -z axis) |
I've been having some of these same issues when using I don't know if that's going to be of any help, however. |
by adding the light.target to a given object, you get tracking for free :-) I'm almost done with a component for (spot) light targets. Will have to check if it works for directional lights too, which also have a .target. |
@FrederickDesimpel Would love if you could add a target property (type |
I'll look into it. To have all the options you need a seperate component, but maybe the basics of it can be included in the light component yes. Maybe tagetobject (selector) and a targetoffset, so you can also give a coordinate in worldpos (relative to scene if you don't specify an object. And have it default to be added to the light itself, with an offset of (0 0 -1), so it looks down -Z ? and regular rotation works been a while i worked on that... will have to see if all that can be added to light component in a clear way All that being said, there is also still this issue |
or scratch that... just being able to set the target object is sufficient. You can always create an a-entity , hook that up and set the world position or any offset with that. |
Works like a charm now: #1728 |
spotlight.target added, thanks! |
A spotlight entity doesn't orient itself with a lookat component.
The text was updated successfully, but these errors were encountered: