godot_trailmesh icon indicating copy to clipboard operation
godot_trailmesh copied to clipboard

Unwanted initial emission point location

Open troykinsella opened this issue 4 months ago • 2 comments

Firstly, this plugin is exactly what I was looking for, so thanks very much for making it!

I am noticing what may be a bug regarding the positioning of the initial emission point of a new TrailEmitter. Or, it may be a misconfiguration on my part, but either way, I'd appreciate your input.

My use case is that I have a projectile RigidBody3D (an apple), which is the direct parent of a TrailEmitter. I want my character (the cylinder) to throw the apple, and show a visual trail of the apple's flight. However, I can't seem to avoid the initial trail point being outside the flight path, as per this screen cap:

image

As soon as my projectile is instanced and added to a parent container node, I am immediately setting its global transform origin. The rigid body is then emitted from the correct "spawn point" and takes the expected flight path. But, as seen, the trail does not start at where the projectile entered the world.

I have tried the following to no avail:

  • Setting processing to false on the TrailEmitter until after the projectile has been instanced, positioned, and forces applied.
  • Omitting TrailEmitter from the projectile scene, and then only instancing a PackedScene of the TrailEmitter and adding it as a child of the projectile after forces are applied, etc.
  • Initially setting Update Interval to 0, and restoring to 0.1 after flight.

Here are some more details about my setup:

image

image

The MRE of how I'm creating and throwing the projectile is like this:

var apple := FRUIT_SCENE.instanciate() # This is the `fruit` RigidBody3D scene as above.
container.add_child(apple)
apple.global_position = <the position of the player's arm>
apple.apply_central_impulse(direction * force)

The fruit.gd script (attached to the fruit RigidBody3D) is not doing anything interesting with the TrailEmitter child after that.

Any sense of what I might be doing wrong, here?

I'm using Godot 4.2.1 stable and downloaded this plugin from the AssetLib today.

Thanks.

troykinsella avatar Feb 26 '24 05:02 troykinsella