Error cs1501 unity3d

后端 未结 1 1339
不知归路
不知归路 2021-01-26 09:36

I\'m trying to make my character dodge when pressing a key, but I keep geting this error

CS1501: No overload for method Dodge\' takes2\' arg

相关标签:
1条回答
  • 2021-01-26 10:35

    You are calling the Dodge method by passing two arguments, for example: Dodge(DodgeDirection.Forward, dodge); but your method only asks for one:

    public void Dodge(DodgeDirection dir)
    

    So in order to solve this, you have two options:

    1. Pass only one parameter in the FixUpdate method.
    2. Add a second parameter on the method's signature.
    0 讨论(0)
提交回复
热议问题