- Home /
Question by
jaesumg · Mar 12, 2017 at 02:59 PM ·
object movement
MultySelect RTS style game
public class moveArrow : MonoBehaviour {
public float speed;
// Use this for initialization
void Start () {
speed = 5f;
}
// Update is called once per frame
void Update () {
transform.Translate(speed * Input.GetAxis("Horizontal") * Time.deltaTime, 0f,
speed * Input.GetAxis("Vertical") * Time.deltaTime);
}
}
This code attach to 3d object "cube1" by component "cube2" and "cube3" same code
and I want to move "cube1" and "cube2" only don't move "cube3"
so How I can select only "cube1", "cube2" by use OnMouseDown() method if you ok, I want to see the script about select
mouseDown to "cube1" then "cube1" selected mouseDown to "cube2" then "cube2" selected Now move by arrow key only move "cube1,2" how to script???
Comment