Changing Character Color In Bb3

Discussion in 'Buildbox 3.0' started by Kanishk Sachdeva, Oct 4, 2018.

  1. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    I have a sphere as a character in BB3 and I want to change character color between two colors.
    For now what I have done is that I have selected another sphere from the asset library and added an if collide node which is connected with set color node for my character . Now the color is being changed perfectly but the collision between my character and other sphere is messing up with my character movement. What I want is that the player should not know that he/she has collided with another object but the character color should change smoothly.
     
  2. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    How do you have the physics setup on your collision object? Static is what you want to use.
     
  3. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    I am using static only as of now, for both start and if collide collision shape of the object I am using for color change, the color is changing perfectly but what the problem is that the when the character collides with the object that I am using for color change the character movement changes and I don't want it to change.
    I want it to be just like when you collect a point you just go through it without realising you have collided with anything.
    Thanks for your help anyways
     
  4. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    what is kinematic object type, can that be used to solve this problem ?
     
  5. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    kinematic is used for a moving collision, so a position cube would need to be set to kinematic because you want the collision to follow it as it moves. Make sense?

    Okay so you want to pass through it. So turn physics off, setup a If Collide in your object then do a remove on the object.

    I use this same technique, but my object is set as static, and I remove upon collision, and my character passes right through it. So not sure why yours is hitting a delay, are you removing object when collided?
     
  6. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    If I turn off physic for the object that I am using to change color of my character, the character is not changing color. I think if physic is off the collision is not detected between character and object. Can you send me a screenshot of a character and object that you are using to change character color. The screenshot of their nodes and how they are connected.
     
  7. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    This is what I understand you want me to do. By doing this the character color is not changing.
    First images are of the objects that I am using to change character color and third image is of the screen you get on double clicking the character.
     

    Attached Files:

  8. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Take a look at this file that I have attached.
    What I did was change the point to physics and changed Remove so the point object gets deleted properly. I added set color to Actor.
    This example also shows you how you can hit a static object and pass right through it, by using the Remove as soon as a collusion happens. You were asking about this in a different thread I think.
     
  9. Codifie

    Codifie Avid Boxer

    Joined:
    Apr 17, 2018
    Messages:
    364
    Likes Received:
    190
    Oops, heres the file. Just rename extension to .bbdoc
     

    Attached Files:

  10. Kanishk Sachdeva

    Kanishk Sachdeva Avid Boxer

    Joined:
    Jul 10, 2018
    Messages:
    217
    Likes Received:
    16
    I did check it out thoroughly , It is sometime working and sometime not. Sometime the color changes to black and sometime it doesn't. Do you know why this is happening.
    Also I tried to replicate it in my project but there it is not changing color.
     

Share This Page