Issue with Collision

0 favourites
  • 2 posts
  • Ok, I have multiple objects (Robo) with instance variable (Data = number with value of either 0 or 1). When 2 Robos collide, and if any one of them has a Data value of 1, I want the Robo with the lowest value of Data, ie. 0 to change to 1. I tried the following but they don't seem to work. Is the code wrong or did I miss something?

    Basically, I want the Robo who has data (Data =1) to "transfer data" to the Robo that has no data (Data =0) upon collision such that after collision, both Robo now have Data =1.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • on colision. set a variable "hit" to 1.

    then, pick by evaluate. robot.value+robot.hit=1

    pick nearest to robot: robot.x robot.y

    set value to 1.

    that way it will choose the specific robot that is in collision that has a value of 0

    not sure about turning off the "hit" maybe just every tick, robor is not overlapping robot, set hit to 0.

    the text box is set to specifically one robot. it stays 0 until the specific robot collides. it is its value that is shown.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)