operator *
Multiplies a vector by a number.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Operator
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
operator *(Vector4, float)
Multiplies a vector by a number.
public static Vector4 operator *(Vector4 a, float d)
Parameters
Returns
Type | Description |
|---|---|
| Vector4 |
Remarks
Multiplies each component of by a number .
adExamples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { // make the vector twice longer: prints (2.0,4.0,6.0,8.0) print(new Vector4(1, 2, 3, 4) * 2.0f); }}
operator *(float, Vector4)
Multiplies a number by a vector.
public static Vector4 operator *(float d, Vector4 a)
Parameters
Returns
Type | Description |
|---|---|
| Vector4 |
Remarks
Multiplies number by each component of .
daExamples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { // make the vector twice longer: prints (2.0,4.0,6.0,8.0) print(2.0f * new Vector4(1, 2, 3, 4)); }}