Hello I’m building a game in Gimkit Creative and I want to track how far a player has moved horizontally from their starting point (like along the X axis, not height). I’m not sure how to measure this in-game or if I need to use a specific device. Is there a way to constantly check and store the player’s horizontal movement distance?
yes use the player coordinate device and make it update a property for the x value
wait how we use it to display the distance traveled in leaderboard and explain how to make it work
Got you @ProPlayer95
-
Add a Player Coordinates device: . Place a Player Coordinates device in your scene.
-
Create properties: . Add two properties: one to store the player’s current X coordinate (e.g., “MyX”), and another to store the reference X coordinate (e.g., “ReferenceX”). Make both properties number types.
-
Link properties to device: . Connect the “X” value from the Player Coordinates device to the “MyX” property and set the reference X coordinate to the “ReferenceX” property.
-
Set the reference X coordinate: . You’ll need to manually set a value for the “ReferenceX” property, which will be the coordinate you’re measuring distance from. This could be the start of a level, or any other point of reference in your map.
-
Calculate distance: . Use the “When receiving on channel” block with a trigger to update the distance. Within this block, set a variable called “Distance” and calculate it using the formula: Distance = (Get Property “MyX”) - (Get Property “ReferenceX”).
-
Display the distance: . Optionally, you can display the calculated distance using a “game overlay”.
To track a player’s horizontal distance in Gimkit Creative, you can use the “Player Coordinates device” and a property to store the player’s X coordinate. Then, calculate the distance between the player’s current X coordinate and a reference X coordinate using the formula: distance = current X - reference X. @ProPlayer95
This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.