Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Scale

Multiplies two vectors component-wise.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

Scale(Vector3, Vector3)

Multiplies two vectors component-wise.
public static Vector3 Scale(Vector3 a, Vector3 b)

Parameters

The first vector to multiply.

The second vector to multiply.

Returns

Type

Description

Vector3A component of
a
multiplied by the same component of
b
.

Remarks

Every component in the result is a component of
a
multiplied by the same component of
b
.

Examples

// Calculate the two vectors generating a result.// This will compute Vector3(2, 6, 12)using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ void Example() { print(Vector3.Scale(new Vector3(1, 2, 3), new Vector3(2, 3, 4))); }}

Scale(Vector3, Vector3)

Multiplies two vectors component-wise.
public static Vector3 Scale(in Vector3 a, in Vector3 b)

Parameters

The first vector to multiply.

The second vector to multiply.

Returns

Type

Description

Vector3A component of
a
multiplied by the same component of
b
.

Remarks

Every component in the result is a component of
a
multiplied by the same component of
b
.

Examples

// Calculate the two vectors generating a result.// This will compute Vector3(2, 6, 12)using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ void Example() { print(Vector3.Scale(new Vector3(1, 2, 3), new Vector3(2, 3, 4))); }}

Scale(Vector3)

Multiplies every component of this vector by the same component of
scale
.
public void Scale(Vector3 scale)

Parameters

scale

The vector to multiply by.

Scale(Vector3)

Multiplies every component of this vector by the same component of
scale
.
public void Scale(in Vector3 scale)

Parameters

scale

The vector to multiply by.