Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Bool = true when Input can't back to false anywhere on scrip(Solved)

Discussion in 'Scripting' started by tijanikun, Nov 4, 2018.

  1. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    Hello, i really need you help for my scrip, i want to change the move speed of my player to 0 while he is attacking. When i set a bool ( with moveSpeed = 0) to true (with if "input.ect..." "bool" = true) in the scrip i can't make it back to false, i tried to put bool = false to some spot (same if and with a coroutine).
    Thank you so much for future answer, i'll be back on morning.

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine.Events;
    using UnityEngine;
    public class PlayerController : MonoBehaviour
    {
    public float moveSpeed;
    //public Rigidbody theRD;
    public float jumpForce;
    public CharacterController controller;
    public float gravityScale;
    public Animator anim;
    public Transform pivot;
    public float rotateSpeed;
    public float runSpeed;
    float t = 0;
    private bool Froze;
    public int myNumber = 0;
    public float knockBackForce;
    public float knockBackTime;
    private float knockBackCounter;
    private Vector3 moveDirection;
    public GameObject playerModel;
    // Use this for initialization
    void Start()
    {
    //theRD = GetComponent<Rigidbody>();
    controller = GetComponent<CharacterController>();
    }
    // Update is called once per frame
    void Update()
    {
    // theRD.velocity = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, theRD.velocity.y, Input.GetAxis("Vertical") * moveSpeed);
    /*if (Input.GetButtonDown("Jump"))
    {
    theRD.velocity = new Vector3(theRD.velocity.x, jumpForce, theRD.velocity.z); */
    //moveDirection = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, moveDirection.y, Input.GetAxis("Vertical") * moveSpeed);
    if (Input.GetKeyDown(KeyCode.B))
    {
    moveSpeed = runSpeed;
    }
    if (Input.GetKeyUp(KeyCode.B))
    {
    moveSpeed = 10;
    }
    if (Input.GetButton("PressV"))
    {
    StartCoroutine("Wait(test)");

    }
    if (Froze == true)
    {
    moveSpeed = 0;
    print("good");
    }
    if (knockBackCounter <= 0)
    {
    float yStore = moveDirection.y;
    moveDirection = (transform.forward * Input.GetAxis("Vertical")) + (transform.right * Input.GetAxis("Horizontal"));
    moveDirection = moveDirection.normalized * moveSpeed;
    moveDirection.y = yStore;
    if (controller.isGrounded)
    {
    moveDirection.y = 0f;
    if (Input.GetButtonDown("Jump"))
    {
    moveDirection.y = jumpForce;
    }
    }
    }
    else
    {
    knockBackCounter -= Time.deltaTime;
    }
    moveDirection.y = moveDirection.y + (Physics.gravity.y * gravityScale * Time.deltaTime);
    controller.Move(moveDirection * Time.deltaTime);
    //Move the player in different direction based on camera look direction
    if (Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0)
    {
    transform.rotation = Quaternion.Euler(0f, pivot.rotation.eulerAngles.y, 0f);
    Quaternion newRotation = Quaternion.LookRotation(new Vector3(moveDirection.x, 0f, moveDirection.z));
    playerModel.transform.rotation = Quaternion.Slerp(playerModel.transform.rotation, newRotation, rotateSpeed * Time.deltaTime);
    }
    anim.SetBool("isGrounded", controller.isGrounded);
    anim.SetFloat("Speed", (Mathf.Abs(Input.GetAxis("Vertical")) + Mathf.Abs(Input.GetAxis("Horizontal"))));
    }

    IEnumerator Wait(float test)
    {
    yield return new WaitForSeconds(5);
    Froze = false;

    }
    public void Knockback(Vector3 direction)
    {
    knockBackCounter = knockBackTime;
    moveDirection = direction * knockBackForce;
    moveDirection.y = knockBackForce;
    }

    }
     

    Attached Files:

  2. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    I'm sorry but i can't read this properly, use the code tags(there a page with '<>' on it next to the words that say 'Code:' on the comment toolbar thingy.
     
  3. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine.Events;
    4. using UnityEngine;
    5.  
    6. public class PlayerController : MonoBehaviour
    7. {
    8.  
    9.     public float moveSpeed;
    10.     //public Rigidbody theRD;
    11.     public float jumpForce;
    12.     public CharacterController controller;
    13.     public float gravityScale;
    14.     public Animator anim;
    15.     public Transform pivot;
    16.     public float rotateSpeed;
    17.     public float runSpeed;
    18.  
    19.     float t = 0;
    20.  
    21.     private bool Froze;
    22.  
    23.     public int myNumber = 0;
    24.  
    25.     public float knockBackForce;
    26.     public float knockBackTime;
    27.     private float knockBackCounter;
    28.  
    29.     private Vector3 moveDirection;
    30.     public GameObject playerModel;
    31.     // Use this for initialization
    32.     void Start()
    33.     {
    34.         //theRD = GetComponent<Rigidbody>();
    35.         controller = GetComponent<CharacterController>();
    36.     }
    37.  
    38.  
    39.     // Update is called once per frame
    40.     void Update()
    41.     {
    42.  
    43.         // theRD.velocity = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, theRD.velocity.y, Input.GetAxis("Vertical") * moveSpeed);
    44.  
    45.         /*if (Input.GetButtonDown("Jump"))
    46.            {
    47.                         theRD.velocity = new Vector3(theRD.velocity.x, jumpForce, theRD.velocity.z); */
    48.         //moveDirection = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, moveDirection.y, Input.GetAxis("Vertical") * moveSpeed);
    49.  
    50.         if (Input.GetKeyDown(KeyCode.B))
    51.         {
    52.             moveSpeed = runSpeed;
    53.         }
    54.         if (Input.GetKeyUp(KeyCode.B))
    55.         {
    56.             moveSpeed = 10;
    57.         }
    58.  
    59.         if (Input.GetButton("PressV"))
    60.         {
    61.             StartCoroutine("Wait(test)");
    62.  
    63.            
    64.         }
    65.         if (Froze == true)
    66.         {
    67.             moveSpeed = 0;
    68.             print("good");
    69.         }
    70.  
    71.  
    72.         if (knockBackCounter <= 0)
    73.         {
    74.             float yStore = moveDirection.y;
    75.             moveDirection = (transform.forward * Input.GetAxis("Vertical")) + (transform.right * Input.GetAxis("Horizontal"));
    76.             moveDirection = moveDirection.normalized * moveSpeed;
    77.             moveDirection.y = yStore;
    78.  
    79.             if (controller.isGrounded)
    80.             {
    81.                 moveDirection.y = 0f;
    82.                 if (Input.GetButtonDown("Jump"))
    83.                 {
    84.                     moveDirection.y = jumpForce;
    85.                 }
    86.             }
    87.         }
    88.         else
    89.         {
    90.             knockBackCounter -= Time.deltaTime;
    91.         }
    92.  
    93.         moveDirection.y = moveDirection.y + (Physics.gravity.y * gravityScale * Time.deltaTime);
    94.         controller.Move(moveDirection * Time.deltaTime);
    95.  
    96.  
    97.         //Move the player in different direction based on camera look direction
    98.         if (Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0)
    99.         {
    100.             transform.rotation = Quaternion.Euler(0f, pivot.rotation.eulerAngles.y, 0f);
    101.             Quaternion newRotation = Quaternion.LookRotation(new Vector3(moveDirection.x, 0f, moveDirection.z));
    102.             playerModel.transform.rotation = Quaternion.Slerp(playerModel.transform.rotation, newRotation, rotateSpeed * Time.deltaTime);
    103.         }
    104.  
    105.         anim.SetBool("isGrounded", controller.isGrounded);
    106.         anim.SetFloat("Speed", (Mathf.Abs(Input.GetAxis("Vertical")) + Mathf.Abs(Input.GetAxis("Horizontal"))));
    107.  
    108.  
    109.     }
    110.  
    111.  
    112.  
    113.  
    114.     IEnumerator Wait(float test)
    115.     {
    116.         yield return new WaitForSeconds(5);
    117.         Froze = false;
    118.        
    119.     }
    120.  
    121.     public void Knockback(Vector3 direction)
    122.     {
    123.         knockBackCounter = knockBackTime;
    124.  
    125.         moveDirection = direction * knockBackForce;
    126.         moveDirection.y = knockBackForce;
    127.     }
    128.    
    129.     }
    130.  
     
  4. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,335
    Does that actually work? I think the overload of StartCoroutine that takes a string parameter, simply accepts the method name, but "Wait(test)" is an expression. I'd guess StartCoroutine is not smart enough to parse that out.

    Anyway, the documentation has several examples of what you are trying to do
    https://docs.unity3d.com/ScriptReference/MonoBehaviour.StartCoroutine.html
     
    SparrowGS likes this.
  5. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    Thanks for reply,

    I folowed the link and i can tell the coroutine is weird because i put a print on it and it write it every x second on console,
    with the new code we can tell the Froze = true; is always true too ( same coroutine)

    What should i do to stop the Froze = true (to stop character movement when i press V) after 2 second ?
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine.Events;
    4. using UnityEngine;
    5.  
    6. public class PlayerController : MonoBehaviour
    7. {
    8.  
    9.     public float moveSpeed;
    10.     //public Rigidbody theRD;
    11.     public float jumpForce;
    12.     public CharacterController controller;
    13.     public float gravityScale;
    14.     public Animator anim;
    15.     public Transform pivot;
    16.     public float rotateSpeed;
    17.     public float runSpeed;
    18.  
    19.     private IEnumerator coroutine;
    20.  
    21.     public ActionManager actionManager;
    22.  
    23.     float t = 0;
    24.  
    25.     private bool Froze;
    26.  
    27.     public int myNumber = 0;
    28.  
    29.     public float knockBackForce;
    30.     public float knockBackTime;
    31.     private float knockBackCounter;
    32.  
    33.     private Vector3 moveDirection;
    34.     public GameObject playerModel;
    35.     // Use this for initialization
    36.     void Start()
    37.     {
    38.         //theRD = GetComponent<Rigidbody>();
    39.         controller = GetComponent<CharacterController>();
    40.         actionManager = GetComponent<ActionManager>();
    41.         actionManager.Init();
    42.         coroutine = FrozeIt(2.0f);
    43.     }
    44.  
    45.  
    46.     // Update is called once per frame
    47.     void Update()
    48.     {
    49.  
    50.         // theRD.velocity = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, theRD.velocity.y, Input.GetAxis("Vertical") * moveSpeed);
    51.  
    52.         /*if (Input.GetButtonDown("Jump"))
    53.            {
    54.                         theRD.velocity = new Vector3(theRD.velocity.x, jumpForce, theRD.velocity.z); */
    55.         //moveDirection = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, moveDirection.y, Input.GetAxis("Vertical") * moveSpeed);
    56.  
    57.         if (Input.GetKeyDown(KeyCode.B))
    58.         {
    59.             moveSpeed = runSpeed;
    60.         }
    61.         if (Input.GetKeyUp(KeyCode.B))
    62.         {
    63.             moveSpeed = 10;
    64.         }
    65.  
    66.         if (Input.GetButton("PressV"))
    67.         {
    68.             StartCoroutine(coroutine);
    69.            anim.Play("Take 001");
    70.            
    71.         }
    72.        
    73.         if (Froze == true)
    74.         {
    75.             moveSpeed = 0;
    76.  
    77.         }
    78.  
    79.  
    80.         if (knockBackCounter <= 0)
    81.         {
    82.             float yStore = moveDirection.y;
    83.             moveDirection = (transform.forward * Input.GetAxis("Vertical")) + (transform.right * Input.GetAxis("Horizontal"));
    84.             moveDirection = moveDirection.normalized * moveSpeed;
    85.             moveDirection.y = yStore;
    86.  
    87.             if (controller.isGrounded)
    88.             {
    89.                 moveDirection.y = 0f;
    90.                 if (Input.GetButtonDown("Jump"))
    91.                 {
    92.                     moveDirection.y = jumpForce;
    93.                 }
    94.             }
    95.         }
    96.         else
    97.         {
    98.             knockBackCounter -= Time.deltaTime;
    99.         }
    100.  
    101.         moveDirection.y = moveDirection.y + (Physics.gravity.y * gravityScale * Time.deltaTime);
    102.         controller.Move(moveDirection * Time.deltaTime);
    103.  
    104.  
    105.         //Move the player in different direction based on camera look direction
    106.         if (Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0)
    107.         {
    108.             transform.rotation = Quaternion.Euler(0f, pivot.rotation.eulerAngles.y, 0f);
    109.             Quaternion newRotation = Quaternion.LookRotation(new Vector3(moveDirection.x, 0f, moveDirection.z));
    110.             playerModel.transform.rotation = Quaternion.Slerp(playerModel.transform.rotation, newRotation, rotateSpeed * Time.deltaTime);
    111.         }
    112.  
    113.         anim.SetBool("isGrounded", controller.isGrounded);
    114.         anim.SetFloat("Speed", (Mathf.Abs(Input.GetAxis("Vertical")) + Mathf.Abs(Input.GetAxis("Horizontal"))));
    115.  
    116.  
    117.     }
    118.     private IEnumerator FrozeIt(float waitTime)
    119.     {
    120.         while (true)
    121.         {
    122.             Froze = true;
    123.             yield return new WaitForSeconds(waitTime);
    124.            
    125.             print("true");
    126.         }
    127.     }
    128.      
    129.     public void Knockback(Vector3 direction)
    130.     {
    131.         knockBackCounter = knockBackTime;
    132.  
    133.         moveDirection = direction * knockBackForce;
    134.         moveDirection.y = knockBackForce;
    135.     }
    136.    
    137.     }
     
  6. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,335
    It will print every 2 seconds over and over because you have a while loop. I assume you just want the code in the coroutine to run once, so remove the while loop.

    So if I understand this properly, you want Froze to be set to true as soon as you attack, and then set to false two seconds later? You almost have it, you just have to add the Froze=false; assignment to the coroutine after the yield.

    I think what you probably want the coroutine to look like is:

    Code (CSharp):
    1.    private IEnumerator FrozeIt(float waitTime)
    2.     {
    3.             Froze = true;
    4.             yield return new WaitForSeconds(waitTime);
    5.             Froze = false;
    6.     }
    Edit: One other thing you probably have to fix: if you press attack, but you press attack again before the 2 seconds are up, then you will have two of the same coroutine running, the first coroutine will still set Froze=true two seconds after the first attack, even if you're in the middle of the second attack. You'll want to change it so that when you press the attack button, it will cancel the already-running coroutine. Either that, or chamge it so that you can't attack again until Froze=false (i.e. the when the previous attack is finished).
     
    Last edited: Nov 5, 2018
    Kiwasi likes this.
  7. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    I say get rid of the coro all together, make 2 floats like this

    Code (CSharp):
    1. float lastAttack;
    2. float interval = 5;
    when you attack do a timestamp on the lastAttack
    Code (CSharp):
    1. lastAttack = Time.time;
    and when jumping check to see if enough time passed like so
    Code (CSharp):
    1. if(lastAttack + interval < Time.time)
    there are ways to get this to preform better, but it gets the point across.
     
  8. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,335
    Yep, that works too.
     
  9. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    Im sorry it's still not working, i guess i missunderstood things:

    kdgalla: i replaced my IEnumerator by yours and i still get stuck on moveSpeed = 0 on inspector

    SparrowsNest: I don't know what is timestamp, i tried to write those 3 line but the movespeed doesn't change, can u explain again please ?

    I started C#scrip 4 days ago im still noob sorry
     
  10. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,335
    Maybe I missed it, but there is no code in your current listing that would change the moveSpeed after froze is set to false. So you'll have to add that. One simple way to do this would be to change:


    if (Input.GetKeyDown(KeyCode.B))
    {
    moveSpeed = runSpeed;
    }
    if (Input.GetKeyUp(KeyCode.B))
    {
    moveSpeed = 10;
    }


    into
    Code (csharp):
    1.  
    2. if (!Froze)
    3. {
    4.     if (Input.GetKey(KeyCode.B))
    5.         {          
    6.              moveSpeed = runSpeed;
    7.         }
    8.     else
    9.        {
    10.             moveSpeed = 10;
    11.        }
    12. }
    13.  
    14.  
    Notice the difference between GetKeyDown and GetKey. GetKey will be true every frame that the player is holding down that key, so when the character is no longer frozen and the player is holding down that key, then it will set the move speed to the running speed. The the "else" clause handles the case If the character is not frozen and the player is not holding the key- then it sets the speed to 10, which I suppose is the normal walking speed.
     
  11. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    What's wrong here ?
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine.Events;
    4. using UnityEngine;
    5.  
    6. public class PlayerController : MonoBehaviour
    7. {
    8.  
    9.     public float moveSpeed;
    10.     //public Rigidbody theRD;
    11.     public float jumpForce;
    12.     public CharacterController controller;
    13.     public float gravityScale;
    14.     public Animator anim;
    15.     public Transform pivot;
    16.     public float rotateSpeed;
    17.     public float runSpeed;
    18.  
    19.     float timestamp;
    20.  
    21.     float lastAttack;
    22.     float interval = 5;
    23.  
    24.     private IEnumerator coroutine;
    25.  
    26.     public ActionManager actionManager;
    27.  
    28.     float t = 0;
    29.  
    30.     private bool Froze;
    31.  
    32.     public int myNumber = 0;
    33.  
    34.     public float knockBackForce;
    35.     public float knockBackTime;
    36.     private float knockBackCounter;
    37.  
    38.     private Vector3 moveDirection;
    39.     public GameObject playerModel;
    40.     // Use this for initialization
    41.     void Start()
    42.     {
    43.         //theRD = GetComponent<Rigidbody>();
    44.         controller = GetComponent<CharacterController>();
    45.         actionManager = GetComponent<ActionManager>();
    46.         actionManager.Init();
    47.         coroutine = FrozeIt(5.0f);
    48.        
    49.     }
    50.  
    51.  
    52.     // Update is called once per frame
    53.     void Update()
    54.     {
    55.  
    56.         // theRD.velocity = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, theRD.velocity.y, Input.GetAxis("Vertical") * moveSpeed);
    57.  
    58.         /*if (Input.GetButtonDown("Jump"))
    59.            {
    60.                         theRD.velocity = new Vector3(theRD.velocity.x, jumpForce, theRD.velocity.z); */
    61.         //moveDirection = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, moveDirection.y, Input.GetAxis("Vertical") * moveSpeed);
    62.  
    63.         if (!Froze)
    64.         {
    65.             if (Input.GetKey(KeyCode.B))
    66.             {
    67.                 moveSpeed = runSpeed;
    68.             }
    69.             else
    70.             {
    71.                 moveSpeed = 10;
    72.             }
    73.         }
    74.  
    75.         if (Input.GetButton("PressV"))
    76.         {
    77.            anim.Play("Take 001");
    78.             StartCoroutine(coroutine);
    79.         }
    80.        
    81.         if (Froze == true)
    82.         {
    83.             moveSpeed = 0;
    84.  
    85.         }
    86.  
    87.  
    88.         if (knockBackCounter <= 0)
    89.         {
    90.             float yStore = moveDirection.y;
    91.             moveDirection = (transform.forward * Input.GetAxis("Vertical")) + (transform.right * Input.GetAxis("Horizontal"));
    92.             moveDirection = moveDirection.normalized * moveSpeed;
    93.             moveDirection.y = yStore;
    94.  
    95.             if (controller.isGrounded)
    96.             {
    97.                 moveDirection.y = 0f;
    98.                 if(lastAttack + interval < Time.time)
    99.                 if (Input.GetButtonDown("Jump"))
    100.                 {
    101.                     moveDirection.y = jumpForce;
    102.                 }
    103.             }
    104.         }
    105.         else
    106.         {
    107.             knockBackCounter -= Time.deltaTime;
    108.         }
    109.  
    110.         moveDirection.y = moveDirection.y + (Physics.gravity.y * gravityScale * Time.deltaTime);
    111.         controller.Move(moveDirection * Time.deltaTime);
    112.  
    113.  
    114.         //Move the player in different direction based on camera look direction
    115.         if (Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0)
    116.         {
    117.             transform.rotation = Quaternion.Euler(0f, pivot.rotation.eulerAngles.y, 0f);
    118.             Quaternion newRotation = Quaternion.LookRotation(new Vector3(moveDirection.x, 0f, moveDirection.z));
    119.             playerModel.transform.rotation = Quaternion.Slerp(playerModel.transform.rotation, newRotation, rotateSpeed * Time.deltaTime);
    120.         }
    121.  
    122.         anim.SetBool("isGrounded", controller.isGrounded);
    123.         anim.SetFloat("Speed", (Mathf.Abs(Input.GetAxis("Vertical")) + Mathf.Abs(Input.GetAxis("Horizontal"))));
    124.  
    125.  
    126.     }
    127.  
    128.     private IEnumerator FrozeIt(float waitTime)
    129.     {
    130.         Froze = true;
    131.         yield return new WaitForSeconds(waitTime);
    132.         Froze = false;
    133.     }
    134.  
    135.     public void Knockback(Vector3 direction)
    136.     {
    137.         knockBackCounter = knockBackTime;
    138.  
    139.         moveDirection = direction * knockBackForce;
    140.         moveDirection.y = knockBackForce;
    141.     }
    142.    
    143.     }
    144.  
    My character doen't stop, looks like there is no time between true and false
     
  12. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,335
    I don't see the problem. Try putting a different debug.Log when you set Froze to true and also where set it to false.
     
  13. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    They happen on same time, weird.
     
  14. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,335
    Does it still happen if you replace
    yield return new WaitForSeconds(waitTime);

    with
    yield return new WaitForSeconds(5f);

    ?
     
  15. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    They still happen on same time ...
     
  16. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,335
    Still just guessing here, but try changing
    StartCoroutine(coroutine);

    to
    StartCoroutine(FrozeIt(5.0f));
     
  17. tijanikun

    tijanikun

    Joined:
    Aug 10, 2017
    Posts:
    129
    It's working now!
    Thank you so much!