Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Gravity change within Rigidbody2D set on "kinematic" type

Discussion in 'Scripting' started by emiliyashcherbak, Jan 9, 2022.

  1. emiliyashcherbak

    emiliyashcherbak

    Joined:
    Jan 8, 2022
    Posts:
    1
    Hello everyone,

    Can anyone help me with writing a code of gravity change on trigger (press LeftShift down) within Rigidbody2D set on "kinematic" type? I need this specific body type for my intentions. I have seen that there is a way to access object physics via code (link to the tutorial), therefore how gravity can be set on trigger?
     
  2. GroZZleR

    GroZZleR

    Joined:
    Feb 1, 2015
    Posts:
    3,201
    You're responsible for simulating your own forces with a kinematic rigidbody, including gravity.