- Home /
2d physics for balance game like Wii Party Pirate Ship
Sorry if this is a total noob question. I'm new to physics in Unity. I have something working, I just want to know if there are other or better ways.
There's a game in Wii Party that looks like this
Here's a video of it in action. See 10:40 https://www.youtube.com/watch?v=KQPVv21G-4A#t=10m40s
You put characters on the various decks of the mast. First to tip it over loses.
What I did so far
+--Ship [RigidBody2D + HingeJoint2D attached to nothing (world)]
| |
| +--Deck1 [BoxCollider2D]
| +--Deck2 [BoxCollider2D]
| +--Deck2 [BoxCollider2D]
|
+--CounterBalance [RigidBody2D + HingeJoint2D attached to Ship]
For the HingeJoint2D
on the CounterBalance
I set it to Use Limits
true and set both the Lower Angle
and Upper Angle
to 0. This works mostly. If I increase the CounterBalance
mass it gets harder to tip the ship. One thing that doesn't work is Ship drifts up a little when I press play. Given it's on a HingeJoint2D
it seems like it shouldn't budge. No idea what I'm doing wrong there :(
Is that the best way to do this? It seemed a little strange to me to use a HingeJoint2D
to add the CounterBalance
. Is that the "correct" way to add a counter balance? I don't see another way to make a "rigid" connection between 2 masses (2 RigidBody2Ds).
If I move CounterBalance
as a child of Ship
it has no effect. DistanceJoint2D
doesn't work because it's doesn't keep things rigid. It's just like a pole on a hinge.
Maybe this a really "noob" question but I didn't see anything in the tutorials. Or maybe it went over my head
Your answer
Follow this Question
Related Questions
Compound 2D colliders not colliding properly 0 Answers
Is this a correct way to have multiple different compound colliders in one gameobject? 1 Answer
Effectors not working with compound collider? 2 Answers
What exactly is RelativeVelocity? 1 Answer
Zero friction, zero drag, zero gravity bouncy ball in 2D 1 Answer