Instantiated Object - Look At.

I’m in quite of a block right now.

I just finished the Dash move: Player presses Shift with directional key and the character makes a quick move in that direction.

As the coding is done, it’s time for the graphic part. I prepared the “Dash Lines” - a simple, animated, transparent lines indicating movement.

Now, I prepared a Prefab of a quad with these lines texture, which has to be instantiated on Player’s position AND turned to face his movement direction.

First thought: transform.LookAt, nothing simplier. BUT apparently, I cannot assign a Transform to an instantiated Prefab’s variable via Inspector. I also cannot use GameObject.Find.Transform, because it’s too slow - for a bare 0.1 second I can see how the lines are “teleporting” from the default to the correct angle after being instantiated.

Any way to make it work?

There’s also not much code to show - just simple Instantiate for now.

@ robertbu: “if you are Instantiating, you could leave the renderer off until the lines are in the correct position.”

Well, that was clever, I’d never think of it that way. But as I see now - it really works. Good thinking, thank you again! :stuck_out_tongue: