Skip to content

Commit

Permalink
Merge pull request #85 from RhapsodyInGeek/RhapsodyInGeek-Node2D-Cont…
Browse files Browse the repository at this point in the history
…rol-Support

Added support for Node2D and Control derived entities
  • Loading branch information
EMBYRDEV authored Oct 3, 2023
2 parents 2dfca82 + 77819ac commit df796a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions addons/qodot/src/nodes/qodot_map.gd
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,14 @@ func build_entity_nodes() -> Array:
var origin_comps = properties['origin'].split(' ')
var origin_vec = Vector3(origin_comps[1].to_float(), origin_comps[2].to_float(), origin_comps[0].to_float())
if "position" in node:
node.position = origin_vec / inverse_scale_factor
if node.position is Vector3:
node.position = origin_vec / inverse_scale_factor
elif node.position is Vector2:
node.position = Vector2(origin_vec.z, -origin_vec.y)
else:
if entity_idx != 0 and "position" in node:
node.position = entity_dict['center'] / inverse_scale_factor
if node.position is Vector3:
node.position = entity_dict['center'] / inverse_scale_factor

entity_nodes.append(node)

Expand Down

0 comments on commit df796a8

Please sign in to comment.