I'm attempting spawning a scripted arrow using ll.RezObjectWIthParams
ll.RezObjectWithParams(projectile, {
REZ_PARAM, 0,
REZ_FLAGS, bit32.bor(REZ_FLAG_PHYSICAL, REZ_FLAG_DIE_ON_NOENTRY, REZ_FLAG_NO_COLLIDE_OWNER, REZ_FLAG_TEMP, REZ_FLAG_BLOCK_GRAB_OBJECT),
REZ_POS, projectilePosition, false, true,
REZ_ROT, avatarCameraRot, false,
REZ_VEL, vector(currentStance.Speed, 0.0, 0.0), true, false,
REZ_LOCK_AXES, vector(1.0, 1.0, 1.0),
})
When attempting to rez a non-scripted prim, the object_rez event is fired with little delay
[9:23 AM] zCS#Slua Bow#TEST-0.01: Object rezzed: daaf9d30-d42b-43bd-5467-f6e649d18b08
[9:23 AM] zCS#Slua Bow#TEST-0.01: Spawn time: 0.17778599995654076
[9:23 AM] zCS#Slua Bow#TEST-0.01: Object rezzed: ee6945cb-7234-2879-96bc-37900ec01782
[9:23 AM] zCS#Slua Bow#TEST-0.01: Spawn time: 0.17782800004351884
[9:23 AM] zCS#Slua Bow#TEST-0.01: Object rezzed: ba83213a-4c80-ce3e-a513-e550aed047d0
[9:23 AM] zCS#Slua Bow#TEST-0.01: Spawn time: 0.15552400005981326
However, when dropping in a script to the arrow (in this case the default Luau script) there is a delay in the script in the arrow becoming active along with the event.
[9:26 AM] zCS#Slua Bow#TEST-0.01: Object rezzed: a37f1021-6c51-4aab-a569-37dd55c26103
[9:26 AM] zCS#Slua Bow#TEST-0.01: Spawn time: 3.066867999965325
[9:26 AM] zCS#Slua Bow#TEST-0.01: Object rezzed: cc467eb3-5715-bfe9-e637-4e16ce34317e
[9:26 AM] zCS#Slua Bow#TEST-0.01: Spawn time: 3.066815000027418
[9:26 AM] zCS#Slua Bow#TEST-0.01: Object rezzed: 6ab801c0-43bd-4bed-6a68-f701f64d46d6
[9:26 AM] zCS#Slua Bow#TEST-0.01: Spawn time: 3.066683000070043
In the past, there was a similar problem when using Mono, so a lot of the time LSO was used for projectiles, however here I am trying to go full Luau.