Getting better collisions with different frames
Hello GS community!
I'm making my second game on the engine, and I really want to push me forward on this one.
Thing is player can get 3 different classes, and two of them might hop on a mount, so I got a whole bunch of frames.
With different sizes of images, my collision is getting in the way, because it is much larger in some frames than others, check two of them overlapped:
My question:
Is there a way that GS checks the size of my image, rather than use a pre defined size? I'm thinking that GS takes the biggest frame and sets like the size, every tick, as my actor size. This way my frames will always be inside the hitbox.
On a second thought, I've checked this video:
And it looks great for me, thing is I need to check the magnitude to set collision, so I got a little lost since he uses it for clicking... How do I do that?
Thanks for any help!
Comments
This question about collision shapes for animations came up recently. I believe the suggestion was to swap out a different actor for each frame and set the collision shape on each actor to a custom collision shape based on the image used for that frame.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I think I got what you said, but I'm worried about creating nearly 40 actors to handle each frame, for each of the 5 classes the player can chose.
I'm afraid I may not be the clear in my post, but I'm not looking for a precision cut every frame, I'm just trying to get closer, so this won't happen:
See the space between the character and the second wolf, from the middle wolf... They are running towards the center, and the collision box is huge in this example, feels very unnatural the player to hit the air between the him and the target, and the damage splash come out of it...
You can use magnitude to detect distance in a circle/radius ( or even a oblong shape) instead of collision and store that as a attribute to be used in the "collision" rule. Or a single well defined custom collision shape might achieve what you want as well.
Follow us: Twitter - Website
I think this would be the best, actually... Thing is I'm a little lost on this one. My game already have a global variable for X and Y of the player, so it won't be any pain to use magnitude (Actually, I already use the magnitude for my wolves to "acknowledge" the player, and run towards him when he is near, and do not run towards him when he is far), I just can't figure how to use the magnitude to set up a collision between them.