|
Are you putting the code that calls the pickuprubish method in a loop?
I assume that the variables that are being passed to it are the coordinates from the character (0, 0 for the same location as the character) and the type of Actor that it should be looking for. From what you have written, it only seems that the character would pickup more than one piece of rubish from the world if:
1. The getOneObjectAtOffset method returned more than one object. From the name and the return type, I would think that it wouldn't. Or,
2. The pickuprubish method is called more than once (inside a loop of some sort.)
This might not be too helpful but it's all that I can see with the code that is given.
Good luck!
|