Actor collision shape

I. B.I. B. Member, BASIC Posts: 4

Hi. I'm working on my first game and I'm really stuck with this problem: if I select the "rectangle" collision shape, you may see what happens on the first image I attach. The actor seems to float over the platforms, collides before the real pixels touch the platform, etc.... The "circle" shape works much better for this, but then, as the actor is quite tall, I can't keep it above the ground object (image 2).

Please, is there anything I could do to solve this?

Thanks!

Answers

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited August 2015

    You're best bet will probably be to use two different actors, one rectangle actor (indicated by the blue line) and constrain a second (witch actor) to it. Make the blue rectangle invisible and use it to trigger collisions etc and use the witch to just display images.

  • I. B.I. B. Member, BASIC Posts: 4

    Thanks, Jamie! I will try that. Then I will need to think something for the collisions on the witch's body... It's a real shame that —the otherwise excelent— GameSalad does not allow different collision shapes.

  • ChunkypixelsChunkypixels Member Posts: 1,114
    edited August 2015

    As a side note... Im intrigued as too how long the circular collision shape has worked this way. Im sure that when I first started using GameSalad the circular collision stretched/deformed to fit to the edges of the actor, so if you stretched the actor in its width, the circle would become more elliptical.

    My first GameSalad game iSUB relied on using elliptical collision for the terrain collision to work, and it definitely worked that way back in 2010... so Im intrigued to know at what point it changed, and why?...

    @BlackCloakGS @CodeWizard @GeorgeGS Seems to be a bit of a bug/fudge for the collision to always stay circular and not stretch to fit the shape of the stretched actor.

    Seems strange that we only have two collision shapes usable to us, but one of them doesn't even work properly, and can lead to collision that doesn't match up to the size of the actor.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited August 2015

    @I. B., I often design my actors around the basic collisions shapes. It's a work around a bit of a struggle sometimes, but since I know it's how Gamesalad works it makes sense to fit what is offered.

  • GeorgeGSGeorgeGS Member, PRO Posts: 478

    @Chunkypixels said:
    As a side note... Im intrigued as too how long the circular collision shape has worked this way. Im sure that when I first started using GameSalad the circular collision stretched/deformed to fit to the edges of the actor, so if you stretched the actor in its width, the circle would become more elliptical.

    My first GameSalad game iSUB relied on using elliptical collision for the terrain collision to work, and it definitely worked that way back in 2010... so Im intrigued to know at what point it changed, and why?...

    BlackCloakGS CodeWizard GeorgeGS Seems to be a bit of a bug/fudge for the collision to always stay circular and not stretch to fit the shape of the stretched actor.

    As far as I know it has always worked that way. We use Box2D for our physics library. It supports a circle collision shape that has a position and a radius. It is always a perfect circle.

    Seems strange that we only have two collision shapes usable to us, but one of them doesn't even work properly, and can lead to collision that doesn't match up to the size of the actor.

    We believe it works as intended, as a circle. If you have an example of something that doesn't seem to be working properly we'd be happy to take a look.

  • I. B.I. B. Member, BASIC Posts: 4

    Jamie, I understand what you say, and I agree... now that I know that it works like that. The thing is that in my case the game is based on the characters of an illustrated book, so I should respect the shape of the original illustrations. I'll have to think a way around it or forget about the project :'( . Thanks!

  • ChunkypixelsChunkypixels Member Posts: 1,114

    @GeorgeGS ...cheers for putting me correct on the issue... I just researched Box2d circle collisions and yup, it seems I've been working under a wrong assumption for the past 5 years with regards to GS circle collisions... I'd assumed that the circle would scale to fit the actor, and in some cases even designed it into some games... I'm amazed that I never experienced any major issues due to it!!

    So yup... I stand corrected... Its working correctly.

    Still not great from a design and userbility point of view though, as it means theres often a big disparity between the actor size and the collision, if the circle gets squished or scaled in an uneven fashion. I guess it's even more of a reason to get the much requested polygon collisions in place :)

  • ChunkypixelsChunkypixels Member Posts: 1,114
    edited August 2015

    I.B. don't let it put you off from creating your game. Like @jamie_c said, you just need to use a set of invisible collision actors constrained with offsets to your graphic actor, in order to create a more suitable collision setup for your particular character and game.

    It's not ideal... But it's not too complicated to setup either....

  • SocksSocks London, UK.Member Posts: 12,822

    @Chunkypixels said:
    . . . it's not too complicated to setup either....

    http://forums.gamesalad.com/discussion/75220/fast-constrain-linkmachine-v2

  • I. B.I. B. Member, BASIC Posts: 4

    I'll try this tomorrow! Thanks everyone!

Sign In or Register to comment.