- Home /
Question by
JaredHD · Oct 29, 2017 at 03:08 PM ·
c#rotationdirectioneuler angles
Clamp an object on 2 sides
The Attempt
Hello, So I'm trying to clamp a wall between two sides. So black is the main wall.
What I want
I want the second wall to join the first wall (The black wall), and it must either be between 30 and 120, or it can be between 210 and 290. So where ever the mouse is closest, it will jump there.
The issue I've been banging my head against the wall for.
Currently my issue is based on the walls direction. so if it faces down, left or right the code does not work.
So I'm out of ideas. Any help would be greatly appreciated
I asked a similar question here, but I thought this was more better explained.
wall-v3.png
(8.8 kB)
untitled.jpg
(18.0 kB)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612142107im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Checking vector3 gameObject is about to move to (pathfinding collision detection) 1 Answer
How to make an object go the direction it is facing? 6 Answers
Rotation of object/model without effecting direction C# 2 Answers
How do I find this direction vector? 2 Answers