![]() Your wind can now blow up, down, forward, backward, left, and right at different strengths and will become more violent the higher you travel.Are you looking to add some music to the background of your Roblox gameplay? There’s already a means to listen in on some tunes for players. The rest is self explanatory.īodyForces are more reliable than you think and repeatedly setting Velocity (even on Heartbeat) will cause very weird physics behavior and involves unneeded math. Your floor value is simply the height at which no wind occurs. To phase in your wind, apply a Lerp to your BodyForce’s Force value based on the height of the player using an alpha which is the percentage of the player’s height to the target height.įor example: thisWindForce = Vector3.new():Lerp(globalWindForce, math.max(+floor, 0)/(+floor)) You can simply tween each wind value in over a span of 5 seconds or so, or slower if you’d like. ![]() This will randomly pick wind strength in each direction. ![]() To get a direction, pick a random vector like so: Vector3.new(math.random()-0.5, math.random()-0.5, math.random()-0.5)*windStrength Your wind direction is easy to get and you can even use TweenService to change this slowly over time. BodyVelocity is not a good idea since wind is essentially just a force, not a constant velocity applied to objects. You can then apply a force using a BodyForce which is a multiple of this value. Well you can have a global wind value which is just a direction and phase this in the higher up you are.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |