- Home /
Find side ways from one to another point
Im trying find start and end points of side way from one object to another. like this:
private (Vector 3, Vector3) FindSideWay(Vector 3 object1, Vector 3 object2, bool RightOrLeft)
{
// How can i find it?
}
maybe it's easy and Im stupid :(
Answer by MarekRimal · Nov 05, 2021 at 01:59 PM
I dont quite understand the problem.
What should the side way satisfy?
What is object1? Is it a position of the object?
This is really funny bool :D When do you set it to true? If its right or left? Or both?
2 rectangles on pic are objects. I i want to find side way (start and end point Vector3) from object1 to object2. right or left bool is conditional, because it 2 side ways. if I set true it will return one way, if false another way. Sry, it's hard to explain in a foreign lang. But I am doing my best :}
So if I understand correctly, what you want is either a sideway (startPoint, endPoint) from object1 to object2 if RightOrLeft == true and sideway from object2 to object1 if RightOrLeft== false? But then the startPoint and endPoint are just the object positions or is there something else? How I understand I would just do this:
private (Vector3, Vector3) FindSideWay(Vector 3 object1, Vector 3 object2, bool RightOrLeft)
{
if(RightOrLeft)
{
return (object1, object2);
}
else
{
return (object2, object1);
}
}
Which I dont think is what you want.
The sideway should touch the rectangles from sides? What is the definition of the sideway?
Your answer
Follow this Question
Related Questions
How to rotate back and forth on the X axis? 0 Answers
Why isn't my script to move particles working? 0 Answers
Perlin Noise for 3d Voxel Terrain 1 Answer
Check if clicked position is on left, right, up or down from an gameObject 1 Answer
calculate position and rotation relatively to shpere (Planet) 2 Answers