Question by
FiffH · Mar 19, 2017 at 03:44 AM ·
2d2d animation
Prefab I place in Scene faces the correct direction when moving, instantiated prefabs do not.
I'm making a tower defense game, and at the moment I have 1 of my enemies in the scene for testing purposes. This enemy uses the following code to face the direction of the next waypoint:
transform.up = target.position - transform.position;
This correctly changes the direction this enemy is facing. However, when I instantiate the same prefab at a spawner, they face the correct way when its up or down, but if they face the opposite direction when they are supposed to face left or right. I have tried flipping the sprite for a quick fix but that hasnt work.
What have I missed?
Comment