Quantcast
Channel: Questions in topic: "clone"
Viewing all articles
Browse latest Browse all 508

How to make a clone ignore movement input when his parent is moving? HELP!

$
0
0
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

Viewing all articles
Browse latest Browse all 508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>