How come my actor isn't making collision contact with other the actor?
Dell7730
Member, PRO Posts: 388
So, I'm making this shooting game where Actor 1 starts from 0 size and grows to 250 pixels simulating the illusion that it's coming closer to me.
Now, my Actor 2 is the bullet, when it collides with Actor 1, it's supposed to destroy Actor 1. I can only destroy Actor 1 when bullet precisely hits the very center which is the X and Y of it, nothing happens when I hit the out layer of the Actor.
Best Answer
-
tatiang Posts: 11,949
I opened it on a Mac. Didn't change anything.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
You must be using Interpolate Behaviors to grow your actor? The Collision Behavior does not work correctly during an Interpolate because Interpolate works 'outside' of the physics engine.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
You're totally right, i'm using Interpolate behavior, if that doesn't work, any suggestion then?
I got it, just scaled the image to a factor of any number inside a timer
Use a Timer. So if, for example, you were interpolating self.size.width from 50 to 100 over 2 seconds (25 pixels per second), you could do Timer Every 0.1 seconds change attribute self.size.width to self.size.width+2.5 (25 pixels per second).
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I'll try this also to see which one is smoother, the one I found working or this, thanks
Well, I think you'll find that Interpolate is smoother at that speed, though I'm not positive. And I should have mentioned that Timer behaviors can run as quickly as every 0.03 seconds.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I just found out that I can only target the area of the original size of the actor, meaning that if the Target actor spawned at 100 pixels, collision only happens within that original size, outside 100 pixels isn't colliding with the bullet actor
You'll have to post a link to download your project file because I can't re-create this issue. It works fine for me.
Also, please create any new threads in Working with GS (PC). This subforum is for sharing tutorials that you've created. I'll move this thread for you.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks and here's the zip file, hope you can figure out what's wrong with it.
https://drive.google.com/file/d/0Bw6pFarwlI0eanhWTC1MeTZTSnM/view?usp=sharing
This is how it works for me:
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
did you change anything? what did you do? that's exactly what I want.
I wonder if it works fine when played on my phone, let me try to see if it's just the preview that won't work on
It works great on my Android phone, all these time I thought it wasn't working cause it shows on the preview that it wasn't working