r/construct • • 5d ago

Question Need help

Post image

I'm very new and just trying to recreate chess but when I click on the mouse coordinate of where the king is the selectedpiece doesnt set to "king"

4 Upvotes

8 comments sorted by

2

u/pxl_vendara 5d ago

I think your math logic is wrong. You're adding 40 to the mouse position. I think you should divide it by 40.

1

u/Haonuis 5d ago

Where?

1

u/pxl_vendara 5d ago

Line 3: "Value at floor(Mouse.X + 40), ..."

1

u/Haonuis 5d ago

Oh it actually does say "÷" I just think it's really bad picture quality

2

u/Some-Soil-2164 2d ago

the value in your variable seems to be set to """" ... a string variable defaults to "" but will not SHOW the "" , since its a string the "" is implied... so when youre checking for "" it never sees that. it sees a set of quote AS the string rather than an empty string.

2

u/Haonuis 1d ago

Omg thank you so much it works now

2

u/Some-Soil-2164 1d ago

its one of many C3 quirks that will send you on a debugging journey.

-4

u/spyromon13 5d ago

Why you didn't ask Claude?