Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为我的一些游戏对象添加随机运动,类似于 Unity3D 中苍蝇成群的方式。我开发了一种使用 addforce() 方法的方法,但想绕过物理引擎。
任何帮助都会得到帮助
简单的 2D 随机运动:
var speed = 0.5; function Update () { transform.position = Vector3.Lerp(transform.position, transform.position + Vector3((Random.value-0.5) * speed, 0, (Random.value-0.5)*speed), Time.time); }