Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | sub889 | |
Old Version | Published before Godot 3 was released. |
Hello, I have a tileset in isometric mode, where I want to move a sprite along the isometric axis (which are rotated by 45 degrees, I assume). So, in order to achieve this, I increase the position by Vector2(1, 0.5) for example (right movement).
Take the isometric game example, I modified it as follows (just the right movement):
extends KinematicBody2D
const MOTION_SPEED = 160
func _fixed_process(delta):
var motion = Vector2()
if (Input.is_action_pressed("move_up")):
motion += Vector2(0, -1)
if (Input.is_action_pressed("move_bottom")):
motion += Vector2(0, 1)
if (Input.is_action_pressed("move_left")):
motion += Vector2(-1, -0)
if (Input.is_action_pressed("move_right")):
motion += Vector2(1, 0.5)
motion = motion.normalized()*MOTION_SPEED*delta
motion = move(motion)
func _ready():
set_fixed_process(true)
By doing this, however, the movement looks a bit odd, because it’s not very fluid. Do you know why this happens?
Thank you
Does it happen when moving at speed (2,1)
? If it doesn’t, then there is a rounding issue probably.
Bojidar Marinov | 2016-06-17 07:47
Yes, it does
sub889 | 2016-06-17 15:09