C# Error: Best Overloaded method for Vector3

Problem:

error CS1502: The best overloaded method match for `UnityEngine.Vector3.Vector3(float, float, float)’ has some invalid arguments

Example:
Gizmos.DrawCube(transform.position, new Vector3(0.5,0.5,3.0));

Explanation:
In order to explicitly declare that 0.5 is a float, you must include the f modifier.

Solution:

Gizmos.DrawCube(transform.position, new Vector3(0.5f,0.5f,3.0f));

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: