A line between two objects with conditions
I need a character to do a teleport between two points. One transform.position is the players location, the other is mouse input. However, there are a few conditions, one is that the length of the said teleport is set and if mouse input is further, it can't pass a certain point, the other thing is that if there is an object with a certain Tag, for example an unpassable wall, the teleport should only take him to that length. The last condition is that the target should teleport within one or two frames as he clicks the button. I haven't attached any solution attempt of my own because there are so many that I have I tried, I don't know which one is most efficient. It's a 2D game where this calculation will be used in many mechanics, so I'd like to make it an efficient mechanic if possible. This does not have to be a thing solved by drawing an invisible line, just my type of thinking.
Your answer
Follow this Question
Related Questions
Vector question 0 Answers
Vectors side determing by a line. Please help me out !!!! 0 Answers
Side determing between Line and Vectors 0 Answers
My movement animation doesnt respect my scroll rect 0 Answers
Unity Linerenderer jaggy lines 0 Answers