Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Multiplying Vector2 value from another script?

$
0
0
So I am attempting to multiple a single variable from a Vector2 from another script than the one that calls the Vector2. Now I know how I would go about multiplying the entire vector, however I am having trouble just multiplying the x value of the Vector. Here is the script: function OnMouseDown() { object1.GetComponent("TestScript").testingvector = Vector2.x * -1; } And I am recieving this error when using it: BCE0020: An instance of type 'UnityEngine.Vector2' is required to access non static member 'x'. What would I need to do?

Viewing all articles
Browse latest Browse all 7934

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>