Hi people.
I’ve been trying to make a script that allows me to open doors when I click and drag on a door.
Right now, I’m using a raycast, and then I simply rotate the door when I click and drag on it. For some reason, however, there are still several flaws in it.
When I just click it, and do not drag the mouse, some times the door still rotates.
When I click and drag to open a door, it sometimes open “the wrong way” around its y-axis.
Here is a short clip of how it works now:
And here is the script:
Does anyone have a better way to implement such a system? Or maybe just some hints as to how to make it better?
thanks in advance