Hi i created this scene, now i need script, i dont know very well scripting, i need sample script so for example when player mouseover on tank it glow up (optional) and show sample text like ““Play Game”” and on click it load level? Thanks in advance…
try to animate a scale for your tank… create an animation in frame 0 with scale 1 to frame 10 scale 3, this will scale up your tank (it will server when you pass your mouse over the tank)
add a box collider to your tank, then attach this script to your tank :
var myTank : GameObject;
function OnMouseEnter(other : Collider){
myTank.animation.Play();
}
function OnMouseExit(other : Collider){
myTank.animation["animationName"].speed = -1; //this inverse the animation
myTank.animation.Play();
}
function OnMouseUp(other : Collider){
Application.LoadLevel("NextLevel");
}
the “NextLevel” string is just the name of the scene you want to load…
Note that :
OnMouseEnter ( is when you pass your mouse over without pressing button)
OnMouseUp (literally when you release the mouse button)
OnMouseDown (when you press and keep pressed the mouse button)
OnMouseExit (when the mouse pointer gets out of the object)…
Sounds like an excellent time to learn some basic scripting! Trust me, you won’t get far until you actually write your own script.
Try it out, and it wont be perfect, put your progress here