- Home /
Changing material orientation dependant on mouse location?
alt text][1]
I was wondering if it would be possible to edit the Mouse Look script (http://www.starscenesoftware.com/stuff/unity/MouseLook.txt)to change the orientation of a material. I'm making a small 2D game in which the character will be attacking flying enemies.
For instance, if the mouse if above the location of the girl her head would be looking up and if she was looking right, she'll face right. Would it be better to have the face on a seperate plane or just have multiple images that will change dependant on the mouse location.
I was thinking I could use an edited similar code to this:
`function Start () {
var tex : Texture = renderer.material.GetTexture ("_BumpMap");
if (tex)
print ("My bumpmap is " + tex.name);
else
print ("I have no bumpmap!");}`
I'm not at all sure on where to start as I couldn't find a script that would work in a 2D enviroment.
[1]: /storage/temp/8889-\gamescreenshot1.jpg
Your answer
Follow this Question
Related Questions
Mouse Click to keyCode 1 Answer
Sidescroller Bullets Follow Mouse After Being Shot 2 Answers
2d camera help! 0 Answers
2D Plane Component "Gravity" 0 Answers
OnTriggerEnter2d not working 3 Answers