Allow offsetting of collision component primitives
Currently, you have to child a model to a collision component-enabled entity if you want to handle an offset. This is actually quite a pain and non-obvious for new users. We should consider supporting a positional (and rotational?) offset in the collision component.
I was surprised that I couldn't find a way to do this in the editor. When you say "non-obvious for new users", is there currently a way to do it that isn't very clear?
Yes. One option is to create an entity with rigidbody/collision components and create a child entity with a model component and offset the model. Or vice versa.
I see that this is already an old request but the possibility to do this is still not there. I would really appreciate this feature.
that would be great, UP
Bumping this up. The only way currently to offset a collision mesh or render is to use parent/child workaround. This, however, breaks when using with imported hierarchy template.
Say, you have a level imported as a template. You want to add a collider for some object. This object requires an offset, so you cannot add component directly on it. Becuase that node is part of an entity, you cannot reparent it, e.g. put under some entity to offset it.
The workaround is to disable that node and copy it to a new entity. This allows offsetting it. However, because this new entity is not part of a template, once the master template is updated, you will lose that entity and all its children, unless there is some script attached.
We really should add this in. It's a feature that keeps getting requested as seen here: https://github.com/playcanvas/engine/issues/3758
I just ran into this issue myself... I arranged a couple models and realized I can't actually place the collision capsule over them, instead I have to offset all the child entities to be relative to the fixed position of the collision component. :( I can scale it, change its shape and axis, but I can't offset it... weird.
@MattHFoy there's a PR in progress for this in #3772
Another post about this on the forums https://forum.playcanvas.com/t/solved-objects-shaking-and-clipping-through-the-floor/25588/7
And another post on the forums: https://forum.playcanvas.com/t/is-there-an-option-for-offsets-in-collision-component/26289?u=leonidas