I want to add random movement to some of my game objects, similar to how flies swarm in Unity3D. I developed a method using the addforce () method, but would like to get around the physics engine.
Any help is determined
Simple 2D random move:
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); }
Source: https://habr.com/ru/post/1723425/More articles:How does the search display controller hide the navigation bar? - iphoneChrome OS development on Mac - linuxEntity Framework EDM.Binary Mapping for type VB - entity-frameworkDelete the specified text from the beginning of lines only if present (C #) - stringWhat is the best way to get your own software in Debian and Fedora? - debianTwitter Proxy in C # - c #единичные тестовые процедуры анализа файлов? - unit-testingWhat does ActivePerl do when it "moves" files during installation? - perlinstalling multiple IDEs causes problems - eclipseLocalization of "ajaxToolkit: CalendarExtender" - asp.net-ajaxAll Articles