Hey When I Try To Add An Actor From Details Tab Its Not Working Also Giving Me An Error
Error:
also I Faced this error in building escape while setting the PlatformTrigger From Details Tab
Why This Is Happening???
Please Help!!!
Hey When I Try To Add An Actor From Details Tab Its Not Working Also Giving Me An Error
Error:
also I Faced this error in building escape while setting the PlatformTrigger From Details Tab
Why This Is Happening???
Please Help!!!
Where are you doing this? The blueprint or in the world?
Then that would be why. The blueprint isn’t an instance in the world, it can’t reference things like that.
I’m not sure how you’re using either of these things so I can’t really tell you how I would go about it.
Hey I Wanna Do Some Thing , Like If BP_Block(Actor) Hit With ABoxPawn(Pawn) Then We Will Do SomeThing But Unable To Set The BP_Block
Probably won’t be able to do this today.
@DanM
Hey, I Fixed The Issue
Then You Said :
Thats Really Helped Me To Fix This, I Did The Same Thing In World Instead Of Blueprint And Everything is Fine Now.
Thanks For That
Now I am Getting New Issue Like, In That Project I Added URadialForceComponent
To The BP_Block , It Is Working For All Physics Body But For Pawn Its Not Working!!!
Please Help Me !!!
==============================================================
Setup:
So I’m a little confused. What are you expecting to happen? When is this radial force supposed to be applied? I’m not seeing any uses of it.
Also for components you want Visible
not Edit
for the UPROPERTY
, you’re not editing the component itself but the properties on that component.
I Want When Pawn Hit On BP_Block Then The Force Will Apply
Block.cpp
void ABlock::Trigger()
{
Force->FireImpulse();
UGameplayStatics::ApplyRadialDamage(
this,
BaseDamage,
GetActorLocation(),
Force->Radius,
UDamageType::StaticClass(),
TArray<AActor*>()
);
}
BoxPawn.cpp
void ABoxPawn::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor,
UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
for (auto Block : BlockToTrigger)
{
if (!Block) return;
if (Block->GetRootComponent() == OtherActor->GetRootComponent())
{
Block->Trigger();
}
}
}
I Followed Same Thing AS In BattleTank ->> Projectile
Objects your RadialForceComponent affects:
The collision preset (and thus object type) of your pawn mesh:
Considering BlockToTriger can only be applied on an instance you should probably be using EditInstanceOnly
not Anywhere
.
Also wouldn’t it make more sense for the block to be firing the impluse?
@DanM
Thanks, I Really Missed That One, Now That’s Working ,
Yeap! I Thought After We Hit, A Force Will Apply, But Force Is Applying Before Hit, How That Worked In BattleTank >> Projectile ??? ,
And Can You Tell Me I Want Something Like ->> Consider BP_Block Has A Sphere Component, Now If Pawn Overlaps With That Sphere Component Then BP_Block Will Come Towards The Pawn.- How To Build The System?
Disable auto activate
You basically already have that but with OnHit, use on OnComponentBeginOverlap
instead.
@DanM
Thanks Dude,
Aaa , Actually I Was Wondering, Coin Will Move Towards The Pawn, Ok Have A Look ::
*** My System Currently : ***
*** Is There Better Way ? ***
I Mean , If You Increase The Radius Of The Sphere Then The Velocity Of Coin Will Increase Also And Will Effect On Pawn And Will Push It Behind
vid.zip (688.7 KB)
Can You Tell Me Is There Any Better Way To Make Move The Coin Towards The Pawn?
void ACoin::Overlaps(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
auto Pawn = Cast<ABoxPawn>(OtherActor);
if (Pawn)
{
auto CoinLocation = GetActorLocation();
auto ActorLocation = Pawn->GetActorLocation();
auto Direction = ActorLocation - CoinLocation;
Force = FVector(Direction * ForceAmount);
MeshComp->AddForce(Force, NAME_None, true);
}
}
Well if you’re just wanting it to be a pickup which has the magnet effect. Do you need to simulate physics?
Could you not just check if the Pawn is overlapping and then use VInterpTo
and use SetActorLocation
?
@DanM
Thank You Very Much,
Hey I am Stuck Here, In Terms Of Casting I Know How To Cast A Pawn And GameMode ,
But Can You Tell Me How Can I Cast An Actor In Another Actor Or in GameMode ??
Not sure what you mean?
Suppose I Have An Actor Called (ATile) And I Wanna Cast() This In GameMode.cpp Then What Can I Do?
Like:
void ABoxRunGameModeBase::SpawnTile()
{
ATile* MasterTile = Cast<ATile>(/*?????? */);
if (!MasterTile)
{
UE_LOG(LogTemp, Warning, TEXT(" Noooo "))
return;
}
}