You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just tried gave ImagineEngine a try and followed the Walkabout tutorial. Somehow I'm seeing weird behavior, when I click on a horizontal axis right of the player (see attached gif). Sometimes, the player just jumps to the top-left corner of the scene.
To be sure that this isn't a bug caused by me, I copied the content of FinalCode.swift and it still happens.
Afterwards I modified the code to print some stuff:
events.clicked.observe { _, point in
+ print("click: \(point)")
moveToken?.cancel()
let speed: Metric = 100
let horizontalTarget = Point(x: point.x, y: player.position.y)
let horizontalDuration = TimeInterval(abs(player.position.x - point.x) / speed)
let verticalTarget = Point(x: point.x, y: point.y)
let verticalDuration = TimeInterval(abs(player.position.y - point.y) / speed)
moveToken = player.move(to: horizontalTarget, duration: horizontalDuration)
.then(player.move(to: verticalTarget, duration: verticalDuration))
.then(player.playAnimation(idleAnimation))
+ .then { print("horizontalTarget: \(horizontalTarget), verticalTarget: \(verticalTarget), player.position: \(player.position)") }
}
This are the print statements when the bug occured:
Somehow the position of the player is (16.0, 23.0) when it should be (506.0, 309.5) 🤔
Its quite easy to reproduce by clicking top-left of the player and then twice on the right side of the player as in the gif and seen in the logs.
The text was updated successfully, but these errors were encountered:
Hi!
I just tried gave ImagineEngine a try and followed the Walkabout tutorial. Somehow I'm seeing weird behavior, when I click on a horizontal axis right of the player (see attached gif). Sometimes, the player just jumps to the top-left corner of the scene.
To be sure that this isn't a bug caused by me, I copied the content of
FinalCode.swift
and it still happens.Afterwards I modified the code to print some stuff:
This are the print statements when the bug occured:
Somehow the position of the player is
(16.0, 23.0)
when it should be(506.0, 309.5)
🤔Its quite easy to reproduce by clicking top-left of the player and then twice on the right side of the player as in the gif and seen in the logs.
The text was updated successfully, but these errors were encountered: