这个就是 UE 默认提供的粒子特效的池子,叫做FWorldPSCPool(Niagara 的池子叫UNiagaraComponentPool),但是如果使用的是 UGameplayStatics 里的释放粒子特效的接口(不管是SpawnEmitterAtLocation还是SpawnEmitterAttached),都是默认不把特效放入池子的(即EPSCPoolMethod::None,原因可能就是在于,引擎不知道应该给什么样的默认...
用spawn emitter attached 骨骼就是我们输入的骨骼,mesh就是从左上角拖出来的mesh,emitter template 拖到输入里,在外面改。 以攻击手臂为例 这是要添加的喷血动画 大概是这样,感觉喷血量有点多 然后就是调整出血的动画,也可以跟之前一样用一个 随机的布尔值进行select 多试试看哪个效果好,没啥好说的 然后加上...
UGameplayStatics::SpawnEmitterAttached(CastingEffect, Character->GetMesh(), HandSocketName, FVector::ZeroVector, FRotator::ZeroRotator, EAttachLocation::SnapToTarget); FTimerHandle TimerHandle_AttackDelay; FTimerDelegate Delegate; Delegate.BindUFunction(this, "AttackDelay_Elapsed",...
static UParticleSystemComponent* SpawnEmitterAtLocation(UWorld* World, class UParticleSystem* EmitterTemplate, const FTransform& SpawnTransform, bool bAutoDestroy = true); 1. 将一个粒子attach到某个Component上播放: /** Plays the specified effect attached to and following the specified component. The...
UGameplayStatics::SpawnEmitterAttached(ImpactVFX,GetMesh(),"Muzzle_01"); 效果: 最后是添加魔法球撞击相机震动 在魔法球类.h文件添加 UPROPERTY(EditAnywhere,BlueprintReadOnly)TSubclassOf<UCameraShakeBase>Shake; cpp文件在OnActorHit函数添加相机震动 ...
保证特效出生在枪口的槽位上SpawnEmitterAttached ,枪口特效,如何定位到槽位上的呢?只有一个槽位就这么些,如果有多个呢 //UGameplayStatics::SpawnEmitterAttached(MuzzleEffect, MeshComponent, MuzzleSocketName); UParticleSystemComponent *it = UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), MuzzleEffect, ...
LastPSC = UGameplayStatics::SpawnEmitterAttached(TestParticle, MyCharacter->GetMesh(), "MyParticle"); } 如果是循环播放的粒子,手动控制粒子的播放和关闭(如果是一个只播放一次的粒子,可以不用手动停止): //ActivateSystem的bool参数表示开启特效后是否重置特效(从头播放) ...
调用代码去Spawn时: UNiagaraFunctionLibrary::SpawnSystemAttached或SpawnSystemAtLocation方法,在参数里传入ENCPoolMethod::AutoRelease或者ManualRelease才能使用对象池。 AutoRelease:在lifetime到时间后自动放回池子里。 ManualRelease:意味着后续需要你自己手动调用ReleaseToPool方法才能把特效放回池子里。
SpawnActor From Class 克隆物体 spawn emitter attached 克隆特效 DestroyActor 销毁物体 DestroyComponent 销毁组件 ClearTimerbyFunctionName New State Machine AttachToComponent 绑定物体(设置父物体) LineTraceByChannel 射线检测(Physic.RayCast) SetCollsionResponsetoChannel设置碰撞 ...
// Fill out your copyright notice in the Description page of Project Settings.#pragmaonce#include"CoreMinimal.h"#include"SAction.h"#include"Components/ActorComponent.h"#include"SActionComponent.generated.h"UCLASS(ClassGroup=(Custom),meta=(BlueprintSpawnableComponent))classACTIONROGUELIKE_APIUSActionCompon...