(Solved)How do I improve the accuracy of Collissions?

Get help using Construct 2

Post » Sun Jul 26, 2015 12:30 pm

I have some quite fast moving objects that spawns another object on colission. Quite often the spawned object ends up within the colission polygon, where as I want it to spawn at the edge or preferably outside. Is there any way to correct this or increase the accuracy of the colission checks.?
Last edited by tunepunk on Sun Jul 26, 2015 2:24 pm, edited 2 times in total.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 991
Reputation: 12,654

Post » Sun Jul 26, 2015 12:32 pm

Would it be possible to have the not so fast moving object spawn?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 26, 2015 12:42 pm

@LittleStain I will try and see if it helps.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 991
Reputation: 12,654

Post » Sun Jul 26, 2015 12:50 pm

@LittleStain nope it didn't help. Same result. Maybe i have to resort to using something like this example, to calculate a more exact position when placing the object. Sinc'e it's crucial that it ends up in the exact position that i want.

https://www.scirra.com/tutorials/902/li ... raycasting
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 991
Reputation: 12,654

Post » Sun Jul 26, 2015 1:29 pm

Maybe you could try moving the spawned object in the opposite angle of the bullet angle of motion untill overlap is done..
something like:

while
spawned object is overlapping blabla
- spawned object move 1 px at angle Blip.bullet.angleofmotion-180
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 26, 2015 1:57 pm

if you use physics you can check the bullet box :D will dramatically change the collision check and wold be more accurate. if you dont use physics then maybe add some extra safety distance? like 1-3 px ?
B
77
S
23
G
69
Posts: 1,353
Reputation: 43,958

Post » Sun Jul 26, 2015 2:26 pm

@LittleStain @gamecorpstudio solved it by using the raycasting example. Now they always end up where I want them :)

the while idea would probably not work in this case, since the spawned object is created at an offset, so not really overlapping anymore. But I'll keep that in mind. That solution might come in handy for some other objects.
Follow my progress on Twitter
or in this thread Archer Devlog
B
40
S
17
G
17
Posts: 991
Reputation: 12,654


Return to How do I....?

Who is online

Users browsing this forum: Armench and 15 guests