Actor's/Image's Shape = Square, not what I want. Help.
Zeltchoron
Member Posts: 4
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
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...
Thanks Rohal, that is quite unfortunate.
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.
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.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
You could just use three rectangles like this:
Link: https://www.mediafire.com/?tebzsp51poh2y3c
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.
Here is one way, its a bit math intensive.
http://forums.gamesalad.com/discussion/comment/452686/#Comment_452686
Here is yet another way. Less math but takes a couple more actors.
http://www.mediafire.com/download/737omdxsxqze4zd/triangleDetection.zip
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.
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.