ℹ️ For Yop2D Next, the new 2D + 3D version of Yop2D (coming soon). Button and node names are those of Yop2D Next.
🔍 How do I…? All short recipes, with a search
Short answers to questions about realistic physics in Yop2D Next: objects that fall, roll, bounce and hold on to each other. The names in bold are the ones you see on the screen.
👉 Almost everything here needs the Realistic physics behaviour (⚙ Object behavior button in the Inspector). To choose the right behaviour: Which behaviour to choose?.
How do I make a rope or a chain?
- The hanging object (a lantern, a crate): Realistic physics, type Normal (falls, can be pushed). The hook: a small object at the top; it can stay without physics, it won't move.
- On Start → Link two objects: Object A = the lantern, Object B = the hook, Kind of link “Rope”, and “Show the rope” set to Yes to see it.
- “The finger can cut it” set to Yes: the player cuts the rope by sliding a finger across it, and the When a rope is cut event fires. To cut it with a node: Cut a link.
- A chain that bends: several Realistic physics links, each one joined to the one before by a “Hinge” link.
- In 3D: Attach two objects (3D), with Ball joint (pendulum, chain).
How do I make a swinging door or a drawbridge?
- The door (or the bridge plank): Realistic physics, type Normal (falls, can be pushed).
- On Start → Link two objects: Object A = the door, Object B left empty (it hangs on the scenery), Kind of link “Hinge”, point of object A Left (the hinge side; Bottom for a drawbridge). Give the link a name, for example bridge.
- Lower limit and Upper limit, in degrees: how far it can turn (for example 0 and 90, a quarter turn).
- To raise the bridge: Adjust a link (link bridge, Motor: speed 45; 0 to stop it). A door seen from above must not fall: Gravity for this object = None (floats).
- In 3D: Attach two objects (3D), with Vertical hinge (door) or Lying hinge (drawbridge, swing). The object needs the Physics object (falls, rolls, bounces) behaviour.
How do I make a car or a ragdoll?
- Tap Object → Tools → Create a body, and give it a name (for example car).
- Add the parts with the + button (an image or a shape) and place them like on a drawing: the body and two wheels, or the head, chest, arms and legs of a ragdoll.
- Choose Link, tap two parts, then set the Kind of link on the right. Car: Wheel, with Motor and its Motor speed. Ragdoll: a Hinge at each elbow and each knee.
- Tap Try it to watch it fall and roll, then Place in the scene. During the game, the Place a body (ragdoll, car…) node places another one.
- To start or stop the motor in the game: Adjust a link, with the name written on the Name for the nodes: line. The player builds the vehicle? Assemble the parts node.
How do I throw an object in an arc (like Angry Birds)?
- The bird and the crates: Realistic physics, type Normal (falls, can be pushed). The ground: Ground / wall.
- A Throw button (Button with text): On Object Click (Throw) → Launch (angle and speed) (Object bird, Angle -45, Starting speed 1500).
- Gravity does the rest: the bird flies in a curve and knocks the crates over. Angle 0 = to the right, -90 = up. More speed = farther.
- So that the player can move objects with a finger: Finger held down → Grab with the finger (physics).
- In 3D: Throw in an arc (3D) makes the object land right on a target.
How do I make an explosion that pushes the crates?
- The crates have the Realistic physics behaviour: only these objects are blown away.
- On Object Click (bomb) → Explosion (physics blast) (Object bomb, radius 400, force 1500) → Particle effect (Explosion model) → Destroy Object (bomb).
- The closer a crate is to the center, the harder it is thrown, and it starts spinning. The node destroys nothing: Destroy Object is what makes the bomb disappear.
- In 3D: Explosion blast (3D). The explosion you can see (particles, shaking): How to make an explosion?.
How do I draw a line with my finger that becomes an object?
- On Start → Draw with your finger (Ink 2500). When the finger lifts, the line becomes a real physics object that falls and rolls.
- “The drawing…” setting on “Stays in place (fixed)”: the line becomes a bridge or a wall that doesn't move.
- When a line is finished: When a drawing is finished event, Object “# dessin” (the drawings' tag). The drawing is the involved object. If “# dessin” isn't in the list, give the tag dessin to a small hidden object (Tag (family of objects) line).
- The ink left (in %) is in the encre variable: Every frame → Modify Text
=encre. To put the pencil away: Draw with your finger with “Stop drawing”.
How do I set the gravity of the whole level (on the Moon)?
- On Start → Set the physics world: Gravity downwards 20 % for the Moon (100 = normal, 0 = space, negative = everything falls upwards). Gravity to the right makes a wind that blows all the time.
- This node only changes Realistic physics objects. A Falls and bounces object has its own Gravity setting (Light…) in ⚙ Object behavior.
- Just one floating object (a balloon): Gravity for this object = None (floats), in the Realistic physics settings.
- In 3D: Gravity (3D) (30 % = on the Moon). To make the platform hero jump higher: How do I change the jump height?.
What are Material, Weight, Bounce and Grip for?
- They are the Realistic physics settings, in ⚙ Object behavior → ② ITS SETTINGS.
- Material sets everything at once: Wood, Stone, Metal (very heavy), Rubber (bounces a lot), Ball (light and bouncy), Ice (slides), Feather (very light, slowed down by the air).
- Weight: a heavy object pushes light ones and can hardly be pushed. Bounce: from nothing at all to a lot (a ball).
- Grip: Slippery = like on ice (a hockey puck); Grippy = it stops quickly (a tyre). Air drag slows the object down in the air.
- To change them during the game: Adjust a physics object node (in 3D: Set a physics object (3D)).
What is “Very fast object (never goes through a thin wall)” for?
- A very fast object (a bullet, an arrow) can jump over a thin wall between two frames of the game: it goes through it.
- Tick Very fast object (never goes through a thin wall) in the Realistic physics settings: Yop2D checks the whole way, and the wall stops it.
- Only tick it for fast objects: it gives the phone a little more work. The box only exists for the Normal (falls, can be pushed) type.
- For all objects at once: Set the physics world, Precision “High”.
👉 Nothing moves? Check the type: Fixed (ground, wall, support) never moves, Normal (falls, can be pushed) falls and can be pushed. See also My game doesn't work.