Godot Version
4.7.2
Question
When i spawn enemys they all become big and i get a fat error with their move and slide reading:
E 0:00:01:052 normal.gd:39 @ _physics_process(): body_test_motion was passed an invalid transform along with body ‘%s’. This results in invalid scaling for shape at index %d. A scale of (51.363056, 12.658639, 63.848831) is not supported by Jolt Physics for this shape/body. The scale will instead be treated as (42.623508, 42.623508, 42.623508).
<C++ Source> modules/jolt_physics/spaces/jolt_physics_direct_space_state_3d.cpp:288 @ _body_motion_cast()
normal.gd:39 @ _physics_process()
This is the code i use to spawn the enemies, im new to godot so i may be missing something!
func _ready() -> void:
for WaveNum in range(1, 3):
var TableLayout = WaveLayouts["Wave "+str(WaveNum)]
for val in TableLayout:
print(str(val))
if typeof(val) == TYPE_STRING:
var mob = FindMob(val)
var newmob = mob.instantiate()
var random_x = randf_range(3, 5)
var random_y = randf_range(1, 1)
var random_z = randf_range(3, 5)
# Apply the random position to the node's transform
newmob.global_position = Vector3(random_x, random_y, random_z)
newmob.scale = Vector3.ONE
var plrpath = get_node("PlayerModel").get_path()
newmob.set("player_path", plrpath)
get_node("NavigationRegion3D").add_child(newmob)
print("spawned "+val)
elif typeof(val) == TYPE_INT:
await get_tree().create_timer(val).timeout