Set Velocity: Difference between revisions

From Fancade Wiki
(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. =...")
 
No edit summary
Tags: Mobile edit Mobile web edit Advanced mobile edit
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[width=336px,alt=Set Velocity|/uploads/Set Velocity.png]]
{{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 velocity (units/second) and angular velocity (degrees/second).
Instantaneously sets a physical [[object]]'s directional (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 ==
== 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:


[[File:com.martinmagni.fancade_Screenshot_2021.04.11_20.33.36.png]]
{{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 01:35, 23 August 2025

Set Velocity
Set_Velocity.png
TypeScript block
ColliderNone
FolderPhysics
Ports
Inputs Before
Object
Velocity
Spin
Outputs After

Instantaneously sets a physical object's directional (units/second) and angular velocity (degrees/second).

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:

Set_Velocity_example.png

Related