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);
Solved Making effect follow an entity?
Discussion in 'Rust Development' started by Persik3D, Jul 21, 2017.
-
Attached Files:
-
-
Come on, Wolf, you now how to make it work
-
Make timer that will move ur effect
-
-
Wolf? U can help? u can close it if not know.
-
.close();
-
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);
And if it'll work - let me know, I'm curious=)Last edited by a moderator: Jul 27, 2017 -
You can create a class to attach it to entity and update position using a void Update() into your class
-
-
-
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 -
-
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
-