Design+Code logo

Quick links

Suggested search

Physics image 1

Body type

Try moving the cat to the Big Plant. It is not moving because it’s body type is Positioned which means that it is fixed. Let’s set it to Dynamic and position it a bit above the Wood. Enter Play mode and you see that it is falling.

Dynamic properties

Physics image 2

By having Dynamic enabled, there’s a bunch of properties that are available. The Weight makes your object lighter or heavier, the gravity scale is useful if you want 2 similar objects to be affected differently by gravity, friction makes your object slide on a flat surface, similar to ice, damping can make your object fall slower and bounce makes the object bounce back on collision. Collider is really similar to the Game Controls one. It gives boundaries on your object. Translation and rotations are basically limits to where your objects and translate or rotate.

  • Weight: Makes your object lighter or heavier
  • Grav.Scale: Gravity force on a particular object
  • Friction: No friction will make the object slide on a surface
  • Damping: Gives the object a damping effect
  • Bounce: Makes the object bounce back on collision
  • Collider: Boundaries of the object
  • Translation: Limits the translation of the object
  • Rotation: Limits the rotation of the object

Children physics

The way the Plant is falling doesn’t feel natural because the stand is attached to the plant. Here comes the children property, Fused will apply physics on the whole group and Separate will apply physics to the children. Set the group to Separate. Then, the stand and plant’s body type to dynamic. Set friction to max and bounce to minimum. Enter Play mode and this feels a lot more natural.

Game controls

Physics also works with Game controls, enter Play Mode and move the cat to the plants.

BACK TO

Collision Detection

READ NEXT

3D Camera & Lighting

Templates and source code

Download source files

Download the videos and assets to refer and learn offline without interuption.

check

Design template

check

Source code for all sections

check

Video files, ePub and subtitles

Subtitles

Videos

Assets

Meet the instructor

We all try to be consistent with our way of teaching step-by-step, providing source files and prioritizing design in our courses.

Willie Yam

Front-end/UI developer at Design+Code

I do UI coding. HTML/CSS/JS/SWIFTUI dev.

icon

10 courses - 37 hours

course logo

Design and Prototype an App with Play

Build a completely functional prototype without writing a single line of code from your phone

3 hrs

course logo

Create a 3D site with game controls in Spline

Build an interactive 3D scene implemented on a ReactJS site using Figma and Spline

2 hrs

course logo

Build a Movie Booking App in SwiftUI

Learn how to create an iOS app based on a beautiful UI design from Figma with interesting animations and interactions, create a custom tab bar and use navigation views to build a whole flow

1 hrs

course logo

Build Quick Apps with SwiftUI

Apply your Swift and SwiftUI knowledge by building real, quick and various applications from scratch

11 hrs

course logo

CSS Handbook

A comprehensive series of tutorials that encompass styled-components, CSS, and all layout and UI developments

1 hrs

course logo

Advanced React Hooks

Learn how to build a website with Typescript, Hooks, Contentful and Gatsby Cloud

5 hrs

course logo

Unity for Designers

If you want to make a game and don't know where to start, you are in the right place. I will teach you how to use Unity, code in C# and share essential tips and tricks to make your first game.

5 hrs

course logo

Create a Javascript Game

Learn how to create a web game using Phaser 3, a popular javascript game engine. Draw a map using an editor, implement the player, make the player move, apply physics, collisions, and implement the enemies.

2 hrs

course logo

Build an ARKit 2 App

Introduction to ARKit and learn how to make your own playground. You will be able to add models or even your own designs into the app and play with them

4 hrs

course logo

Create a SpriteKit Game

Overview of SpriteKit a powerful 2D sprite-based framework for games development from Apple and learn how to create your very own platform

3 hrs