Facebook
From BillyMan, 3 Years ago, written in C#.
Embed
Download Paste or View Raw
Hits: 586
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Balance : MonoBehaviour
  6. {
  7.     public float targetRotation;
  8.     Rigidbody2D rb;
  9.     public float force;
  10.  
  11.     void Start()
  12.     {
  13.         rb = GetComponent<Rigidbody2D>();    
  14.     }
  15.  
  16.     void Update()
  17.     {
  18.         rb.MoveRotation(Mathf.LerpAngle(rb.rotation, targetRotation, force * Time.fixedDeltaTime));
  19.     }
  20. }
  21.  

Replies to Balance Ragdoll Code rss

Title Name Language When
Re: Balance Ragdoll Code Cream Marmoset csharp 3 Years ago.