Search Unity

Drag door, based on 2 vectors

Discussion in 'Scripting' started by ICHeeryI, Jan 12, 2014.

  1. ICHeeryI

    ICHeeryI

    Joined:
    Nov 14, 2012
    Posts:
    9
    Hi there, I already posted this on unity answers . Here is the link
    Anyway I will talk about it here. I already tried shadow demo project for drag and drop script. It have few bugs so I tried to create my own drag and drop door script. I already store first vector3 position that hits door, and I also store second vector3 position - mouse drag. But the problem is I don't know how to calculate direction between that 2 vectors or how to add force to door based on that 2 vectors. Here's the image:
    $20525-untitled.jpg

    Thanks!