So I currently have some code through which a cube with a static collider (no rigidbody) is following the mouse in 3D space through the use of Raycasting.
The problem is, if the point is close to a wall, the collider will intersect due to the wall also being a static collider. I understand that in order for collisions to work at least one object needs to be a dynamic rigidbody, but in this instance, giving either the cube or the wall a rigidbody doesn’t make sense as I don’t want either object to interact with physics. (I know kinematic rigidbodies don’t interact with physics, but they also don’t collide with non-dynamic rigidbodies, so that doesn’t help sadly).
Here’s a screenshot where the mouse is placed half way up a wall:
Is there any other way from stopping these two objects from overlapping?