Jump to content

Particle effects


Recommended Posts

Quick question.

I have set up, in Unity, a KSPParticleEffect on a GameObject that is a child of my part. I am using a KSP/Particles/Additive shader. My particle is a simple PNG with transparency that I have included in my part's folder.

Everything works fine in unity, but when I go to KSP, no particle effects. When trying to find them programatically (via part.GetComponentsInChildren<KSPParticleEmitter>) I get nada.

Any thoughts? I assume there's something small and somewhat silly that I am missing.

Link to comment
Share on other sites

odd... should work. BDArmory does the same thing for the muzzle flash. maybe take a look at the .50cal turret sample unitypackage?

how do you check for things in game programatically? is there a command console in KSP that I don't know of?

Link to comment
Share on other sites

Just a quick code check (Same code works for my particle emmitter with ART which is why I expect I am doing something silly)

public override void OnAwake()

{

print("[uSI] Setting up Emitters");

var emmitters = part.GetComponentsInChildren<KSPParticleEmitter>(true).ToList();

foreach (var e in emmitters)

{

print("Enabling " + e.name);

e.emit = true;

e.enabled = true;

}

}

Link to comment
Share on other sites

If you are starting emission from code, you might want to try part.force_activate(); in the OnStart method.

Sometimes, part modules wont get initialized until a part gets 'staged'.

I had to do this for almost every PartModule in BDArmory.

Link to comment
Share on other sites

If you are starting emission from code, you might want to try part.force_activate(); in the OnStart method.

Sometimes, part modules wont get initialized until a part gets 'staged'.

I had to do this for almost every PartModule in BDArmory.

Thanks - tried it, no luck :(

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...