Closed zaknafean closed 3 years ago
Played with the demo more, this code is more correct then what I originally posted.
if p.get('rect_position') != null:
p.rect_position = global_position - node_to_place_products_into.global_position
else:
p.global_position = global_position
Thanks for your complete report. Working on it.
Note: you still need the - node_to_place_products_into.global_position
as that is relative to the SpawnPoint position.
Thanks for the fix
Yup seems including - node_to_place_products_into.global_position
is an even better solution. This code is working great for my needs
if p.get('rect_position') != null:
p.rect_position = global_position - node_to_place_products_into.global_position
else:
p.global_position = global_position - node_to_place_products_into.global_position
I have to release a new version but that needs #5 #8 and #10 first I guess ... what do you think?
The change looks good to me! I'll close up the issue.
Describe the bug After setting up the nodes for use, an error was thrown at line. For me changing the line 58 to what's below fixes the problem:
To Reproduce Steps to reproduce the behavior: 1) Configure the SpawnPoint2D node to use an 'enemy' with a base node of KinematicBody2D 2) Run the scene. KinematicBody2Ds lack a 'rect_position' field, so we trip up at line 58.
Screenshots If applicable, add screenshots to help explain your problem.
Device Info (please complete the following information): OS: Windows 10 Godot version: 3.2.3 godot_3_spawn_points version: master
Additional context This is a real time saver! Thanks for releasing it.