- Home /
Question by
fpdotmonkey · Sep 04, 2017 at 02:46 PM ·
mathvectorvector2
Vector2 scalar multiplication issue
I'm having issues with scalar multiplication of a Vector2
. If I multiply a Vector2
by a single scalar, there are no problems. But if I multiply a Vector2
by multiple scalars, I get and error reading "Operator '*' cannot be applied to operands of type 'UnityEngine.Vector2' and 'double'". Is this a bug?
// example.cs Vector2 up = Vector2.up; float scalar1 = 2.0f; float scalar2 = 4.0f; Debug.Log(up * scalar1); // no issue Debug.Log(up * scalar1 * scalar2); // ERROR Debug.Log(up * (scalar1 * scalar2); // also ERROR
Comment
Your answer
Follow this Question
Related Questions
,How to get a percent of a line 0 Answers
CharacterController on Moving Surface 4 Answers
Dotted line bouncing on Unity 0 Answers
Having difficulty with Lerp 3 Answers
[HELP] Translating vector 2 co-ordinates to real space 1 Answer