Object creation problems

This forum is currently in read-only mode.
  • Hey, I have a problem. I dont know how to change objects which I place. For example on left click I am placing "wooden crate" then I press "shift" and on left click I am starting to place "steel crate". Any suggestions? Thanks for attention.

  • a little vague on the details, but if I'm understanding you

    it should work like this

    Mouse/Keyboard - On Left Click

    -----Mouse/Keyboard - Shift Key is Down

    ---------------System Create Object "wooden crate" at mousex,mousey

    -----System - Else

    ---------------System Create Object "steel crate" at mousex,mousey

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Close. But... I mean when you press shift it changes the object which you will place.

  • But that's exactly what lucid's example does

    Or do you mean, you have a list of e.g. 20 different objects, and you want to loop through them? Then just create an array "names" that you fill with the names of your objects, and a global variable "selector"

    then do:

    + On key Shift pressed

    -> Add 1 to global 'selector'

    ++ Is global 'selector' greater than 20

    -->set global 'selector' to 1

    + On left click

    -> create object names(global('selector')) at mousex, mousey

    (this is the action "Create object by name")

  • Yes! what I needed thank you very much!

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