Projectiles cant have parent objects?

Spawning a projectile and trying to set its parent to another spawned assets returns an error:

local obj1 = script:GetCustomProperty("template1")
local obj2 = script:GetCustomProperty("template2")

local parentObj = World.SpawnAsset(obj2)
local projectileObj = Projectile.Spawn(obj1,script.parent:GetPosition(),Vector3.New(1,0,0))

projectileObj.parent = parentObj
  • attempt to index (set) nil value "parent" on Projectile (bad (misspelled?) key name or does not exist)

The core documentation shows it should at least be possible with two non-projectiles:

local propCubeTemplate = script:GetCustomProperty("CubeTemplate")
local cube1 = World.SpawnAsset(propCubeTemplate)
local cube2 = World.SpawnAsset(propCubeTemplate)

cube2.parent = cube1

Hey, SausageChamp! Projectiles are actually their own type, separate from CoreObject. They cannot have parents, but due to their nature as short-lived objects flying around the scene, they generally shouldn't need one. What is it that you're trying to achieve by giving it a parent?

Thanks for the info!

I wanted to make simple, smooth and constant speed projectile that spirals outwards from the starting point. I tried using Quaternion to change the velocity direction, but It just always steered slightly off course.

An object moving in a straight line in local space inside a spinning parent object looks nice, so I think I'll try making my own projectile using a trigger/collider.