Announcement

Collapse
No announcement yet.

Spawn Niagara particle?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Spawn Niagara particle?

    Simple question, what is the Niagara equivalent of this?
    Code:
    UGameplayStatics::SpawnEmitterAtLocation(world, particle, transform);
    Just trying to spawn 1-time effects (like explosions) in the world without having a component. Can't find any way to spawn niagara emitters.

    #2
    Code:
    UNiagaraFunctionLibrary::SpawnSystemAtLocation(...)
    Able Ability System - A high performance, robust ability system for UE4. Now Available!

    Comment


      #3
      Thankyou

      Comment


        #4
        Originally posted by ExtraLifeMatt View Post
        Code:
        UNiagaraFunctionLibrary::SpawnSystemAtLocation(...)
        Hey how does this work?

        #include "NiagaraFunctionLibrary.h"

        gives me the error:
        Cannot open include file: 'NiagaraFunctionLibrary.h': No such file or directory

        I tried adding:
        #include "Niagara/NiagaraFunctionLibrary.h"
        #include "Plugins/Niagara/NiagaraFunctionLibrary.h"

        Same error. I'm not sure what I'm doing wrong?

        Comment


          #5
          Originally posted by axelZellalex View Post

          Hey how does this work?

          #include "NiagaraFunctionLibrary.h"

          gives me the error:
          Cannot open include file: 'NiagaraFunctionLibrary.h': No such file or directory

          I tried adding:
          #include "Niagara/NiagaraFunctionLibrary.h"
          #include "Plugins/Niagara/NiagaraFunctionLibrary.h"

          Same error. I'm not sure what I'm doing wrong?
          Do you have the plugins turned on?

          Comment


            #6
            Yeah they're turned on, and I can access in the content assest window.
            Do i need to change something in my VS project?

            Comment


              #7
              Oh, did you add it to your .uproject?

              {
              "FileVersion": 3,
              "EngineAssociation": "4.25",
              "Category": "",
              "Description": "",
              "Modules": [
              {
              "Name": "MaulProto",
              "Type": "Runtime",
              "LoadingPhase": "Default",
              "AdditionalDependencies": [
              "Core",
              "Engine",
              "ProceduralMeshComponent",
              "RenderCore",
              "RHI",
              "PhysicsCore",
              "Text3D",
              "Niagara"
              ]
              }
              ],

              Comment


                #8
                Originally posted by nullterm View Post
                Oh, did you add it to your .uproject?

                {
                "FileVersion": 3,
                "EngineAssociation": "4.25",
                "Category": "",
                "Description": "",
                "Modules": [
                {
                "Name": "MaulProto",
                "Type": "Runtime",
                "LoadingPhase": "Default",
                "AdditionalDependencies": [
                "Core",
                "Engine",
                "ProceduralMeshComponent",
                "RenderCore",
                "RHI",
                "PhysicsCore",
                "Text3D",
                "Niagara"
                ]
                }
                ],
                AH! I didnt.. I dont remember seeing this ANYWHERE in the docs lol
                I googled and click through so many Unreal "welcome to niagara" stuff - but they all seemed BP related
                Is there a bit I'm missing to see an example of a c++ version of this?

                Is it normal, that my AdditionalDependencies only has "Engine" ? I see youve got Core, for example...

                Also, how do I know when I need to add to this array?
                Is this separate (or does it allow for more) #include xyz?
                Is there an obvious part of the docs I can keep an eye out for?


                Sorry last question.
                VS compiles fine now.
                But my "#include "NiagaraFunctionLibrary.h"" has a red squiggle under it with "cannot open source file".
                And when i write the codes:
                Code:
                UNiagaraFunctionLibrary::SpawnSystemAtLocation();
                Red squiggle under "UNiagaraFunctionLibrary" and saying "name followed by '::' must be a class or namespace name"

                I assume these are related, and not actually an issue, just my VScode being funky?

                Cheers!

                Comment


                  #9
                  Anytime you are adding a new module or system to your, you'll need to make sure it's in there. But usually not very often.

                  I don't really know any documentation, it was just something I figured out reading other people's posts asking about linker errors. I think I was trying to get ProceduralMeshComponent working.

                  As long as it compiles, you're fine. The red squiggles just mean that VSCode can't find the header, but the actual compiler can just fine. If you use the Unreal command to regenerate the project files, it might go away after Unreal includes the appropriate header paths in the project.

                  Comment

                  Working...
                  X