Keeping an entity in a static position relative to the camera

This is necessary to create an ECS UI, which I’d like to do to allow for numerous complicated forms in the game world. I have no problem doing this in Monobehavior, but using Unity.Transforms has completely confounded me.

I’ve used every formulation I can think of and find online to set the translation. It seems, there is no way to directly set the position and rotation. Problem is, unlike the exact same math in Monobehavior, the result is a moving quad rather than a static one.

I don’t need the math; hence why I’ve not included code. I just need to know if it’s actually possible to do this in ECS, in Unity. If there’s any straightforward documentation on Unity.Transforms out there, I’d really, really appreciate a link to that as well. The current documentation reads like an engineering textbook, and documents practically no specific functionality.

Two years ago, I gave up on this. I simply can’t develop what I want to make until I can create an ECS UI. Coming back to try again, I’m about ready to give up again.

I got this to work. You’ll want to order system updates correctly- that’s what went wrong for me.

1 Like

(slapping my forehead)

Knowing it worked for anyone is encouragement. And I’ve been spoiled by OOP.

I noticed there’s a way to write custom components to act on LocalToWorld too, so maybe it’s time to try and implement a direct position write. These middlemen are killin’ me.

I used Translation & Rotation.

WorldToScreenPoint and and friends are definitely missing from Unity.Mathematics though. They keep saying they don’t want it to become a general purpose library, which I think is kinda insane- their customers need one.

1 Like

We could make our own opensource extramath library (if it doesnt already exists ! )

1 Like

Confirmed! Entirely possible with just Translation and Rotation. What was getting me is that I think of translation as a term for movement. So, I took it to mean the vector from current position to end position. It’s the vector from the worldspace origin.

Also, ECS is unreal when you start to get it working! @cultureulterior Thank you for the encouragement.