Resetting Rotation Of Object Pool Entities

For those who have seen it, when resetting the object pool entities, the last rotation setting is preserved until the object starts the FollowPath() portion of the code.

So if the path starts facing left/right and the entity is “killed” facing up/down, when it resets, the entity will appear still facing up/down.

A quick fix to reset the rotation would be to add the following line to your ReturnToStart method

transform.rotation = Quaternion.Euler(new Vector3(0, 0, 0));

Simply replace the 0,0,0 with your X/Y/Z values you want the entity to reset to.

Privacy & Terms