I'm making an Action RPG. Weird thing happening when my model's Transform is changing (meaning: while it's moving around). When my player gets within a certain radius of this model, a "panel" of sorts slides in from the left side of the screen showing its stats (it's name and health). While the model is stationary, everything looks fine, but when the model is moving, sometimes the different GUITextures that make up the panel don't line up correctly. Why? Because the Game Object that displays these GUITextures is rotated for some reason! Below is my functon:
"ep" is the panel Prefab which has a GUITexture component. It also has two children: an object with just a GUIText (that displays the model's name), and another object with a GUITexture (which displays a gradient bar of variable length called the health bar). Since they're all group as one object, they should all move together, but when my model's movement script is activated, sometimes the different child object end up in different positions. Here are the relevant functions in the script attached to the panel object:
If anyone can help, that would be great.
I've now fixed it by putting this command in the Start() method:
Now, the object will always face the same direction when instantiated!
answered Jul 15, 2010 at 06:31 AM
Add this after the while loop:
You were only setting the position to the value of t before it hit 1
answered Jul 14, 2010 at 09:30 AM