- Home /
mouselook offsety not found
Hi,
I recently updated unity to v3.4 and I started getting errors in scripts.
One of these errors is this:
MissingFieldException: Field 'MouseLook.offsetY' not found.
When I click it, it takes me to this code in gunscript.js:
function Kickback () {
mainCam.GetComponent("MouseLook").offsetY = kickbackAngle;
weaponCam.GetComponent("MouseLook").offsetY = kickbackAngle;
Any help please?
Did you check if that function exists in your $$anonymous$$ouseLook script?
I cant find the function. And also noticed that the mouselook script is c# script and the gunscript is javascript. Is it normal? Anyway what should I do to eli$$anonymous$$ate this error?
Answer by Statement · Dec 04, 2011 at 07:53 PM
See if the information about script compilation work for you.
This allows you to let different scripting languages interoperate. For example, if you want to create a Javascript that uses a C# script: place the C# script in the "Standard Assets" folder and the Javascript outside of the "Standard Assets" folder. The Javascript can now reference the C# script directly.
Basically, create a folder called "Standard Assets" and place your MouseLook.cs in there.
If it still doesn't work, make sure MouseLook has "offsetY" and not "OffsetY" or something similar. Check the spelling...
Your answer