Click here to Skip to main content
15,444,824 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Errors

1/Cannot implicitly convert type 'Float' to 'float'

2/'object' does not contain a definition for 'x' and no accessible extension method 'x' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)

3/'object' does not contain a definition for 'y' and no accessible extension method 'y' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)

4/'object' does not contain a definition for 'z' and no accessible extension method 'y' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]




C++
void ProcessRotation()
{
    float horizontalLookInput = inputManger.horizontalLookAxis;
    Vector3 playRotation = transform.rotation.eulerAngles;
    transform.rotation = Quaternion.Euler(new Vector3(playerRotation.x, playerRotation.y + horizontalLookInput * lookSpeed * Time.deltaTime, playerRotation.z));
}


What I have tried:

tried everything and im still beginner ;-;
Posted
Updated 29-Jun-21 22:52pm
v2
Comments
Richard Deeming 30-Jun-21 3:39am    
That's not CSS or CCS. From the errors, I suspect it may be Java. But there's nowhere near enough information here for anyone to help you.
Richard MacCutchan 30-Jun-21 4:10am     CRLF
"tried everything and im still beginner" Then I suggest you throw that code in the bin as it is not a good example for a beginner. Get a good book on the language you are trying to learn (C#, C++, Java ??) and start from the beginning.
Shoory 30-Jun-21 13:55pm     CRLF
im student at game devalopment and in beginner classs of (Scripts) and i type same as the teacher types and looks fine with him but idk why i get those errors in Microsoft Visual i tried everything as i tried retype it and update but still the error not gone :/ i just want to know what the issue is it from program is it something , i hope im not bother
Richard MacCutchan 1-Jul-21 4:05am     CRLF
"I type same as the teacher" I guess that is not true. The chances are that your problem is that you are not using the correct case in your field names. The first message suggests that the call to inputManger.horizontalLookAxis returns an object of type Float, with a capital F, but you are trying to store it in a variable of type float with a small f. And the message is telling you that the two types are not the same. Similarly with the properties , you are using x, y and z, but you should be using the upper case versions X, Y and Z.
Shoory 1-Jul-21 4:56am    
thank you , for help i already fixed by own ^^

1 solution

That code doesn't show the error you describe: it doesn't contain any code that obviously returns a "Float" so we really can't help much.

But ... C++ is case sensitive: "Float" is not the same as "float" - so it's possible that something is declared as a "Float" (whatever that is) that should be declared as "float".

Double click the first error message in Visual Studio, and it'll take to you the line of code it doesn;t like. Look closely at it, and the lines above and see if you can spot anything obvious. This is something you need to get used to doing on your own - because you are going to have to fix a lot of syntax errors and getting others to do it for you is just going to take forever! :laugh:

When you've fixed that, compile again. If there is another error, fix that. Repeat!

But I do have to agree with Richard MacCutchan: if you can't fix basic syntax errors yourself, you shouldn't be playing with complicated code at all - you need to learn the basics and acquire at least a minimal skill set (design, code, syntax fixing, debugging) before you do or you will just end up getting more and more frustrated.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900