How do I turn collisions on

Get help using Construct 2

Post » Thu Jan 29, 2015 9:53 pm

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 =)
B
2
Posts: 5
Reputation: 160

Post » Thu Jan 29, 2015 10:57 pm

Can you post your capx file? It would help if we could look at how you have your events set up.
B
38
S
12
G
11
Posts: 331
Reputation: 7,712

Post » Fri Jan 30, 2015 12:07 am

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.
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Fri Jan 30, 2015 1:14 pm

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

Im sure its something silly i cant find, thx for helping =)
You do not have the required permissions to view the files attached to this post.
B
2
Posts: 5
Reputation: 160

Post » Fri Jan 30, 2015 2:28 pm

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.
B
38
S
12
G
11
Posts: 331
Reputation: 7,712

Post » Fri Jan 30, 2015 3:49 pm

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?
B
2
Posts: 5
Reputation: 160

Post » Fri Jan 30, 2015 4:13 pm

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:
You do not have the required permissions to view the files attached to this post.
B
39
S
8
G
3
Posts: 158
Reputation: 2,995

Post » Fri Jan 30, 2015 4:23 pm

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.
B
2
Posts: 5
Reputation: 160

Post » Fri Jan 30, 2015 4:31 pm

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.
B
39
S
8
G
3
Posts: 158
Reputation: 2,995

Post » Fri Jan 30, 2015 4:46 pm

Thank you! I will try it.
B
2
Posts: 5
Reputation: 160

Next

Return to How do I....?

Who is online

Users browsing this forum: alextro, Ryan Kocourek and 3 guests