I have been using this code for the movement for a game, im a newbie so these errors are confusing for me, The error is cs1503 it says that “float” cant be converted to “int” pls help me because i dont know how to fix it.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class johnmovement : MonoBehaviour
{
public float Speed;
public float JumpForce;
If you’re not clear on the differences between floating point and integer numbers I’d strongly recommend any c# fundamental course. Just a few hours of fundamentals will equip you with enough information and insight to save literally thousands of hours in you future game development adventures.
I can’t tell what the error is because the code tags have also failed.
regarding further adventures on the forums please ensure that the code is easily decipherable so that education can be received.
We know from the error problem is simple but can’t sort out the line for you and farm the resulting like because it doesn’t look the same way as it is in the programming softwares.
Which is classifiable as inconsiderate regarding the comparative genius that you will not employ.
It says “you have made a typo” and it is telling you how to fix it.
Remember: NOBODY here memorizes error codes. That’s not a thing. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.
The complete error message contains everything you need to know to fix the error yourself.
The important parts of the error message are:
the description of the error itself (google this; you are NEVER the first one!)
the file it occurred in (critical!)
the line number and character position (the two numbers in parentheses)
also possibly useful is the stack trace (all the lines of text in the lower console window)
Always start with the FIRST error in the console window, as sometimes that error causes or compounds some or all of the subsequent errors. Often the error will be immediately prior to the indicated line, so make sure to check there as well.
All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.