|
Hi, I've just started using Unity3d and I'm having some problems with setting the scale of an object in a script. I have a gameObject with two scripts, Selectable and Moveable. (I'm making a turn based strategy game) Selectable allows the user to select an object by clicking it which works perfectly. Moveable is supposed to allow the user to move an object, but first I want to draw a plane with a texture from the object to the mouse to show the movement path, I want to scale it's y value to the length of the move (divided by 10 because of its size) and when that works I'll rotate and translate it but I've run into problems when I try to scale it. Setting the scale just after I've created it seems to work perfectly (see the comment in the code, it scales to what ever I set it to) but when I move the mouse around nothing happends (see the second comment at the bottom) even though I set the scale in the same fashion as before and the Log.Debug print out shows me that the scale is changing according to the distance of the mouse from the object. It's probably something simple that I've overlooked but I can't find it for the life of me. Any help will be greatly appreciated!
(comments are locked)
|
|
Just solved it, cant scale y value of billboard laying on ground. :( so simple.
(comments are locked)
|
