Help with player movement on Unit 3 Lesson 27

I have two students working on their Unit 3 Lesson 27 game. They are using sprite backgrounds. They can get the player and target to show up on top of the sprite background but when we try to move the player there is an error. The code looks correct but the error says that the sprite name has not been defined yet.
What can be done to help this? (We did have to create the player and target in a function to make them show up on top of the backgrounds.)

@ahiggins,

Can you send us a shared link to look at?

Mike

[Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you. Feel free to delete everything in brackets before posting your request for debugging help.]
Link to the project or level: [replace with link to the curriculum or get the “Share” link to a project]
What I expect to happen: [replace with a detailed description of the behavior you’re trying to create]
What actually happens: [replace with a detailed description of what actually happens when the code runs including any errors or unexpected behavior]
What I’ve tried: [replace with a detailed description of what you’ve already tried to do to solve the problem]

@ahiggins,

That link isn’t shared. Can you try enabling sharing so we can see it?

One general item of feedback that could help, though. They should create the sprites outside of the draw loop (and outside of any functions called by the draw loop). If they don’t want it showing up yet, they can hide it by using the sprite.visible block (and setting it to false). Then, inside the loop, they could set it to be visible and I’m guessing that will solve this problem.

good luck!

Mike

Thank you, I will have them try that.