(2 Gray colors at each end and 2 White colors in the inner part) Assign the values for each Particle System module (Check Screenshots below): In Particle System enable these modules: Emission, Shape, Velocity over Lifetime, Color over Lifetime, Size over Lifetime, Rotation over Lifetime, External Forces, Renderer.Ģ.Add ParticleSystem component to "Particles" GameObject.Create another GameObject and name it "Particles", move it inside "Tornado" and change its position to (0, 0, 0).The axis the caught objects rotate aroundįor (int pointNum = 0 pointNum Create Empty) and name it "Tornado" Normalize the rotation axis given by the userĬ(pull.normalized * pull.magnitude, ForceMode.Force)
#TORNADO SIMULATOR 3 UPDATE#
Start is called before the first frame update Public Vector3 rotationAxis = new Vector3(0, 1, 0) SC_Tornado.cs //Tornado script controls tornado physics Set initial position of the caught object relative to its position and the tornado Make sure this is enabled (for reentrance) Public void Init(SC_Tornado tornadoRef, Rigidbody tornadoRigidbody, float springForce) Call this when tornadoReference already exists Rigid.AddForce(normal * tornadoReference.GetStrength(), ForceMode.Force) ĭebug.DrawRay(transform.position, normal * 10, Color.red)
Normal = Quaternion.AngleAxis(tornadoReference.lift, projection) * normal Vector3 normal = Quaternion.AngleAxis(130, tornadoReference.GetRotationAxis()) * projection Vector3 projection = Vector3.ProjectOnPlane(direction, tornadoReference.GetRotationAxis()) Vector3 direction = transform.position. Lift spring so objects are pulled upwards SC_Caught.cs //This script is attached automatically to each Object caught in Tornado Unity version used in this tutorial: Unity 2018.3.0f2 (64-bit) Step 1: Create all the necessary scripts In this tutorial, we will be creating a Tornado simulation inside Unity 3D.