My project is bugged!

1 sentence description of the problem:
When i use the variables in hopscotch it doesn’t work
Steps to reproduce the problem every time:
(Start in a blank draft if possible)

1.make a project
2.make a character and when you tap it you get points
3.make a text that displays the points

I expected this to happen:
For it to display the points correctly
But instead this happened:
It stayed at 0 even when i tapped it
Screenshots/video:
(Include project link if relevant)



Device details:

(You can go to :gear: > “About”, and take a screenshot

8 Likes

Hello again rosewood! It seems like you used a local variable. Local variables cannot be used between different objects. In this example, you should be using a game variable. I’ll insert an image below so you can understand more clearly :))

6 Likes

Thanks!!! You’re a lifesaver! I’m new to coding and I don’t yet understand know how variables works so yeah :sweat_smile:

8 Likes

Local variables are variables that are scoped to a specific object or container, and will only work within that container

Object variables are variables whose values are unique to the object (but can still be used by other objects and can see other object’s value)

Game variables are variables that are global to the project

User variables (advanced mode only) are variables that persist between plays. They are unique to the device they were set on.

5 Likes

Do object variables work with clones?

6 Likes

yes but you can’t reference them with anything except that specific clone

5 Likes

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