I'm trying to do something like the infestor's ability to launch eggs that morph into infested terrans, but instead make it a passive periodic behavior that launches eggs in the direction the unit is facing and instead of having them morph into infested terrans, make a delayed explosion like a grenade.
I have a behavior that runs a periodic effect. The effect is a create persistent effect with the field Target - Offset Expire set to (-3,-3) and the field Expire Effect set to the Launch Missile Effect. The Launch Missile's effect has the field Impact Location set to Target Point, the Source Location set to Caster Unit, and I have the Impact Effect set to an effect that creates a baneling.
When I test this, the missile is launched and always creates a baneling to the bottom left of the unit regardless of where the unit is facing. What I want is to have it so the missile is always launched and ends up in the direction the unit is facing.
I also tried setting the Impact Offset field in the Launch Missile effect instead of the Offset in the persistent effect, but that just creates banelings at my unit.
here you go. I wrote a little map. Open it and move the zealot. Then press left mouse button and the other unit will move in front of the zealot. If I understood you right, you wanted to do something like that.
I appreciate the attempt, but you didn't understand the effect I'm trying to create. I'm trying to make a behavior that periodically launches a grenade in the direction a unit is facing. I want it to look like the infestor's ability to launch eggs, but instead of being an ability, I want it to be a behavior that runs on its own. And instead of the eggs turning into infested terrans, I want them to explode after a small delay.
I've been able to do everything, except get the egg to launch in the right direction. My problem is that the target point the egg is launching to is based on absolute coordinates rather than relative to the direction the unit is facing.
The basic problem is that a periodic effect fired from a behavior cannot specify a target point, and without a second point of reference, the create persistent effect defaults to using the default orientation instead of the source unit's facing. The Offset Facing Fallback field should allow you to fix this but it either does something else or doesn't work at all (at least in my testing.)
That will allow you to hook a trigger whenever the behavior's period expires. Then in the trigger you can calculate the correct target point for the effect based on the unit's facing and then use the Create Effect At Point action to create your actual effect.