0 votes

I was doing a shooter game mockup and was implementing the fire property of the weapons.

Then I got huge lag spike when the "instance" method was called, even with call_defered.

This one is very easy de reproduce:

  1. Make a simple bullet scene containing only one Node of type MCGMesh with a Capsule mesh.
  2. Make a main scene with the follow script :

    onready var bullet_scene = preload("res://bullet.tscn") func _input(event): if Input.is_action_just_pressed("ui_left"): bullet_scene.instance()

And you'll see that in the profileur the "Physic time" goes up to 200/300 ms with cause the lag spike

The work around is to use a CubeMesh instead of the Capsule Mesh.

Do you have any idea why it does that ??

in Engine by (53 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.