Can't get position of child object(SOLVED)

Something strange happened. I can’t get position of child object. It returns position of parent go.

Code:

	self.bg_1_url = msg.url("/bg_1")
	self.bg_2_url = msg.url("/bg_2")
	print(self.bg_1_url)
	print(self.bg_2_url)
	print(msg.url())
	print(go.get_position(self.bg_l_url))
	print(go.get_position(self.bg_2_url))
	print(go.get_position(msg.url()))

Result(bg_1 is wrong):

DEBUG:SCRIPT: [INFO 23:51:42] none: /scenes/game/scripts/background_scroll_script.script:5: [game:/bg_1]
DEBUG:SCRIPT: [INFO 23:51:42] none: /scenes/game/scripts/background_scroll_script.script:6: [game:/bg_2]
DEBUG:SCRIPT: [INFO 23:51:42] none: /scenes/game/scripts/background_scroll_script.script:7: [game:/scroll#background_scroll_script]
DEBUG:SCRIPT: [INFO 23:51:42] none: /scenes/game/scripts/background_scroll_script.script:8: [0.000000, 0.000000, 0.000000]
DEBUG:SCRIPT: [INFO 23:51:42] none: /scenes/game/scripts/background_scroll_script.script:9: [320.000000, 0.000000, 0.000000]
DEBUG:SCRIPT: [INFO 23:51:42] none: /scenes/game/scripts/background_scroll_script.script:10: [0.000000, 0.000000, 0.000000]

That’s an L not a 1.

self.bg_l_url will evaluate to nil and thus give the current game object position

2 Likes

Lol :exploding_head:
Thanks =)

2 Likes

So auto code completion is so important.

1 Like