While loops

whenever i try to run while loop, wick just crashes

Could you copy and paste the code to see what are you may be doing wrong in javascript?

just run any while loop and it will crash

Could you please provide the complete context?

My Project2-14-2022_18-42-30.wick (1.2 KB)

noooooooo
the other wick tabs crashed and i lost my game

uhh
what does it do

My Project2-14-2022_18-47-17.wick (1.8 KB)
im trying to make something like this

you can’t just do this…
Screen Shot 2022-02-14 at 10.46.05 PM

You are not allowing the program to exit from that while loop… you are putting a constant of true… you are saying basically… while true is true do a+=1.

Since true is always true and it will always be… your Update code is stuck in that while loop… In that case the while is absolutely unnecessary. Just leave a += 1, and it will iterate increasing from one to one on every single frame…

so how do i do this without a while loop

Do you know that the update tab runs every single frame? You don’t need this…

Just do this…

So your update tab is your “loop”

but i want it to move there instantly

Oh that is different… and more complicated to do… not impossible though…

soooo
how do i do it

It requires more logic… you can’t do it like that… Could you tell me under what scenario you want that to work? Why you just don’t put the object next to the other ? You have already the X coordinate of both…

if you can move them around

Sorry I can’t understand. If you want people to jump and provide alternatives to you, you should be able to describe what you want to accomplish in a more detailed matter.

have a level
something needs to move as far as it can without hitting a wall

sooo
is it impossible?