Place Kinematic Body 3D at position

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Liemaeu

I add my enemy with this in my game world:

var enemyscene = load("res://Enemy/Enemy.tscn")
var enemy = enemyscene.instance()
add_child(enemy)

He spawns in the middle of the world scene (at (0|0|0)). Is there a way so set the position?
enemy.position.x = 10, etc. doesn’t work for a 3D Kinematic Body.

:bust_in_silhouette: Reply From: mdubaisi

you can type:
enemy.global_position = (x, y, z)

If I type in e.g.:

enemy.global_position = (10, 10, 10)

It says:

Expected ‘)’ in expression

Liemaeu | 2020-07-19 18:14

But I can do

enemy.global_transform.origin.x = 10

etc.

Liemaeu | 2020-07-19 18:20