Change Character In Game

Discussion in 'Buildbox 3.0' started by Stok, Jul 4, 2019.

  1. Stok

    Stok Boxer

    Joined:
    Jun 29, 2019
    Messages:
    13
    Likes Received:
    0
    Hey guys I’m new but I successfully managed to make a game, however I have a big issue. In fact, I would like to be able to change my character’s form in game and I can’t find how to do it. Let me explain a bit more. I used 4 basic assets : Cube, Cylinder, Triangle and Hexagon and I have a player which is a Sphere at the beginning of the game. I’d like to do so that when my Sphere goes through one of the assets it takes its form (e.g. Sphere goes through Cube and becomes a Cube then Cube goes through Hexagon and becomes Hexagon, ...). I thought I could make it with a switch as I saw someone making it in another discussion but unfortunately it doesn’t work as I have 4 forms and not just 2.
    I Hope you can help me, thanks.
     
  2. Stok

    Stok Boxer

    Joined:
    Jun 29, 2019
    Messages:
    13
    Likes Received:
    0
    I thought about doing something like the SetColor() function but with a SetMesh() function but it doesn’t exist. I had in mind something like :
    let mesh = this.attribute(‘Mesh’)
    this.entity().setMesh(‘Cube’) (When collides with Cube) but it’s not working.
    Does someone know how to create it from scratch in a script then ?
     
  3. Swapnil Mali

    Swapnil Mali Boxer

    Joined:
    May 16, 2019
    Messages:
    18
    Likes Received:
    0
    you can add ' if Collide' component in those assets, like in cube asset add 3 if collide component
    if collide -> asset affected -> cylinder
    if collide -> asset affected -> triangle
    if collide -> asset affected -> hexagon

    ... and so on....
     
  4. Swapnil Mali

    Swapnil Mali Boxer

    Joined:
    May 16, 2019
    Messages:
    18
    Likes Received:
    0
    and use global variable using Settings like Settings.variableName = 'name';
    use script component and use above syntax in signal function and attach this script to if collide
     
  5. Stok

    Stok Boxer

    Joined:
    Jun 29, 2019
    Messages:
    13
    Likes Received:
    0
    Ok great.
    I’ll try, thank you.
     

Share This Page