Set Velocity: Difference between revisions
Nikitaivanov (talk | contribs) (Created page with "/uploads/Set Velocity.png Instantaneously sets a physical object's directional velocity (units/second) and angular velocity (degrees/second). Inputs: * Object: The object to be modified. * Velocity: the velocity to be set with. * Spin: the angular velocity to be set with. == Notes == This should be used sparingly. No real object can instantaneously change its velocity, and simulated objects may behave weirdly when forced to do so. =...") |
-u ndefined- (talk | contribs) (Use Image template, remove excess details and explain example) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Block | |||
|image=Set_Velocity.png | |||
|type=s | |||
|folder=Physics | |||
|input1={{Port|e|Before}} | |||
|input2={{Port|o|Object}} | |||
|input3={{Port|v|Velocity}} | |||
|input4={{Port|v|Spin}} | |||
|output1={{Port|e|After}} | |||
}} | |||
Instantaneously sets a physical object's directional | Instantaneously sets a physical object's directional (units/second) and angular velocity (degrees/second). | ||
== Notes == | == Notes == | ||
This should be used sparingly. No real object can instantaneously change its velocity, and simulated objects may behave weirdly when forced to do so. | This should be used sparingly. | ||
No real object can instantaneously change its velocity, and simulated objects may behave weirdly when forced to do so. | |||
== Example == | == Example == | ||
Add a "speed limit" to a physical object: | Add a "speed limit" to a physical object. | ||
By checking whenever the [[distance]] of an object's velocity exceeds a set limit, we can [[normalize]] and [[scale]] to it: | |||
{{Image|Set_Velocity_example.png}} | |||
== Related == | == Related == | ||
Line 23: | Line 28: | ||
* [[Get Velocity]] | * [[Get Velocity]] | ||
* [[Add Force]] | * [[Add Force]] | ||
[[Category:Blocks]] | [[Category:Blocks]] |
Latest revision as of 07:48, 26 May 2024
Instantaneously sets a physical object's directional (units/second) and angular velocity (degrees/second).
Set Velocity
Type | Script block |
Collider | None |
Folder | Physics |
Ports | |
---|---|
Inputs | Before Object Velocity Spin |
Outputs | After |
Notes
This should be used sparingly. No real object can instantaneously change its velocity, and simulated objects may behave weirdly when forced to do so.
Example
Add a "speed limit" to a physical object. By checking whenever the distance of an object's velocity exceeds a set limit, we can normalize and scale to it: