|
Post by Strider on Mar 2, 2017 9:05:50 GMT
Maybe it's too simple but i don't know if there's a script on invector or is something more "unity" basic, but, how can i call a prefab (for for example call a particle system when throwing a punch, or a cloud of dust when hitting the ground) in certain animations?
Thanks!
|
|
|
Post by Legion on Mar 2, 2017 13:13:09 GMT
|
|
|
Post by Invector on Mar 6, 2017 17:06:15 GMT
take a look into the hitbox of your character, there is a event painel over there that you can call anything. at the demo scene we call some sounds for punchs and stuff
|
|
|
Post by Strider on Mar 7, 2017 5:17:21 GMT
take a look into the hitbox of your character, there is a event painel over there that you can call anything. at the demo scene we call some sounds for punchs and stuff it's same panel in hit boxes and weapons right? the one used for calling collisions with v hit effects. So if i have a prefab spawner i can call it using the "v melee object"? gotta give it a try tomorrow! Thanks!
|
|
|
Post by sickscore on Mar 7, 2017 6:09:40 GMT
take a look into the hitbox of your character, there is a event painel over there that you can call anything. at the demo scene we call some sounds for punchs and stuff it's same panel in hit boxes and weapons right? the one used for calling collisions with v hit effects. So if i have a prefab spawner i can call it using the "v melee object"? gotta give it a try tomorrow! Thanks! Correct! Simple workaround: - Add a script like the following onto your character - Add a particle system to each arm transform (uncheck "Looping" and "Play on awake") - Assign the particle systems in the script - On your "vMeleeAttackObject" assign the "OnDamageHit(HitInfo)" event to the corresponding method Untested code: public class DamageHitParticles : MonoBehaviour { public ParticleSystem LeftHandParticles; public ParticleSystem RightHandParticles; // etc ...
public void OnDamageHitLeftHand (HitInfo hitInfo) { // Debug.Log (hitInfo.hitPoint); LeftHandParticles.Play (); }
public void OnDamageHitRightHand (HitInfo hitInfo) { // Debug.Log (hitInfo.hitPoint); RightHandParticles.Play (); }
// etc ... }
|
|
|
Post by Strider on Mar 8, 2017 7:03:19 GMT
ok... but i want to call a prefab in a frame of animation, not when colliding with anything or hitting, or dealing damage, just when reaching a certain frame and spawn the prefab in certain part of the body, not exactly a hitbox.
|
|
|
Post by sickscore on Mar 8, 2017 9:31:42 GMT
ok... but i want to call a prefab in a frame of animation, not when colliding with anything or hitting, or dealing damage, just when reaching a certain frame and spawn the prefab in certain part of the body, not exactly a hitbox. Oh, than just search for Animation events. docs.unity3d.com/Manual/AnimationEventsOnImportedClips.htmlLet me know, if you need further help. Currently not at home. Cheers, sickscore
|
|
|
Post by Strider on Mar 14, 2017 5:56:45 GMT
ok... but i want to call a prefab in a frame of animation, not when colliding with anything or hitting, or dealing damage, just when reaching a certain frame and spawn the prefab in certain part of the body, not exactly a hitbox. Oh, than just search for Animation events. docs.unity3d.com/Manual/AnimationEventsOnImportedClips.htmlLet me know, if you need further help. Currently not at home. Cheers, sickscore well, i have no further development of this, not really good at coding, at all.
|
|
|
Post by Strider on Mar 23, 2017 5:05:59 GMT
|
|