Tutorial:Vectors
More actions
Vectors encode both direction and magnitude, they are used throughout physics to represent velocity. This is the primary context that they will be used here.
One of the most common version a user of Resonite is likely to encounter is the 3D instantaneous(?) vector and is represented as a float3. Direction is encoded by the ratio between X,Y,Z. Magnitude('speed') is encoded by the combined values. They can be negative as well as positive.
While entangled as a single set of values,the two pieces of information are each being able to be manipulated independently of the other through a number of operators.
One important concept that will come up in this cookbook is of a 'normalized' vector. This effectively removes the magnitude (Or removes the 'difference in magnitude' between vectors) and allows direction only to be compared or to give a known starting point if you wish to then set a known magnitude.
Cookbook
Finding a direction from one slot to another
Use ProtoFlux:GlobalTransform to get the position of each slot.
Subtract one from the other. This will give you the raw vector, including the distance between the two.
ProtoFlux:Normalized will then give you a direction disregarding magnitude.
Making a vector 'faster/stronger'
Multiply the Float3 floats by the same number. (Float3 x Float3 or Float3 x Float) This will not change its direction.
Changing a vector's direction

Multiply the vector(Float3) by a Quaternion(FloatQ). (Note: FloatQ must be on top for the node to overload/change correctly)
You can use ProtoFlux:FromEuler to start with a Euler Angle as used in the Inspectors combined with ProtoFlux:Pack3 it will allow changing directions based on other inputs.
One example is to use ProtoFlux:GetUp on a slot to get it's world up, then multiplying it either X(?) sets -45 to 45 will.. stuff. (will update)
Comparing two vectors
ProtoFlux:Dot can be used to compare two ProtoFlux:Normalized vectors to see how close they are to each other.
The result is a float, with 1 being exactly the same and -1 being exactly the opposite.
In Game Tutorials
Interactive Vectors by AxiomWolf is an MMC 2026 world that teaches the fundamentals of vectors and has a great series of interactive tutorials that helps develop your understanding.
See Also
General nodes
- Category:ProtoFlux:Operators:Vectors - Nodes related to vectors.
- Component:ArrowMesh - This node takes a vector as an input and draws it.
- ProtoFlux:DebugVector - Visualise vectors.
In game uses for vectors
- Component:CharacterController - A major node that is used for physics.
- ProtoFlux:SetCharacterVelocity - The output of a lot of these examples can be used to drive this.
- ProtoFlux:ApplyCharacterImpulse - Useful for pushing character around.
- Category:ProtoFlux:Transform:Direction - Getting directions useful for vector inputs.
External resources
- https://docs.unity3d.com/2021.3/Documentation/Manual/VectorCookbook.html - A bunch of useful information on using it the context games.
- https://www.physicsbook.gatech.edu/Vectors - Some good theory coverage.
- https://en.wikipedia.org/wiki/Euclidean_vector - A deep rabbit hole.