Collision error (please see image)

CiaphisCiaphis Member Posts: 58

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

  • rainwaterstudiosrainwaterstudios Posts: 198
    Accepted Answer

    @Ciaphis said:
    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:

    I set up an example for you here: https://drive.google.com/file/d/1EwTTiGB4ppDyFo_DJpM63_n9jgwr_p94/view?usp=sharing
    Instead of using 2 separate collision shapes (1 for the left, 1 for the right) in 2 separate actors, I put two instances of the same actor on the scene and then changed the rotation of one of them to 180°. The collisions seem to be working fine when set up in this manner.

Answers

  • CiaphisCiaphis Member Posts: 58

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

  • CiaphisCiaphis Member Posts: 58
    edited May 2018

    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 Member Posts: 465

    @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 Member Posts: 58

    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 Member Posts: 465

    @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 Member, PRO Posts: 5,327

    @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 Member Posts: 465

    @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 Member Posts: 58
    edited May 2018

    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 Member Posts: 58

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

  • ArmellineArmelline Member, PRO Posts: 5,327

    @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 Member Posts: 672
    edited May 2018

    @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 Member Posts: 58

    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 Member Posts: 58

    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 Member Posts: 198

    @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 Member Posts: 58
    edited May 2018

    The phisics body editor works well enough

  • RowdyPantsRowdyPants Member Posts: 465
    edited May 2018

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

  • ArmellineArmelline Member, PRO Posts: 5,327

    @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 Member Posts: 198

    @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 Member Posts: 465

    @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 Member Posts: 198

    @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 Member Posts: 58

    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.