My goal is to have the player build walls for a tower defense-style game.
But I don't get why Mouse.MovementX will not send a number to Set Width To.
Maybe an integer is needed, maybe Mouse.MovementX does not work the way I think it does?
Any suggestion or direction would help.
Develop games in your browser. Powerful, performant & highly capable.
MovementX expression only works with mouse pointer lock (useful in 3D games).
What you need here is save click position in a variable
| Global number clickedX = 0
+ Mouse: On Left button Clicked
-> System: Create object Sprite on layer 0 at (Mouse.X, Mouse.Y), create hierarchy: False
-> System: Set clickedX to Mouse.X
+ Mouse: Left button is down
+ Sprite: Sprite = 0
-> Sprite: Set width to Mouse.X-clickedX
If your game is grid-based, I suggest using a tilemap instead, and draw walls on the tilemap.
Thank you, I'll give it a try.