I use move_states to track character's movement, but it can only track itself, when the character splited into two characters, how to make the clone one ignore the player's input when his parent is moving.
![alt text][1]
[1]: /storage/temp/128318-同时运动bug.png
the movement_input part of the script:
private void Movement_input() {
if (move_states == 0) {
if (Input.GetKey(KeyCode.UpArrow)) {
move_states = 1;
target_position = transform.position + new Vector3(0, 0.8f, 0);
}
else if (Input.GetKey(KeyCode.DownArrow)) {
move_states = 1;
target_position = transform.position + new Vector3(0, -0.8f, 0);
}
else if (Input.GetKey(KeyCode.LeftArrow)) {
move_states = 1;
target_position = transform.position + new Vector3(-1, 0, 0);
}
else if (Input.GetKey(KeyCode.RightArrow)) {
move_states = 1;
target_position = transform.position + new Vector3(1, 0, 0);
}
}
}
THANK TOU FOR HELPING
↧