- Home /
Other
Using a ghost object to place things
Hey guys! I am trying to implement a feature to place objects with my player, in a 3d space (no grid). To place the objects I use a first person controller, holding the "ghost" object in my hand. It is a semi-transparent red or green object. It's green when it is not inside/colliding with anything, and it's red when it's colliding with something. It's set in "is trigger" mode, so it will not interact with anything, just like a ghost. Everything works well with most objects, like cubes, but when I try to place complex objects like trees I am forced to set the convex flag to true, creating a collider that is not representing the tree (the tree collider becomes a mesh). How can I solve that? Is there a way to create a mesh collider in trigger mode without the convex flag on? Are there other solutions or ways to do this? I know I could add other basic colliders like capsule colliders for the tree (other threads use that as a solution), but I will add more complex objects and I'm pretty sure I can't solve this problem on every object I will have just adding more colliders.