Add Unity3D projects

This commit is contained in:
2024-03-09 19:25:59 +00:00
parent 1c71f24fab
commit 829289c881
4626 changed files with 441247 additions and 0 deletions

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpeedLimiter : MonoBehaviour {
// inspector settings
public Rigidbody rigid;
public float speedLimit = 5f;
//
// Update is called once per frame
void FixedUpdate () {
float spd = rigid.velocity.magnitude;
if (spd > speedLimit)
rigid.velocity *= speedLimit / spd;
}
}