https://dl.dropboxusercontent.com/u/151460612/bug/bug.swf.html I recorded a little video to show you this bug, as you can see from the video, I have an empty object that works as pivot, and it’s child should be a sprite, or even a sprite with collider, for the video I shown both, and same have same issue, when the object should look at the left side of the screen, it gets flipped(the z axis poinst to the other) and then the collider get’s all messed up, how can I fix this issue? I started this project today and this is kinda pissing me off I only have one script yet
using System.Collections;
public class KatanaScript : MonoBehaviour {
public Transform katanaTarget;
static bool katanaIsActive = false;
public bool isTarget;
public float rotateVelocity;
void Update () {
if (isTarget) {
int number = 0;
if (Input.GetMouseButton(0)) {
number++;
}
if (number >= 1) {
katanaTarget.gameObject.SetActive(true);
Vector2 pos = Input.mousePosition;
pos = Camera.main.ScreenToWorldPoint(new Vector2(pos.x, pos.y));
katanaTarget.position = pos;
katanaIsActive = true;
}
else {
katanaTarget.gameObject.SetActive(false);
katanaIsActive = false;
}
}
else {
if(katanaIsActive) {
transform.LookAt(katanaTarget.position);
transform.Rotate( new Vector3(0, -90, 0));
}
}
}
}
also, when the object is totally point up, it rotates 90º on the y axis, and when it gets over that (starts pointing at the left side) it rotates another more 90º.