S&box Wiki

Vector3.SubtractDirection

Vector3.SubtractDirection

Syntax

Vector3 SubtractDirection( Vector3 direction, float strength = 1 )

Description

Given a vector like 1,1,1 and direction 1,0,0, will return 0,1,1. This is useful for velocity collision type events, where you want to cancel out velocity based on a normal. For this to work properly, direction should be a normal, but you can scale how much you want to sutract by scaling the direction. Ie, passing in a direction with a length of 0.5 will remove half the direction.

Arguments

Vector3 direction
float strength 1

Returns

Special Pages


Wikis

?

Render Time: 60ms

DB GetPage 48
Generate Html 0
SaveChanges (1) 8
Render Body 0
Render Sidebar 1