a
adrianmg

Variable target area

I've been able to export not only the rotation_factor but the shooting_rate as well as shown here:


For some reason, the target_area_radius works, but it ends up affecting both instance of my turrets at the same time, but they have different values in the scene:


Why is that happening just for this property, while the rest are working independently per instance?

Thanks!

  • Nathan Lovato replied

    This happens because you are changing the radius of a collision shape, which is a resource, and resources are shared in memory by default.

    So if you make two instances of a mob scene and change the radius of the collision shape on one instance, because the collision shape resource is shared between all instances, it will also change the radius on the other instance.

    To give a unique radius to each instance of your mob scene, open the mob scene, select the collision shape node, expand its shape property,  and ensure that the resource -> local to scene property has turned on. This will make the resource unique in each instance of the mob scene.


    1 love