Facebook
From Cream Marmoset, 4 Years ago, written in C#.
This paste is a reply to Balance Ragdoll Code from BillyMan - go back
Embed
Viewing differences between Balance Ragdoll Code and Re: Balance Ragdoll Code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Balance : MonoBehaviour
{
    public float targetRotation;
    Rigidbody2D rb;
    public float force;

    void Start()
    {
        rb = GetComponent();    
    }

    void Update()
    {
        rb.MoveRotation(Mathf.LerpAngle(rb.rotation, targetRotation, force * Time.fixedDeltaTime));
    }
}