- Home /
Continuously change the forward direction of game object?
I'm creating a project in which I have a sphere GameObject which has empty game object as a child. A line renderer component is attached to the this empty game object.
I have made the sphere to look at the touch direction so that the line renderer of the child object also faces towards the touch position. It works fine when the sphere is rotating in one axis.
But the problem occurs when I apply a force to the sphere and it starts rotating in all axis just like a normal ball. But the line renderer attached to it is stuck to its face and when the sphere faces downwards, the line renderer goes into the ground.
I want the line renderer to always be parallel to the ground but originate from the sphere or face of the sphere. I've tried many things. But still haven't found the solution.
So please help. Thank You