Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by Newbyscript · Feb 17, 2013 at 02:48 PM · error message

2 errors im stuck on.

Im trying to make a strategy camera from following a 1 year old tutorial that is using unity3 but im using unity4. Im getting this error for 2 lines: "No appropriate version of unity.MathF.SmoothDamp' for the argument list (float, System Object, float) was found" ERROR CODE:

 var lookSensitivity        :    float = 3;
 @HideInInspector
 var currentYRotation    :    float;
 @HideInInspector
 var    currentXRotation    :    float;
 @HideInInspector
 var yRotationV            :    float;
 @HideInInspector
 var xRotationV            :    float;
 @HideInInspector
 var    yRotation            :    float;
 @HideInInspector
 var xRotation            :    float;
 var cameraRotationSpeed    :    float = 0.5;
 var cameraTiltSpeed        :     float = 0.5;
 var maxCameraAngle        :    float =    40;
 var minimumCameraAngle    :    float = 50;    
 var lookSmoothDamp        :   float = 0.2;

 function Update () 
 {
     currentXRotation    =   Mathf.SmoothDamp(currentXRotation, xRotation.xRotationV, lookSmoothDamp);
 }


Also i have this error "The Type 'UnityEngine.Vector2.does not have a visible constructor that matched the argument list '(System.Object)'. ERROR CODE.

 var movementAccel            :    float    =    10000;
 var movementSlowDownSpeed    :    float    =    0.1;
 var movementSlowDownSpeedx    :    float;
 var    movementSlowDownSpeedz    :    float;
 
 var    cameraObj                :    GameObject;
 var    maxMovementSpeed        :    float     =     25;
 var    horizontalMovement        :    Vector2;    
 var maxSlope                        :       float = 90;
 
 function LateUpdate () 
 {
 horizontalMovement = Vector2(rigidbody.velocity.x.rigidbody.velocity.z);   
 }

I would be thankfull if anyone can share there knowledge on this and teach me how to fix it.

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tuhinbhatt · Feb 17, 2013 at 03:06 PM 0
Share

If you still have any doubts do leave them in the comments and i would glady help you

avatar image tuhinbhatt · Feb 17, 2013 at 03:10 PM 0
Share

and i would like to know that is currentXRotation and XRotation , xRotationV as well as lookSmoothDamp actually as i donot see any variables declared like that declared in your script.

Also you are using CurrentXRotation without declaring it first. You should declared it first outside function Update and then you can assign value to it.

avatar image Newbyscript · Feb 17, 2013 at 03:53 PM 0
Share

Sorry about the variables typo, now my variables im showing you above is correct.

Thanks for fixing the second error for me... I have a problem with the first one still though. are you saying i cannot use my variables in $$anonymous$$athF.SmoothDamp?

avatar image tuhinbhatt · Feb 17, 2013 at 04:03 PM 0
Share

$$anonymous$$athf.SmoothDamp always takes float arguments. So ofcourse you can use variables with it. The Variables should be of type float otherwise you will need to cast them to float.

You cannot use xRotation.xRotationV as this is not valid ins$$anonymous$$d just use one variable there. For example use only xRotation or use only xRotationV. And also $$anonymous$$athf.SmoothDamp takes four arguments at $$anonymous$$imum not three

Check the refrence doc here to get the more idea about $$anonymous$$athf.SmoothDamp http://docs.unity3d.com/Documentation/ScriptReference/$$anonymous$$athf.SmoothDamp.html

If still have any doubt do post as a comment

avatar image Newbyscript · Feb 17, 2013 at 04:53 PM 0
Share

Thanx for your help and time.

this is the script that worked.

  currentXRotation    =   $$anonymous$$athf.SmoothDamp(currentXRotation, xRotation,xRotationV, lookSmoothDamp);
 .z);

i had a full stop inbetween xRotation,xRotationV.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by tuhinbhatt · Feb 17, 2013 at 03:05 PM

Here is the solution of second error you are getting about Vector2

You are missing a comma in line 13 it should be

 horizontalMovement=Vector2(rigidbody.velocity.x,rigidboy.velocity.y); 

and not

 horizontalMovement = Vector2(rigidbody.velocity.x.rigidbody.velocity.z);

And For the error in MathF.SmoothDamp you are using this code

 Mathf.SmoothDamp(currentXRotation, xRotation.xRotationV, lookSmoothDamp);

There is mistake in your second argument that is xRotation.xRotationV. It should not be like that. Mathf.SmoothDamp takes this arguments actually

 Mathf.SmoothDamp(float current, float target, ref float current velocity,float smoothtime);

It actually also overrides with other two arguments they are

  Mathf.SmoothDamp(float current, float target, ref float current velocity,float smoothtime,float maxSpeed);

And

 Mathf.SmoothDamp(float current, float target, ref float current velocity,float smoothtime,float maxSpeed,float deltatime);

Do remember each and every argument in Mathf.SmoothDamp is float.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

errror message 1 Answer

unity say's: expecting :, found '='. 2 Answers

GUI.Box error 1 Answer

Strange error with unity. 1 Answer

Unity Pro trial crashing due to an asset 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges