- Home /
Using onmousedrag to interact with gameobjects
Hello!
I've been looking around the forum and this q&a section for a solution to my problem but i couldn't find anything helpful to my issue.
So basically right now I have a player and a sliding door. Currently the door simply slides when the player presses down a button. Instead I would like to have a small animation (player holding the door handle) and then use the mouse as if it were the players arm to open the door.
How would you recommend i'd go about doing it?
Cheers!
Answer by syclamoth · Sep 19, 2011 at 02:50 PM
Try making the door itself to the animation, and then use an IK controller of some kind to make the hand stick to the handle. There is a decent simple IK controller in the Unity Locomotion System, but it'll take a bit of work to get it to go nicely with your animations. All in all, there's no simple one-click solution, but if you're not afraid of a bit of coding then you can do this using IK solvers in script.
so i'm fairly new to unity in general and even more to the Locomotion System. What exactly would I need to make this work?
I would also like to have this sort of interaction with other objects in the scene that can actually be moved around like bags etc.
Any tips? It seems there isn't much help available online for this extension.
No I'm afraid not! I must admit that what I did with it was somewhat hacky- I used the I$$anonymous$$Simple class on my animations, and then wrote a seprate script for blending it in and out on command. This is not functionality the Locomotion System provides normally- I am simply re-purposing one of its internal mechanisms to do what I want. There are probably better solutions out there, but this is how I solved it (pun not intended)
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Multiple Cars not working 1 Answer