How to use Button signalling to change SpatialMaterial or albedo colour?

Hey everyone! I've begun my quest to learn Godot. So far I've been meddlin about on it and im enjoying this far. I'm still trying to wrap my head around the nodes and how they work together. but as of this moment, I'm having trouble with signalling:

I have a button, which sends a signal, to a script which is assigned to the meshInstance (a cube). It has an extra few buttons that allow me to rotate it, which works fine. But now I want to change the color, or better yet, change the SpatialMaterial?. Any ways, any help would be much appreciated.

Answers

  • Phin236Phin236 Posts: 13Member

    1 save your mat
    2 get the mat res
    onreay var mtr=ResourceLoader.load(“res//...”)
    3
    mtr.set_albedo(Color(1,1,1)

  • Phin236Phin236 Posts: 13Member
    Answer ✓

    )

  • winniethewindwinniethewind Posts: 8Member
    edited February 14

    Thanks a lot. Havent tried this yet but will have a go as soon as possible. Thanks for the hint!

    Update: It worked!

Sign In or Register to comment.