Error From Abilities Script

After importing the Inventories package attached to the lesson, I get an error that wasn’t covered in the video:

Assets\Scripts\Abilities\Ability.cs(18,30): error CS0508: ‘Ability.Use(GameObject)’: return type must be ‘void’ to match overridden member ‘ActionItem.Use(GameObject)’

When I tried changing the Use() method from a bool return type to a void return type (commenting out the returns), I got an avalanche of errors. So did commenting out the method entirely. And also when I updated the ActionItem.Use() to be a bool return (returning True). Since the abilities module isn’t covered in this course, how do I correct for this until we get there?

1 Like

It looks like you started with the final version of the course repo instead of the version that is at the end of the Core Combat class… this is bound to cause more clashes since a lot of things were updated in the Inventory scripts as we went through the two courses after…

Ideally, if you’re using the course repo, it’s better to start from this commit, which was the final commit at the end of the Core Combat course.

For now, you can go into ActionItem.cs and change the return type to bool. Set the contents of the method to return false;

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms