Transform badPosition = bad.GetComponent();
Transform badPosition = bad.GetComponent<Transform>();
Debug.DrawRay(badPosition.position + Vector3(5f,0,0), badPosition.forward * -30, Color.red);
//Can I do this somehow?
Transform badPosition = bad.GetComponent();
Transform badPosition = bad.GetComponent<Transform>();
Debug.DrawRay(badPosition.position + Vector3(5f,0,0), badPosition.forward * -30, Color.red);
//Can I do this somehow?
You can’t do Vector3(5f, 0,0).
you need to instantiate the vector, so just add a new keyword there
Debug.DrawRay(badPosition.position + new Vector3(5f,0f,0f), badPosition.forward * -30f, Color.red);
Yeah, i saw it, but it doesnt get what i want exactly… I’m going to make a drawing with it
You should probably just take the offset off altogether.
Debug.DrawRay(badPosition.position, badPosition.forward * -30f, Color.red);
Transform badPositionChild = bad.GetComponentInChildren<Transform>();
Transform badPosition = bad.GetComponent<Transform>();
Substract = new Vector3(-15f, 0, 0);
Debug.DrawRay(badPosition.position - Substract, badPositionChild.forward * -30, Color.red);
@Kiwasi That do:
Transform badPositionChild = bad.GetComponentInChildren<Transform>();
Transform badPosition = bad.GetComponent<Transform>();
Substract = new Vector3(-15f, 0, 0);
Debug.DrawRay(badPosition.position, badPositionChild.forward * 15f, Color.red);
What is the pivot of that badPosition?
What do you mean with pivot?
The center point of the rectange I think
That makes more sense now.
Try this.
Debug.DrawRay(badPosition.position - badPosition.forward * 5f, badPosition.forward * -30f, Color.red);
solved, thanks