FirstPersonLauncher with Softbody itself - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html) +--- Thread: FirstPersonLauncher with Softbody itself (/thread-2642.html) |
FirstPersonLauncher with Softbody itself - nbac85 - 18-12-2020 Hey i would like to shoot some softbodies. so i want to do a mix between the actor spawner and the fps launcher. the softbody does not have a rigidbody so how do apply initial velocity to the particles? i did pose the whales with obi and now i need to shoot crabs. https://vimeo.com/492231983 RE: FirstPersonLauncher with Softbody itself - josemendez - 18-12-2020 (18-12-2020, 11:59 AM)nbac85 Wrote: Hey i would like to shoot some softbodies. Same way as you'd do with a rigidbody: Quote:softbody.AddForce(velocity,ForceMode.VelocityChange); See: https://docs.unity3d.com/ScriptReference/Rigidbody.AddForce.html https://docs.unity3d.com/ScriptReference/ForceMode.VelocityChange.html Only difference between rigidbodies and softbodies is that rigidbodies have a single linear velocity (measured at its center of mass), while softbodies have multiple velocities (one per particle). But you can use AddForce() the same way with both. RE: FirstPersonLauncher with Softbody itself - nbac85 - 18-12-2020 yes thanks ! i have to add very high values else its working perfectly! Code: using System.Collections; RE: FirstPersonLauncher with Softbody itself - josemendez - 18-12-2020 Remember that the change in velocity or acceleration = force/mass, so if the softbody mass is high, you will have to use a large force for it to result in enough acceleration. Using ForceMode.VelocityChange as indicated above might be a better idea if you don't want mass to affect launch speed. |