Video Tutorial: Custom Collision Shapes using Physics Body Editor

13»

Comments

  • NNterprisesNNterprises Member, PRO Posts: 387

    And make sure MOVEABLE is checked on all of your actors I think

  • NNterprisesNNterprises Member, PRO Posts: 387
    edited August 2016

    Did you try manually tracing the points in PhysBodEditor instead of doing you auto fill thing in the video, like the image below

    just hit NEW on the side, create from rigid body, select image, hit creation, place a mark at each corner. Hit TEST and throw some balls at it to see if it works

  • buildbuild Member, PRO Posts: 45

    @Armelline said:
    Try importing this collision data.

    I added you file and now this happens: https://gyazo.com/93b89d22edccc19aeca5556f803be0a4

    @NNterprises said:
    Hey I watched the video 2 posts up, make sure you save your file WITH .json at the end. You have to type it at the end PhyBodEditor doesn't automatically put it in there (I use windows also).

    If @Armelline 's doesn't work of course.

    I did save as a .json file.
    Did you watch the youtube video?

  • NNterprisesNNterprises Member, PRO Posts: 387

    Yea I was able to watch it. I had an issue before where it wouldnt load correctly since I named it like TapCollision instead of TapCollision.json. It says its saving as a json file but still may need the .json extension

  • NNterprisesNNterprises Member, PRO Posts: 387

    The Gyazo video you posted looks like the floor is colliding with the blank/transparent part of your actor (and then falls to oblivion). So now it is colliding, just wrongfully.

    You don't need a collision rule in the floor if you have a collisioon rule in the diamond thing. Change floor to nonmoveable and take the collision rule out and retry and let me know what happens

  • buildbuild Member, PRO Posts: 45
    edited August 2016

    @NNterprises said:
    The Gyazo video you posted looks like the floor is colliding with the blank/transparent part of your actor (and then falls to oblivion). So now it is colliding, just wrongfully.

    You don't need a collision rule in the floor if you have a collisioon rule in the diamond thing. Change floor to nonmoveable and take the collision rule out and retry and let me know what happens

    then this happens: https://gyazo.com/e5a3ad0359d7b36e06ddccc4bce3474e

    Armellines' file worked just right. but i dont know how he changed the collision data

  • NNterprisesNNterprises Member, PRO Posts: 387
    edited August 2016

    Lol ok. So now try using physics body editor and manually outlining it like my 12:39 post and let me know. (Use your image to outline it tho).

    Remember to name it with .json

  • buildbuild Member, PRO Posts: 45
    edited August 2016

    @Armelline said:
    Example.

    Your example worked fine. But your when i added you collision data this happened: https://gyazo.com/e5a3ad0359d7b36e06ddccc4bce3474e

    And if i tilt it, it makes this weird bouncing:
    https://gyazo.com/5da4842f113a2779f933d02e402b2f8f

  • NNterprisesNNterprises Member, PRO Posts: 387

    Weird bouncing may be because of your ACCELERATE DOWN relative to actor, change it to relative to scene... But yeah still

  • ArmellineArmelline Member, PRO Posts: 5,354

    What image did you use on the floor? Looks like there's probably blank space at the top of the image.

  • NNterprisesNNterprises Member, PRO Posts: 387

    @Armelline said:
    What image did you use on the floor? Looks like there's probably blank space at the top of the image.

    Yeah @build you don't need an image with it, you can do no image and it will be a blank square but still gets the point across

    It may be bouncing diagonally/to the side since it has a pointed collision shape then

  • buildbuild Member, PRO Posts: 45

    same thing happens even though i remove the image.

    When i decrease the size of the falling block. it seems to collide but nowhere near the marked collision edges. https://gyazo.com/cdfcd4b82fae26a5c2b206dcc589e47e

    But that example Armalline came with, worked just fine. But when i used his .json file the same thing happened.

  • NNterprisesNNterprises Member, PRO Posts: 387

    I'm gonna PM you so I don't ruin @Armelline 's post by being way off topic

  • ArmellineArmelline Member, PRO Posts: 5,354

    Please post the project file.

  • buildbuild Member, PRO Posts: 45

    @Armelline. Could You take a look at my .json files?

    .json files: https://www.dropbox.com/s/tfoxi38vtiz4sad/.json files.rar?dl=0


    i added the image too

    I think all of this is happening because gamesalad isnt reading my .json file the right way

  • ArmellineArmelline Member, PRO Posts: 5,354

    @build said:
    I think all of this is happening because gamesalad isnt reading my .json file the right way

    I'll take a look as soon as I can, but if you believe GameSalad is incorrectly reading the JSONs (which might well be the case with the PC version), then be sure to submit a bug report:

    http://bugs.gamesalad.com

  • buildbuild Member, PRO Posts: 45
    edited August 2016

    @Armelline said:

    @build said:
    I think all of this is happening because gamesalad isnt reading my .json file the right way

    I'll take a look as soon as I can, but if you believe GameSalad is incorrectly reading the JSONs (which might well be the case with the PC version), then be sure to submit a bug report:

    http://bugs.gamesalad.com

    I already submitted a ticket in there.
    @NNterprises tried with the same OS and java, as i have (windows 10 & java 8), We did the exactly same process. Yet his collision data gets implemented as its supposed to, and mine doesn't.
    I asked him to send me his .json file, to compare his with mine. (we used the same image) But i havent recieved it yet.

    Could i maybe be missing a plugin? do i need to update/install any specific drivers?

    Notes:
    -I updated from windows 8.1 to windows 10. (It hasn't been working on any OS yet.)
    -I tried uninstalling and reinstalling ALL my programs. (still didnt work)
    -I tried using both java 6,7 and 8 (still no change)

    --

    Btw. You mentioned in an earlier reply, that my collision data was wrong. But did you read my .json file?
    Because the example you uploaded. working as supposed to when i tested it in Gamesalad.

  • ArmellineArmelline Member, PRO Posts: 5,354
    edited August 2016

    Okay, I took another look at some of the examples you've posted before. Everything works fine. I have no idea why it doesn't work for you, but when I took your "CustomCollisionIssue" project and added the Collision.json file you included with it to the diamond actor, everything worked as expected.

    So I thought "must be a PC issue" and booted up my PC and did the same thing in Windows GameSalad. Worked just fine.

    Your collision data is fine, your project is fine, combining the two works as expected. Honestly, I have no idea why things aren't working for you.

    What version of GameSalad are you using?

  • buildbuild Member, PRO Posts: 45

    Im using version 1.25.5977.17285 with pro license.

  • ArmellineArmelline Member, PRO Posts: 5,354

    I am using a different version to that on my PC. Let me check I'm up to date and try again.

  • ArmellineArmelline Member, PRO Posts: 5,354

    I appear to be using 1.25.5961.21898. Your version number seems to be higher, but this is what I just downloaded from GameSalad moments ago. Perhaps try downloading the app again and see what version number you end up with.

  • buildbuild Member, PRO Posts: 45

    i end up with the same version everytime. (version:1.25.5977.17285)

  • tuftyfellatuftyfella Member, BASIC Posts: 17
    edited October 2016

    Thread Resurrection :)

    so im trying this out and having trouble getting the Auto-Trace Multi-part detection to work. im basically using my background images which are effectively walls and it had no problem on the first level i tried as it was a single piece, but the second level is 2 parts, seperated by what are doorways and it doesnt seem to detect either with multi-part detection ticked.

    is this a known issue or am i doing something wrong?

  • ArmellineArmelline Member, PRO Posts: 5,354

    @tuftyfella said:
    Thread Resurrection :)

    so im trying this out and having trouble getting the Auto-Trace Multi-part detection to work. im basically using my background images which are effectively walls and it had no problem on the first level i tried as it was a single piece, but the second level is 2 parts, seperated by what are doorways and it doesnt seem to detect either with multi-part detection ticked.

    is this a known issue or am i doing something wrong?

    I'm not sure if GameSalad supports multi-part. But it's been a long time since I played with Physics Body Editor, and I've not tried multi-part, so I can't say anything for certain. Perhaps someone can confirm?

  • tuftyfellatuftyfella Member, BASIC Posts: 17

    tried the codeandweb trial version also but that also doesnt work with multi-parts for GameSalad.

    ohwell, i guess im placing 1.5k+ wall blocks lol >.<

  • AdrenalineAdrenaline Member Posts: 523

    Hey guys, forgive me, I'm a bit behind on versions so I can't dive in myself and try to figure this out: Is there a way to dynamically set the custom collision for an actor?

    For example, let's say I have an actor that is a slice of a circle arc, 45 degrees, behaving like a bucket. If, through image constraints, I animate this slice and expand it to let's say 90 degrees, could I keep the collision body in sync with its appearance?

    I hope my question is clear. And then I hope there's a good answer haha.

    Thanks in advance!

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @Adrenaline no, the custom collision shapes can not be dynamically swapped out. You would have to spawn/replace the actor with a new one, prepared with the new shape.

    In answer to @tuftyfella , no GS does not import multi-part collision shapes.

  • AdrenalineAdrenaline Member Posts: 523

    @Hopscotch Thanks for the quick reply!

  • ArmellineArmelline Member, PRO Posts: 5,354
    edited October 2016

    @tuftyfella said:
    ohwell, i guess im placing 1.5k+ wall blocks lol >.<

    Consider using Tiled to lay out your level and spawning the walls from a table.

    If you're manually placing them, consider using Manto's layout tool. I don't have a link to hand but if you search the forums you'll find it easily.

Sign In or Register to comment.