Hi i have car interior with many switches and buttons.I need that they were working on a mouse click.I Know how to animate button but don’t know how to assign specific parameters to specific button on mouse click.I don’t want to assign one script to each button I guess that this is resource consuming.
One of the solution with a single script is:
you can raycast on mousedown from a single script and check which button you touched. Check Physics.Raycast method for more info.