Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

I want to create a 2D boad game. But how can I make it more fun for my boat movement

Discussion in 'Physics' started by NiceNonBugProgrammer, Aug 15, 2022.

  1. NiceNonBugProgrammer

    NiceNonBugProgrammer

    Joined:
    May 28, 2019
    Posts:
    1
    Hi! guys. I am going to create a 2d boat game. I want the boat to behave like real boat in our world. Like it can drift, and have inertia (like when you padding forward and rotate the boat to it's left direction, it will still go that direction even when you stop) Can anyone give me some idea? Many thanks :D
     
  2. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    223
    Use a rigidbody. Use addforce for forward movement and torque for turning. You can adjust the drag to your liking.
     
  3. NarutoU21

    NarutoU21

    Joined:
    Sep 27, 2020
    Posts:
    12
    Hey @GanstaPop the physics behind your boat movement is all about how make water and boat to react with each other. Water can effect(force and reaction) the boat and same goes for the boat as well which will also has mass and force on the water. if you want to create great effects or want to be more realistic to the boat then i would suggest some content to read might be helpful.
    https://docs.unity3d.com/ScriptReference/Rigidbody.html
    This page is powerful one if you explore it correctly.
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,507
    Note the OP is asking about 2D physics (your link is for 3D). Use https://docs.unity3d.com/ScriptReference/Rigidbody2D.html
     
    NiceNonBugProgrammer likes this.
  5. NarutoU21

    NarutoU21

    Joined:
    Sep 27, 2020
    Posts:
    12