Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class characterSelection : MonoBehaviour {
- public bool isEnabled = false;
- void Update () {
- if (Input.GetKeyDown(KeyCode.F1) && isEnabled == true) {
- GetComponent<characterController>().enabled = false;
- }
- if (Input.GetKeyDown(KeyCode.F1) && isEnabled == false) {
- GetComponent<characterController>().enabled = true;
- }
- if (GetComponent<characterController>().enabled == true){
- isEnabled = true;
- }
- if (GetComponent<characterController>().enabled == false){
- isEnabled = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement