Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to transfer data to change animation parameters through scripts?

Discussion in 'Animation' started by Meowgman, Nov 19, 2023.

  1. Meowgman

    Meowgman

    Joined:
    Nov 19, 2023
    Posts:
    1
    So i'm making a farming RPG and the player character has different preset colors for example he has a green and gold color scheme then a red and blue color scheme each of these has their own animation sprites and i was using a Interger parameter named "color" to change the color of the animation.
    upload_2023-11-19_12-19-17.png
    this is my code to find the other script (For context in the select player screen you can hit a button which changes the players color and the color variable, this variable is then sent to the other script)
    upload_2023-11-19_12-21-5.png
    this is my code to change the paramater it doesn't say it has any errors but i get an error upon starting the selection screen
    upload_2023-11-19_12-21-51.png
    upload_2023-11-19_12-22-15.png
    I'm very new to Unity and this is only my first real project i'm working on so any help would be much appreciated
     
    Last edited: Nov 19, 2023