I have an alien object, a spawner attached, which shoots alien bullets:
Graphic = AlienGraphic
Rotation = 0 ~ 360
Position = (0,10,0) ~ (800, 10, 0)
Body = AlienBody
Spawner = AlienBulletSpawner
PartList = AlienBodyPart
Type = box
Object = AlienBulletObject
WaveSize = 1
WaveDelay = 1
Position = (0, 0, 0)
;UseRotation = true
;UseRelativeSpeed = true
UseSelfAsParent = true
Graphic = AlienBulletGraphic
Speed = (0, 250, 0)
LifeTime = 2
Body = AlienBulletBody (not listed)
;UseParentSpace = true
Using "UseSelfAsParent = true" in the AlienBulletSpawner almost does what I want, which is to have the bullet shoot in the direction that the alien is facing.
But because the bullets are now true children of the parent, as the alien spins, the bullets continue to circle around the parent.
What I want to do is have the bullet take the rotation and position of the spawner, then go on their merry way in the last known direction the spawner was facing.
I tried conbinations of:
UseRotation = true
UseRelativeSpeed = true
...for the spawner, and while they inherited the rotation, the direction/speed vector was not used. (0, 250, 0) is always used.
Tried "UseParentSpace = true" on the bullet object, but no improvement.
UseRelativeSpeed = true spanwer doc states: "If true, speed will be applied relatively to current spawner rotation & scale."
Anyone got ideas here? Is this a bug?
However, you also need to override the object's speed at the spawner level with the ObjectSpeed property, which is the part I think you're currently missing.
So, the point is you get all the global properties and then set them as local properties and then detach from the parent.
Speed shouldn't be necessary though, as detaching the object shouldn't alter it, ie. speed is always stored globally internally.
I am trying to think from an educational/beginner's point of view which is the more straight forward.
I have tracks replacing some spawners where it is so incredibly simple, but in the case of a rotating shooting object, a spawner seems easier and more configurable.