ME FIRST GAMES
Menu

games for me and you

Unity Physics - Add Force

7/23/2020

0 Comments

 
Picture
Unity and other modern game engines offer built-in physics support. Unity specifically, empowers you with colliders and rigidbodies. These simulate physics but also give you the ability to manipulate and apply your own forces.
📌 Rigidbody.AddForce applies a force to any dynamic rigidbody.
📌 The ForceMode passed in allows you to control the type of force given.
📌 ForceMode.Force: Add a continuous force to the rigidbody, using its mass. I like using this for mechanics that push or pull over time, and larger (more massive) rigidbodies are harder to push.
📌 ForceMode.Acceleration: Add a continuous acceleration to the rigidbody, ignoring its mass. This is good for mechanics that push or pull rigidbodies of any size at the same rate.
📌 ForceMode.Impulse: Add an instant force impulse to the rigidbody, using its mass. Use this for pushing the character, where a short burst of force occurs, knocking back you back.
📌 ForceMode.VelocityChange: Add an instant velocity change to the rigidbody, ignoring its mass. I personally enjoy using this inside a character's movement controller. It gives you granular control over a character's velocity and movement while still working within the physics system.
📌 Rigidbody.AddForceAtPosition applies a force at a given position. This can make your explosions even more realistic because torque will be applied at the same time. Watch boxes tumble and fly away.
📌 Rigidbody.AddRelativeForce applies a force relative to the rigidbodies rotation. It's important to not confuse the transform rotation with the rigidbody rotation, which may be updated less frequently than the transform rotation.
💬 Did I miss something? Leave a comment down below ⬇️ 

0 Comments



Leave a Reply.

    Picture
    Me First Games is an independent game studio dedicated to creating unique and bizarre video games.
    GAMES HERE

    Red Matter

    Star Impact is an upcoming adventure platformer coming to PC, Mac, and Linux.

    Archives

    April 2021
    February 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2019
    March 2019
    December 2018
    April 2018

    Categories

    All

    RSS Feed

Copyright (c) 2020 Me First LLC
  • STU the First AI
  • Blog
  • Contact
  • Unity Tools
    • Hierarchy Comments
  • STU the First AI
  • Blog
  • Contact
  • Unity Tools
    • Hierarchy Comments