.position + Vector3?

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);
1 Like

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);

2640893--185877--upload_2016-5-19_6-5-27.png

What is the pivot of that badPosition?

What do you mean with pivot?
The center point of the rectange I think

2640974--185886--upload_2016-5-19_7-58-49.png

That makes more sense now.

Try this.

Debug.DrawRay(badPosition.position - badPosition.forward * 5f, badPosition.forward * -30f, Color.red);
1 Like

solved, thanks