1. Hi. How can I bind an effect to an entity? Namely to BaseNpc? The screenshot shows how the bear runs and the effect lags behind it, because during the animation it does not move with the bear.
    Im use:
    Code:
    Effect.server.Run("assets/prefabs/locks/keypad/effects/lock.code.shock.prefab", Base.transform.position);
     

    Attached Files:

  2. Come on, Wolf, you now how to make it work ;)
     
  3. Make timer that will move ur effect
     
  4. The effect has an animation length of 1.5 seconds. In these 1.5 seconds it does not move, if I could move it during the animation, everything would be easier :(
     
  5. Wolf? U can help? u can close it if not know.
     
  6. .close();
     
  7. As far as I know this is impossible. Effects just runs at the desired position.......
    [DOUBLEPOST=1501153129][/DOUBLEPOST]But you can try this:
    Code:
    public static void Run(string strName, BaseEntity ent, uint boneID, Vector3 posLocal, Vector3 normLocal);
    I didn't work much with effects, but this possibly will attach the effect to the entity.
    And if it'll work - let me know, I'm curious=)
     
    Last edited by a moderator: Jul 27, 2017
  8. You can create a class to attach it to entity and update position using a void Update() into your class
     
  9. then how to attach it? Cos I have no idea. Can you provide an example?
     
  10. afaik you cannot "attach" or parent it to anything, as the Effect "Run" method is a void and does not return anything. Perhaps there is some weird method of getting the object that the effect is attached to but i cannot imagine it being very performance friendly.
     
  11. maybe create it as entity?
    Not sure if it work with code lock effect..., not tested

    Anyway you can follow position of the parent entity and run the effect is the Update()
     
    Last edited by a moderator: Jul 28, 2017
  12. Parrent entity? Parrent to what? Can you provide a working example?
     
  13. You can't move an effect because there is no reference returned for it

    Correct

    Code:
    Effect.server.Run(string strName, BaseEntity ent, uint boneID, Vector3 posLocal, Vector3 normLocal, Connection sourceConnection = null, bool broadcast = false)
    // strName = prefab path
    // ent = entity to attach to
    // boneID = bone number (most entities don't have bones so use 0)
    // posLocal = position offset relative to the entity
    // normLocal = not sure
    If the effect has an indefinite lifespan (smoke from smoke rocket for example), or you want to stop the effect before it has finished, then the only way to do that is to destroy the entity it is attached to
     
  14. So I was right? If the effect is attachet to the entity it will move with it, right? Never test this on my own tho =D