How do I pick an instance and it's instance variable value

0 favourites
  • 3 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • ...and then use it's value in a comparison.

    I can't provide a file now, but bear with me and you might get what I want to achieve. I want to retrieve the value of the instance variable on obj_Floor

    - obj_Player has Line of Sight of obj_Floor > Pick obj_Floor.Orientation value

    - If obj_Floor.Orientation (of that specific instance) is "X", then do

    blablabla.

    But I want "Orientation" value of THAT specific instance of obj_Floor that is in Line of Sight of obj_Player at that moment.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Those are the events you need, player has line of sight of floor, it picks the instance of floor that is true. Then as a sub event you can say if floor.var = X then do actions, it uses the floor that was picked earlier and therefore its instance variable.

  • Those are the events you need, player has line of sight of floor, it picks the instance of floor that is true. Then as a sub event you can say if floor.var = X then do actions, it uses the floor that was picked earlier and therefore its instance variable.

    Hi, Plinkie! Thanks for your reply and sorry for my late reply. It was Carnaval in Brazil...I confess I went partying hehe.

    I've tried what you said, but it didn't work D:

    There is something weird going on. As soon as I preview the Layout, some events do not trigger even though I know the conditions are being matched.

    I'm using "Object Has Line of Sight of another Object", but...for some reason it doesn't work. Would you take a look?

    Plus I changed some stuff...instead of depending on instance variable values, I created a new object for Vertical Floors (obj_FloorVert) and the old obj_Floor now refers to Horizontal Floors, now called obj_FloorHoriz

    Here is link of the file:

    drive.google.com/file/d/1h5dOkxy9Zl3sSgn95PnwoeiZ1vB14uhC/view

    Here is where I'm struggling with:

    prntscr.com/r8lamr

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