Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
if its before, (i.e. a lower x value) then we know it travelling left, if its after (a greater x value), we know its moving towards a point on the right side.
Im sure you could brute force this and check every tick if the position of the planes x value is greater or lesser than the previous tick.
then flip the sprite on the y axis like this...
var tempPos
func _ready():
tempPos = $sprite.position.x
func _process(delta):
if $sprite.position.x < tempPos:
$sprite.set_flip_v(false)
if $sprite.position.x > tempPos:
$sprite.set_flip_v(true)
tempPos = $sprite.position.x
play around with the "h" and "v" flip, depending on what you need
extends Path2D
onready var follow = get_node("PathFollow2D")
func _ready():
set_process(true)
func _process(delta):
follow.set_offset(follow.get_offset() + 350 * delta)
var tempPOS = int ( follow.get_pos().x)
if tempPOS > 669 :
get_node("PathFollow2D/Sprite").set_flip_v(true)
if tempPOS == 3 :
print ("CORRECTING FLIP!!!!!")
get_node("PathFollow2D/Sprite").set_flip_v(false)
But, it only works ever other time around the loop.. :/ But I am way closer to a solution than I was before. Thank you for your help on this.
-F