Ok i created an ability that adds behavior to unit that reduces taking damage, unit's model is marine with attached shield, how i can make shield go in front of marine when behavior is on? and go back when its off?
Edit the marine in 3ds max , make animation how is marine holding the shield in front of,
Then just add that marine model into your map, set when behaviour <behaviour> is on, then play animation, when the behaviour is off, then clear animation.u
If the shield is part of the model, either said model already has the apropriate animations or you'd have to create them in a 3D modeling program (not possible within the SC2 editor!)
If the shield is a separate model hosted on a ModelAddition actor or something similar it can be done, but will require some trickery with Actors. Read up several tutorials on Hosting and Site Operations if you're not familiar with them.
I don't have any ready-made solutions handy, but hosting the attachment on a Site actor should allow you to control movement and rotation more easily. I know 2D movement is possible using MoverMove events (the Colossus beam weapon does this) and SOpRotator allows constant rotation around a fixed axis, but off the top of my head I don't recall any "turn towards point" SiteOp.
For a quick hack you can try the HostSiteOperationsSet actor event to apply an SOpExplicitRotation (and maybe offsets etc.), this will instantly switch the shield position. Then remove the SOps when the buff ends. If that doesn't work you can achieve the same by copying the actor and applying the SOps to the copy, then destroying one copy and creating the other based on the buff state.
Actually moving the shield between the two positions in a way that looks smooth, "natural" and non-glitchy will be extremely difficult from what I know on this subject.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Ok i created an ability that adds behavior to unit that reduces taking damage, unit's model is marine with attached shield, how i can make shield go in front of marine when behavior is on? and go back when its off?
If the shield is part of the model, either said model already has the apropriate animations or you'd have to create them in a 3D modeling program (not possible within the SC2 editor!)
If the shield is a separate model hosted on a ModelAddition actor or something similar it can be done, but will require some trickery with Actors. Read up several tutorials on Hosting and Site Operations if you're not familiar with them.
I don't have any ready-made solutions handy, but hosting the attachment on a Site actor should allow you to control movement and rotation more easily. I know 2D movement is possible using MoverMove events (the Colossus beam weapon does this) and SOpRotator allows constant rotation around a fixed axis, but off the top of my head I don't recall any "turn towards point" SiteOp.
For a quick hack you can try the HostSiteOperationsSet actor event to apply an SOpExplicitRotation (and maybe offsets etc.), this will instantly switch the shield position. Then remove the SOps when the buff ends. If that doesn't work you can achieve the same by copying the actor and applying the SOps to the copy, then destroying one copy and creating the other based on the buff state.
Actually moving the shield between the two positions in a way that looks smooth, "natural" and non-glitchy will be extremely difficult from what I know on this subject.