- Home /
How to access bounds of entity in ECS ?
If I have the entity as a variable how can I get the bounding box coordinates in realworld by code?
Comment
Best Answer
Answer by andrew-lukasik · Nov 25, 2020 at 10:24 AM
using Unity.Mathematics; using Unity.Rendering;
AABB aabb = entityManager.GetComponentData<WorldRenderBounds>( entity ).Value;
float3 center = aabb.Center;
float3 size = aabb.Extents * 2f;