Change Obstacle Colors [solved]

Discussion in 'How Can I...?' started by JSeeger6, May 18, 2020.

  1. JSeeger6

    JSeeger6 Avid Boxer

    Joined:
    Aug 29, 2018
    Messages:
    100
    Likes Received:
    12
    I'm looking to use the "Set Random Color" node to change the color of obstacles. The error is that the node is changing the color for EACH the objects in the scene rather than settings them all to the SAME randomized color.

    See screenshot link below for example of what happens when this node is on the obstacle - it changes the color for each one. Instead, I want it to change to the SAME randomized color for ALL. How can I do this?

    See photo here: https://drive.google.com/file/d/1ZE1HW_N5Ah_EDm38SqKqDozA0o_5bPZ_/view?usp=sharing
    [​IMG]

    BBDoc link here: https://drive.google.com/open?id=1Nr47e_EzbWoMd216cOIql9ys9beM3HQo
     
    Last edited: May 18, 2020
  2. mohamed awad

    mohamed awad Avid Boxer

    Joined:
    Mar 10, 2019
    Messages:
    315
    Likes Received:
    158
    save data as settings inside one object appears one time every world like character
    add script node inside character or object appears one time
    inside Start function{}

    function start(){
    Settings.a = Math.random() * 255;
    Settings.b = Math.random() * 255;
    Settings.c = Math.random() * 255;
    }

    and inside obstacle add this inside script node or change color node as signal or on start whatever you want

    this.entity().setColor(Settings.a, Settings.b, Settings.c);
     
    aminee and JSeeger6 like this.
  3. JSeeger6

    JSeeger6 Avid Boxer

    Joined:
    Aug 29, 2018
    Messages:
    100
    Likes Received:
    12
    THANK YOU! Great idea!!!
     
    mohamed awad likes this.

Share This Page