How do I turn collisions on

  • Hello, i am new to this program and just testing some functions and i have been trying to prevent my Player(Sprite) from passing through wall(Sprite(static)).

    Both sprites have Collisions enabled, Solid behavior, are on the same layer and tried other stuff but im always able to go through that wall.

    Pls help =)

  • Can you post your capx file? It would help if we could look at how you have your events set up.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What you are saying is correct so there is probably something you accidently turned off or something. Go to File > Save As Single File. Then share the .capx file here.

  • here it is, sry i couldn't respond yesterday.

    Im sure its something silly i cant find, thx for helping =)

  • In your test, the collisions property of the Sprite object (the one that looks like a wall) is disabled. On the right side of the screen, in the Objects menu, select the Sprite object. On the left side of the screen, the properties menu will show properties of the selected object. Scroll down to the Solid Behavior properties. You will see a property called "Initial State". Set it to enabled and the tank object will not be able to walk through it.

  • Thx for your help, although its working with 8 direction behavior but its not working with my custom movement sprite(yellow cube) how can i make that cube solid too without 8 directions behaviour?

  • I don't understand why you don't simply use the 8-way move behaviour?

    Here, i've made you an example.

    The stone is now also solid and is working as you've wished.

    The good thing about this behaviour is that you have access to several settings such as:

    Acceleration, Deceleration, Max Speed etc...

    So rather than coding this all on your own, you can simply change some settings instead.

    So here, check it out:

  • Well im just starting to understand the program and didnt know i could do what you just did =), thank you for that.

    Btw how would i specify that my cube goes over the wall in front and behind the wall at the back, because now its always behind it even in front of the wall.

  • there's a cool ZSorter Plugin from rexrainbow i think.

    With that plugin, you can create an event that does this automatically for you.

    So one event which then says:

    Sort all Objects in Layer "Main" by Y

    so depending of the Y (layout height) position of the player, his Z position on the layout will switch behind and in front of your stone.

  • Thank you! I will try it.

  • Just keep in mind that object Y position is always taken by it's initial Origin point.

    You can change the position of this point on the "edit animation" window.

    And here's the link for all Plugins created by rexrainbow:

    http://c2rexplugins.weebly.com/my-plugi ... ry-v2.html

    Using this tool you can simply double click on the plugins you want to install, and it will download them for you

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