playcanvas / editor

Issue tracker for the PlayCanvas Editor
https://playcanvas.com/
154 stars 28 forks source link

lookAt component #671

Open marcusx2 opened 2 years ago

marcusx2 commented 2 years ago

The idea of the component is that one target will always face another target configurable by the user. Similar to aframe's lookat. Or Unity's lookAt constraint.

https://user-images.githubusercontent.com/5656275/150988639-c91207b7-94e7-4882-8291-cfc913a54148.mp4

Related issue

lscardinali commented 2 years ago

@marcusx2 isn't this similar to this? https://developer.playcanvas.com/en/tutorials/billboards/ That code can be easily adapted it seems

marcusx2 commented 2 years ago

The billboard was a more specific example. I want a look at component, where the target looks at any other target, not just the camera. In addition, this is also about editor support. I want to see the behavior in the editor before running the game.

lscardinali commented 2 years ago

You can try some extensions that allow your code to run in the editor like Leonida's Uranus or the Editor API Apart from adding features to the editor and engine, Playcanvas's approach to feature seems to want to keep the core of the engine clean and simple, then more advanced features be made avaialable in other ways like the examples page.

This is different from Unity and other engines because playcanvas is made thinking on the web, any code that is added to the engine will increase the download size of the engine for everybody that uses it, for a use case that not everybody will use.

marcusx2 commented 2 years ago

I respectfully disagree.

The features I'm asking for are present in those engines because they empower the editor, one of the main selling points of frameworks with editors like PlayCanvas. In my opinion if a feature makes it easier to code with the aid from the editor, it's worth it. That's why we have the editor in the first place, right? In particular, this feature request would make Playcanvas' editor much more powerful, coupled with being able to use constraints on timelines as well.

As a user, I'm making the feature requests I think are important and that I'd like to see. Not just me by the way, I am sure it'd be used by many people. That's why they exist in Studio and Unity. Studio is tailored for the web by the way.

I think it's nice being able to extend the editor with the editor api for specific things, but I think the features I'm asking for should not enter that realm as they are not that specific. They are powerful and would be used by a lot of people.

This feature request in particular would come along with the constraints feature request. But I decided to make a separate feature request because the constraint of looking at a particular target is one of the most used constraints.