#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Actor collision shape

Posts: 4Member, BASIC

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!

• ImagineLabs.rocks Posts: 5,548Member
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.

• Posts: 4Member, BASIC

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.

• Posts: 1,113Member
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.

• ImagineLabs.rocks Posts: 5,548Member
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.

• Posts: 478Key Master, Head Chef, Member, PRO

@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.

• Posts: 4Member, BASIC

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!

• Posts: 1,113Member

@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

• Posts: 1,113Member
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....

• London, UK.Posts: 12,822Member

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