Actor's/Image's Shape = Square, not what I want. Help.

ZeltchoronZeltchoron Member Posts: 4
edited June 2014 in Working with GS (PC)

Right now I am stuck with an object that is a triangle, that is defined as a square.

Here is an example.

I want the blue triangle to be defined as triangle, not as a square. Currently if anything collides with the perimeter of the square, it preforms the action; I want it so "if anything" collides with the perimeter of the TRIANGLE, it preforms the action.

I hope you guys understand my question as I want this to apply to any shape. I am simply just using a simple square and triangle to get my question off.

Thanks!

-Zeltchoron

Comments

  • RohalRohal GermanyMember Posts: 62

    I think at the moment there a only two possible collision shapes - circles and squares.
    Would be nice if there would be a chance to define a polygon...

  • ZeltchoronZeltchoron Member Posts: 4

    Thanks Rohal, that is quite unfortunate.

  • AdrenalineAdrenaline Member Posts: 523

    You could make invisible actors, in rectangle shapes and constrained to certain positions around your actor, and these will detect the collisions. It's not perfect, but it would work better.
    So for your triangle example, have one wide and short rectangle at the bottom, another slightly less wide above that, another even less wide above that, and so on. So you'll be building a step-pyramid that can be used to detect collision for your visible triangle.

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408

    yea we only have the two collision shapes right now, I'm hoping that the rewrite of the creator allows them to add more physics bodies as i think they are kinda stuck in the current version.

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

    @Adrenaline said:
    You could make invisible actors, in rectangle shapes and constrained to certain positions around your actor, and these will detect the collisions. It's not perfect, but it would work better.
    So for your triangle example, have one wide and short rectangle at the bottom, another slightly less wide above that, another even less wide above that, and so on. So you'll be building a step-pyramid that can be used to detect collision for your visible triangle.

    You could just use three rectangles like this:

    Link: https://www.mediafire.com/?tebzsp51poh2y3c

  • MasterCosmoMasterCosmo MichiganMember Posts: 13

    I agree with @Socks, Make 3 narrow rectangles as each side of the triangle actor with collision rules built into them.

    That's the best we can do for now.

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880
    edited June 2014

    Here is yet another way. Less math but takes a couple more actors.

    http://www.mediafire.com/download/737omdxsxqze4zd/triangleDetection.zip

  • ZeltchoronZeltchoron Member Posts: 4
    edited June 2014

    Thanks everyone for the suggestions and possibilities, although I am frankly not currently desperate for anything as complex as the first way @RThurman suggested. I think I will do is simply create a few rectangular actors and constrain their positions around the actual actors, as @Adrenaline suggested.

    If I find it game-breaking and completely necessary then I am sure I will push myself into the "intestive" suggestion by @RThurman.

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

    @Zeltchoron said:
    I think I will do is simply create a few rectangular actors and constrain their positions around the actual actors, as Adrenaline suggested.

    You can do a better job (a smoother, more accurate definition of shape) with just three actors as mentioned above.

  • ZeltchoronZeltchoron Member Posts: 4

    @Socks said:
    You can do a better job (a smoother, more accurate definition of shape) with just three actors as mentioned above.

    I was simply using the triangle as an example, I am using much more complex polygons and I am sure I can constrain minimal squares to achieve close to what I want.

Sign In or Register to comment.