x


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?

more ▼

asked Dec 04 '11 at 01:56 PM

sub0 gravatar image

sub0
36 9 9 10

Did you check if that function exists in your MouseLook script?

Dec 04 '11 at 01:59 PM Rabwin

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 eliminate this error?

Dec 04 '11 at 02:07 PM sub0

Any answer????

Dec 04 '11 at 06:44 PM sub0
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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...

more ▼

answered Dec 04 '11 at 07:53 PM

Statement gravatar image

Statement ♦♦
20.1k 35 70 175

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3327
x162
x37

asked: Dec 04 '11 at 01:56 PM

Seen: 695 times

Last Updated: Dec 04 '11 at 07:53 PM