Prevent sprite from overlapping with solid objects

Just started using Construct 2? Post your questions here

Post » Sat May 20, 2017 5:36 am

I have an issue with a game I am working on. The sprite is overlapping with solid objects when it shouldn't (Well I think it shouldn't). See the image below with the red circle:

Image

The sprite collision polygon looks like this:

Image

And the solid object's (tent) collision polygon looks like this:

Image

So shouldn't it overlap like the one seen in the first pic? How do I prevent this? How do I make it more accurate?

Thanks!

EDIT

I am using
Code: Select all
mouse click + pathfinding
for navigation. Maybe pathfinding is causing it?
Last edited by iwannalearn on Sat May 20, 2017 7:34 am, edited 1 time in total.
B
7
S
2
G
1
Posts: 7
Reputation: 989

Post » Sat May 20, 2017 7:04 am

check if the collision polygon is the same for each frame of your player
B
25
S
16
G
26
Posts: 125
Reputation: 16,103

Post » Sat May 20, 2017 7:33 am

celstrider wrote:check if the collision polygon is the same for each frame of your player


Hi @celstrider I already checked that, the collision polygon is the same for all frames. . . Any other ideas what might be causing this issue?

BTW, I am using
Code: Select all
mouse click + pathfinding
for navigation. Maybe it has something to do with that?
B
7
S
2
G
1
Posts: 7
Reputation: 989

Post » Sat May 20, 2017 2:21 pm

Try giving your boy the BULLET behavior, set 'bounces off solids' to yes and set speed to 0.
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,244

Post » Sat May 20, 2017 7:35 pm

ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Sun May 21, 2017 3:49 pm

MPPlantOfficial wrote:Try giving your boy the BULLET behavior, set 'bounces off solids' to yes and set speed to 0.


I tried your suggestion, but it doesn't seem to have any effects.
B
7
S
2
G
1
Posts: 7
Reputation: 989

Post » Sun May 21, 2017 3:53 pm

Message: iwannalearn can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
alextro wrote:Use family solution :D >> how-do-i-stop-instances-of-the-same-sprite-from-overlapping_t184211


Hey alextro, I downloaded your sample file and it looks good! The sprites are no longer overlapping. But right now I'm using the free version, and the free version doesn't support families (lol) so I can't test it on my project.

Was hoping to make a prototype with the free version before investing some money on the software. Maybe you have other suggestions that can be implemented with the free version?

Thanks
B
7
S
2
G
1
Posts: 7
Reputation: 989

Post » Sun May 21, 2017 9:12 pm

If overlapping objects are different sprites, you don't have to use family at all. For example first object is a wall and second object is moving matter.
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Mon May 22, 2017 4:03 am

Hey @alextro, thanks for the suggestions, was able to get a version of your sample without using family, but, it caused some bad effects. So I decided to use a different approach to achieve my goal, used tilemaps instead of sprites, right now its performing better.

Thanks for the help guys!
B
7
S
2
G
1
Posts: 7
Reputation: 989

Post » Mon May 22, 2017 7:16 am

Hmm unwanted effect... If your workaround make things better then congrats! To be honest I rare using tilemaps but that just me.
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 5 guests