GameSalad

Howdy, Stranger!

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

Collision error (please see image)

CiaphisCiaphis Posts: 58Member, PRO

Basically what is happening is GS is not registering to collision models for the following image. I had to set up two collision shapes (not connected). it exported just fine (PhysicsEditor w/ GameSalad exporter).

I can only assume that GS is not setup to accept collision in this manner.

And this is the collision output from PhysicsEditor:

Best Answer

Answers

  • CiaphisCiaphis Posts: 58Member, PRO

    That’s a lot better than what I was about to attempt. Thanks!

  • CiaphisCiaphis Posts: 58Member, PRO
    edited May 17

    I was going to separate the two images and spawn the top one. constrain the top image to the bottom image x spawn coordinates and something like bottom image Y cords +40 px and use an if actor spawned, spawn actor to get the ball rolling. Of course these variables would be stored globally to allow sharing of information between the two actors.

    Thanks again!

  • RowdyPantsRowdyPants Posts: 408Member, PRO

    @Ciaphis Are you sure you set up the collision correctly? Complex Geometry (disconnected masks and hollowed out) can be achieved in Physics Editor and used within GS. This Ball and Chain demo made by @Socks shows chain links with complex geometry performing as expected in GS creator.

  • CiaphisCiaphis Posts: 58Member, PRO

    It looks like he created the collision shapes independently using separate images for each (ie... one for the link and one for the ball) and then placed them in an overlapping configuration within GS.

    For my purposes, both images are on the same document, the problem is there are no connecting lines between the two drawings and prevents the GS from importing custom collision (multiple collision shapes that are not connected or on the same layer) from PhysicsEditor.

    Make sense?

  • RowdyPantsRowdyPants Posts: 408Member, PRO

    @Ciaphis I guess I’m not following. If you look at the individual chain links (the ones with two separate collision triangles) other actor objects can pass through the center of them without issue. Seems exactly like what you’re going for with a space in the middle. Anyway, I’m glad y’all got it worked out :smile:

  • ArmellineArmelline Posts: 4,619Member, PRO

    @Ciaphis is correct in that you cannot have two completely separate elements to a collision shape. A collision shape must be one contiguous shape. @rainwaterstudios solved the issue by using two actors.

  • RowdyPantsRowdyPants Posts: 408Member, PRO

    @Armelline

    This is one actor. This looks separate to me. PE can output. GS can input. The two collision data sets seem to behave correctly although you're saying they don't really behave all the way correctly (as two separate actors would). It's interesting there's partial functionality here (if you start overlapped with your collider).

  • CiaphisCiaphis Posts: 58Member, PRO
    edited May 18

    It looks as if he created a collision box around the entire side links and then put the “sway” collision points after the fact..

    Would be interesting to see what happens when you rotate the side
    chain 90 degrees.

    I could always try that method of collision boxes within a box and see if that yields good results. Will post more tonight when I get home from work.

  • CiaphisCiaphis Posts: 58Member, PRO

    It would be nice to have an option for collision to ignore the alpha channel in images.

  • ArmellineArmelline Posts: 4,619Member, PRO

    @RowdyPants said:
    @Armelline

    This is one actor. This looks separate to me. PE can output. GS can input. The two collision data sets seem to behave correctly although you're saying they don't really behave all the way correctly (as two separate actors would). It's interesting there's partial functionality here (if you start overlapped with your collider).

    Seems I am wrong then!

  • JapsterJapster Posts: 642Member, PRO
    edited May 19

    @Armelline said:

    Seems I am wrong then!

    @Armelline - Wow, that's a first at least mate, I was beginning to think you might be an infallible A.I. construct - I have never known you to be wrong!... :wink:

  • CiaphisCiaphis Posts: 58Member, PRO

    Haha, physics body editor seems to be a good choice as physics editor or at least the output for GameSalad isn’t set up for collision with masked areas.

  • CiaphisCiaphis Posts: 58Member, PRO

    The short answer and the best answer to this would be:

    Just download Physics Body Editor.

    ** Make sure you create a copy of the image file you are going to use to make your collision image with. **

  • rainwaterstudiosrainwaterstudios Posts: 152Member, PRO

    @Armelline said:
    @Ciaphis is correct in that you cannot have two completely separate elements to a collision shape. A collision shape must be one contiguous shape. @rainwaterstudios solved the issue by using two actors.

    Ehhh, sort of... I used two instances of the same actor + collision shape, with one instance being rotated 180º.

  • CiaphisCiaphis Posts: 58Member, PRO
    edited May 20

    The phisics body editor works well enough

  • RowdyPantsRowdyPants Posts: 408Member, PRO
    edited May 20

    @Japster :lol:
    @Armelline :heart:
    @rainwaterstudios Sounds like two actors to me!
    @Ciaphis It is pretty awesome :smile:

  • ArmellineArmelline Posts: 4,619Member, PRO

    @Japster said:
    @Armelline - Wow, that's a first at least mate, I was beginning to think you might be an infallible A.I. construct - I have never known you to be wrong!... :wink:

    Happens to us all sometimes :D

  • rainwaterstudiosrainwaterstudios Posts: 152Member, PRO

    @RowdyPants said:
    @rainwaterstudios Sounds like two actors to me!
    @Ciaphis It is pretty awesome :smile:

    Instances of actors are different than separate actors... aren't they?
    2 actors would mean 2 prototypes; 2 actors showing up in the 'Actors' tab of the inspector when in a scene, and also in the 'Actors' tab menu.
    I used 2 instances of the same actor on a scene...

  • RowdyPantsRowdyPants Posts: 408Member, PRO

    @rainwaterstudios Eh, just mean two separate objects that GameSalad sees as having their own properties. Yes, they both come from the same parent object. Yes, they're both instantiated from the same set of properties but they're two separate incarnations of those object properties. All @Armelline and @RowdyPants (hey that's me!) mean is that you solved it by not using a single instance of a single actor.

  • rainwaterstudiosrainwaterstudios Posts: 152Member, PRO

    @RowdyPants said:
    @rainwaterstudios Eh, just mean two separate objects that GameSalad sees as having their own properties. Yes, they both come from the same parent object. Yes, they're both instantiated from the same set of properties but they're two separate incarnations of those object properties. All @Armelline and @RowdyPants (hey that's me!) mean is that you solved it by not using a single instance of a single actor.

    I try to be specific with my terminology, lol.
    My point being, you COULD set this up with 2 separate prototypes, and each would half their respective collision data - one L actor with its custom collision shape, and one R actor with a separate collision shape.
    By having the collision data loaded into only one prototype, you can use the same actor for two instances by having one of them rotated to 180º in scene.
    So you end up dealing with a single prototype with one collision shape, used twice in the scene. Is that not preferential to having two separate prototype actors, each with their own collision shape? Wouldn't the project benefit by having fewer .json files and actor prototypes?
    Maybe it's inconsequential, but with the amount of glitches, freezing and crashing I've experienced, I try to set things up as efficiently as possible...

  • CiaphisCiaphis Posts: 58Member, PRO

    The physics body editor does not export .json files. It outputs a PNG. As far as using instances, it’s 6 of one half dozen of another. If you can achieve the type of collision referenced in this thread in a single output file, might as well keep it simple and organized.

    I appreciate all of your help, it has been valuable!

Sign In or Register to comment.