Error in code , please help
Go to solution
Solved by WiiManic,
37 minutes ago, Aleksa Djordjic said:Assets/Scripts/PlayerShoot.cs(53,31): error CS1503: Argument `#1′ cannot convert `float’ expression to type `int’
That means line 53, column 31 is where the error is.
If you look in your code there, you can see there is "_player.RpcTakeDamage(_damage);".
Argument 1 means the first thing you have passed to "_player.RpcTakeDamage", so "_damage" is the problem.
It can't convert it from a float to an int, so, "_damage" is a float, but it is supposed to be an int.
Once you change _damage to be an int, or _player.RpcTakeDamage to accept a float instead, that should work fine.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now