How do I fix this detection issue?

Get help using Construct 2

Post » Sat Apr 25, 2015 4:30 pm

I've been getting my fair share out of these forums lately. But I'm glad they are here, really excited about this program and what I can do with it!

Anyway, after fixing an instancing problem I was facing with the help of these forums, I've come across another bug with what I'm trying to do (bring instances of items to a player character when they are within a certain distance of the instanced item).

Below is the capx file, and in it you'll see that the magnetizing concept works fine for the first coin but the detection is acting strangely. It seems to be working for only random coins when it should be working for all of them. The second coin, you can stand right beside it and it won't budge. The furthest one you can stand directly under and it won't move (even if I crank the global variable determining the distance needed for the detection).

EDIT: If I crank the variable high enough, it does work on all coins. But it seems anything below 100 doesn't. Also, if I get close to the coin and jump, THEN it activates and is attracted to the player... am I missing something with the event for detection that requires a vertical update before it gets attracted? I don't understand it. Haha.

Any help with this problem?

https://drive.google.com/file/d/0B_fsFsHtHjNqbFBTOU02OVUzZzQ/view?usp=sharing

EDIT:

This capx file allows you to see better how sometimes it works and sometimes it doesn't. (also xbox gamepad support woot)

https://drive.google.com/file/d/0B_fsFsHtHjNqQmI0aVRZTy1OanM/view?usp=sharing
B
5
Posts: 19
Reputation: 263

Post » Sat Apr 25, 2015 6:22 pm

Instead of using System->compare use system->"pick by comparison". The system->compare condition does no picking so it only ever compares with the first instance.
B
92
S
32
G
107
Posts: 5,275
Reputation: 69,961

Post » Sat Apr 25, 2015 7:12 pm

R0J0hound wrote:Instead of using System->compare use system->"pick by comparison". The system->compare condition does no picking so it only ever compares with the first instance.


Dude, you are a lowkey livesaver. Haha. Made the entire thing work like a charm. Loving these forums and how helpful the community is. It makes creating games that much more fun.

Thanks!
B
5
Posts: 19
Reputation: 263


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, duditon, Google [Bot], R0J0hound, yiuyiu6666 and 8 guests