You can also simply call vector(), that being whatever you've chosen to name the module. Functions vector.new(x, y) Returns a new Vector object with the given x and y values, or 0 if not given.
An angle can be created using the 'Angle (Pitch, Yaw, Roll)' command I'm trying to calculate the angle at which an object is thrown, How can I apply the formula in Lua.
In this video you will learn:-pitch(),yaw(),roll()-ang()-entity()-owner()-pos()-angles()-Tips on using the debugger and datatype syntax=.ĭescription: Spawn a portalrift effect (Example should be used within a SWEP for 'self.Owner' to mean anything) Used on: Code // Spawn a portalrift effect normal to the player's aim vector (parallel with the // player's Up vector) AND FACING the player (that's why we need to rotate the angle ) ) // vAngle is the player's aim vector local vAngle = self.Owner:GetAimVector // Some screwed up. This is because the roll describes the rotation around the axis - the vector is just an axis = Related Links/Resources: = None =. The roll of the returned angle will always be zero when using this function. The vector doesn't need to be normalized.