#blueprint
1 messages ยท Page 254 of 1
I have created a fadein and out image widget, how do I get it to play in game??
Anything I try I just get a plain black box
I'm not sure I understood but if this is what you mean its not working..
Then it doesn't exist in that BP you've cast to.
You need to call PlayAnimation from somewhere.
Do you mean my variable doesnt exist?
basically all I want is this
Open your BP_ThirdPersonCharacter. Look at it's variables list on the left side. None of them will be NearLadder, or Ladder.
If you want to set it on that class, it needs to exist in that class.
I see I got it now but like that was not obvious haha I guess I got a lot to learn.
Thank you
does anyone know how to actually use this node to set a new value?
Use Set Type (by ref) in case it's a simple type or Set Members in case it's a struct
fire rate is not working, setting it to "2", "25555", "0.01" yields all same thing, any idea why?
My guess would be that you have "FireGunLocal" being called on "Triggered" of an input action and that is continually firing, so you're probably seeing your gun firing extremely rapidly?
Do you have a moment for voicechat so that I can share my screen?
It works on triggered by once, therefore no rapidly happening thingies.
I am at "Pivot Point" channel, you don't need to talk I just need to screenshare so that we can debug thi
s
Hi guys! I have a short technical question regarding soft references. If I have a getter of a soft object and plugit into a spawn actor/system, the converter will be added automatically, whereas we have the async load node as well. In the case of the converter, how would the engine manage the soft object? as it always was a hard reference? or will it to attemp the async loading each time I call the spawn?
If the asset isn't already loaded, the converter will return none.
how to get camera direction in gas?
ohhh mybad didnt read the tooltip lol, thanks!
whats the best way to speed up shader comling hardware in a PC
A strong CPU and decent GPU ๐ช
I have a 12 gen i9 and a 1080ti but they dont go to 100 percent ever @trim matrix
well no, they won't
the engine by default doesn't use everything so you can do other things
A small collection of hidden settings and other features.
in situations where either would work, is there a substantial performance difference that favors one or the other between passing around a struct (something I've been loathe to do) and passing around a gameplay tag that's used as a name to look up a row on a data table (what I've been doing everywhere)
I was learning a course and came across this problem..concept is creating a physics material and surface type to say that when bullet hits zombie it give "meat" and when it not it gives "surface".but see the video and i don't know how to solve it
if i keep shooting in the same spot it might accidently go to meat but multiple times output
Depends on the struct and code using it. Depending on the code and struct using it, it can be the same. You copy the struct every time you call a function and pass it somewhere. You copy it when you pull it from the datatable. So if you pull it from the datatable for nearly as many things as you pass it through functions for, there won't be a lot of difference.
Depending on what your struct is and why you're passing it around, this is why I generally prefer UObject systems and DataAssets. You pass around a couple of pointers and you can access megabytes of data that rarely changes without copying all of it just to say set a name in UI.
I recommend checking out your skeletal mesh's physics material, and it's physics asset's phys material overrides. Something doesn't have your meat phys material specified correctly somewhere.
thanks ..i will try
love the half life alyx hacking minigames, but got not a lot of experience with VR dev. how could you make something similar to this video linked? (it linked to the time im talking about) https://www.youtube.com/watch?v=zSW2pc3kmqk&start=12258
Half-Life: Alyx is Valveโs VR return to the Half-Life series. Itโs the story of an impossible fight against a vicious alien race known as the Combine, set between the events of Half-Life and Half-Life 2.
Playing as Alyx Vance, you are humanityโs only chance for survival. The Combineโs control of the planet since the Black Mesa incident has only ...
I have no experience with VR dev, or even using VR. But in general, one remote controls sphere orientation, another with the pointer controls the location of your moving gizmo. It looks like there may be trigger keys involved. Left trigger to grab the sphere while hand is near, right trigger to start moving the gizmo when pointing at it. Past that it isn't any different than any other game mechanic. Sphere with a particle system driven by some directional vectors. If the gizmo vectors both match up, success, if the gizmo vectors match any of the red vectors, fail. Add to BP and allow it to be rotated by controls and target with a line trace to move gizmo.
my character body is listening to hit events using the physics body, so when the health is 50% the character mesh size decreased, but it still gets hit when i shoot at empty space where the question mark is shown in the image
is this something related to update or wake physics body or what?
using ShowFlag.Collision 1 i can see the physics body size also decreased according to the new scale applied to the mesh
that location with question mark is empty, so how it is still getting hits from this location?
Can you show your code that is detecting the hits?
its in C++
void ABullet::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
const AActor* HitActor = Hit.GetActor();
if (HitActor && OtherActor && OtherActor != this)
{
if (AWeapon* const FiringWeapon = Cast<AWeapon>(GetOwner()))
{
if (HasAuthority())
{
FiringWeapon->ProcessInstantHit(HitActor , GetActorLocation(), BulletProjectileMovement->Velocity.GetSafeNormal());
}
}
//Destroy the bullet after hitting
//Destroy();
}
}
i found a solution for this
re-overriding the OnHit in blueprint like
it seems like when character mesh size changed, the physics needs to be reinit manually
so i will have to reset the physics asset when the size of the mesh is changed
in this image it just for quick test to reassign the current phys asset after a hit
and i am not changing the size of the character using SetScale3D i have an animaiton which scales down the character
Blueprint Runtime Error: "Accessed None trying to read property DebugMenu"
i dont think the variable is being properly set
and ive no fucking clue why
You are reading the variable without checking if its valid
Add a Is Valid check before
before what?
For example before the is visible branch
btw the 2 images are both halves of the blueprint
You check before using the widget variable
If you dont know if a object can be valid or null you check for it
i am tho. theres an IsValid branch there
What graphics card do you have?
Wouldn't think that would have issues with raytracing. UE 5.5?
how can i fix this issue
Dunno. Google leads me to this, which you could try.
https://forums.unrealengine.com/t/error-raytracingdevice-createstateobject/2129763/3
bro i can't understant what did he done
plse can you tell me step by step @maiden wadi
for now i fixed this issue by calling a notify in the animation to restore the physics state when the animation changes the character scale
but still curios why the physics state is not updated by itself when the mesh enters a new pose
where is defaultengine.ini
@maiden wadi
i am a beginner i request you to tell me step by step plse
Open your project folder. There is a folder inside named Config. If you open it, you should fine DefaultEngine.ini
Because you don't have windows configured to show extensions of files. That is the correct file.
what do next
i have copy this and paste it in the default engine
after that i have open the project
okay thanks after that the game opens without any errors
but one problem solved i got another problem
๐ญ ๐ฅบ
after i click on start button the level is not opening
in ue5 the level succefully opens if i click start button but after i package the game i click on start button othing happens
You probably didn't package the map you're trying to open.
how can i do that
@maiden wadibro i solved now the map is opening but i don't know what i have done
can you check and tell me is there any wrong setting i have done
new map is my mainmenu ui
and babu is the level when i click on start button
because when i added the playing level after that the start button is working and opening my level but if i have two level how can i add because in the advanced=transition there is only one option
what you actually want to do?
Good morning all, anyone has any idea why my textures look striped? this is an obj file imported after polygon decimation in Meshlab of a photogrammetry model
The material does not show it like this
but after packaging i will be able to open only leve 1 because in this case,when i click on start button it opens the babu map
let's assume that i have 2 level
so how can i package the game with both level
because when i added babu(level1) then the start button works
@floral stump
and there is no 2nd transition map is there to add level 2 map
Youโd have more luck in #ue5-general
I recently noticed a behavior of the sequencer when BP are spawnable which i perceive is bugged but maybe it's a feature not a bug, when i grab the actor position when it is a spawnable inside a sequencer i always get 0,0,0 instead of the actor position of that actor where it shows in sequencer and then when i scrub or toggle variables in details panel the position data magically updates without the print message from construction script firing again, which is incredibly odd.
I imagine the engine is probably doing this in my particular scenario. 1. spawn the object at 0,0,0 -> 2. run the construction script -> 3. then move it to its location even though not keyed in the sequencer. By the way my script was able to capture the position perfectly fine when it is a possessable in the sequencer.
you can create main menu level, and add buttons in the main menu level1 level2 start when you select level1 and click start the engine will load level1
Add them in a list of packaged map inside your project settings
Look for List of maps to include in a packaged build and add all the levels you want to include in the package build
pretty sure transition map is only for server travel anyway
hello guys,
ive been developing a first person game using blueprints, implemented some character movements like sprint, crouch, walk.....
its all stuffed in character class,been doing with gameplay tags and if else, but it is getting messy.
read some forums on how manage movement states of character, but they only talk about high level implementation of state machine and GAS... can anyone tell me how to do it, or point me in right direction.. im pretty new to unreal engine.... thanks in advance
In general, the idea with GAS is to simply move your action code into grantable abilities. So Sprint, Crouch, Jump, etc are all abilities that could be granted to an ability user and work on anything that is based on ACharacter since you can call these functions generically on a character without having to know it's specific subclasses.
Your input at this point changes to simply TraActivateAbility. This seems like a lot of work initially for a lot of people who would rather just simply call "Jump" on the jump keybind. But then they want more and more things. First we only want to jump under certain conditions so there's a branch, next we want a sound to play. Now we want a dust particle to play.
GAS allows you to do all of this outside of the character class, and allows you to grant this jump ability to any character, so you don't have to have it in your character hierarchy. More so, it allows you to have Cues. A jump ability would simply be calling it's owner's Jump function mostly. It might also play a cue, and or wait for a quick preparation montage to play. Your animbp can handle the rest of the state transitions. The cue object would house your jump sounds, and particles. Maybe you want some complex scripter logic there where the user gets different sounds than a third person viewer, etc. All stuff you don't have to put near the actual activation and gameplay affecting code since it's in it's own separate cue object.
All in all, I love GAS, and I highly advocate for it, but you'll find a bit of pushback from a lot of people about using it if you're new.. or not new. If you like that kind of separation of concerns, and like your logic nicely separated, it's a good tool. If you work better in monolithic files where everything is located, you really won't like it.
As far as getting into it, there isn't much better than just finding some content to take you through some steps and adapting what you learn to fit what you need.
On a side note to this, I highly recommend not using that anymore. If you open the AssetManager section in Project Settings, and uncheck Editor Only on the Maps entry, it will automatically cook anything that is a Map file in Content/Maps folder or subfolders. Much easier way to manage what gets cooked.
Having issues playing some level sequences in a packaged game (UE5.2). They have a fade track *from * black at the start of the sequence, and *to * black at the end of the sequence, set to "Restore State" for sanity purposes. In the packaged game, the fade to black at the end of the sequence doesnt get removed - it just stays there at full opacity forever. Has anyone else run into this?
for some reason this only happens in some sequences, but I cant find anything that sets them apart from the ones that work correctly with the same fade settings
What's the absolute minimum you can do to use GAS ? ๐ฅฒ
I only want a fraction of it
cba doing the entire thing
Depends on what all you want to use it for. I mean using it is as simple as making a GameplayAbility, and calling GiveAbility on the thing you want to use it. You can activate the ability via class, or even gameplay events if you set up triggers on the GA.
I think it's just a matter of implementing the IAbilitySystemInterface, IGameplayAssetTagInterface, then defining Avatar Actors..... You don't need to use attributes.
I'm just now starting on the ability system for my project, and it instantly reminds me of GAS ..
If you want Cues, you simply make a cue object, set it's cue tag, and call the play function for it. Works basically like a multicast visual. You can also make them similar to OnReps by adding them to GameplayEffects.
Wanna keep it simple, yet i want a separate "Targetting" uobject so abilities can do custom stuff for that
I'm worried i'll get entangled into the web of options gas brings tho.. i tend to be ๐
You don't even really need these things so much. They're extra fluff for usability. The interface for example is useless outside of the minor performance bonus of getting the component directly vs getting it from the actor's component list. You don' tneed the tag interface if you keep things related to the ability component.
And yeah. Attributes are nice, but they're optional. You don't need C++ for anything except for Attributes, you can do 95% of it all in BP. But it's still nice to have C++ access for helper functions and such.
Abilities, Cues, and Effects are all BP accessible. Abilities are basically as descibed above. Effects can still do things like apply tags and play Cues, and Cues really rarely touch BP since they're specifically made to be very graphic designer friendly.
Im mostly using c++ anyways, not really an issue
but it feels like enabling GAS is like dropping this massive Octopus into my project
entanglement everywhere lol
or rather, the concerns are so separated that you end up with 10 files just to fire a basic ability
Only if you want there to be ten. That's basically two files if you're not using Attributes. Ability and Cue. If you're using Attributes and count the Attribute Set, then four files.
AttributeSet, Ability, Cue, Effect.
Attributes, Execution, Visuals, AttributeDefinition
That all goes in your ability. Targeting is a new DA if you use the targeting subsystem, but you get to reuse that over and over too.
for the third person template when we click w a s d its rotation canges right ?
can i overide it so that i allow only rotation with mouse and add animations for right left and back ??
You can do whatever you like. For rotation specifically, disable the orient rotation to movement in the character I think. And then you'll have to set your ControlRotation to the mouse cursor on tick.
Animations are separate and part of the AnimBP.
got it
this query works in 5.3, but fails to find anything in 5.5, without any extra changes. any ideas why?
Can't speak for queries. But we have not moved to 5.5 at work yet. I tried the other day and had some checks crashing cooked game because of some async stuff in AI code.
seems a tad unstable atm
Sorry guys, quick question! How can I have my game start in the resolution of the monitor it is running on?
i have 2 levels and after packaging START button (for level 1) and for PLAY button(for level2) in unreal the level opens but after packaging when i click on start button nothing happens
@maiden wadi
startup map default map is main menu ui
where i should add my both level to work when i package
thanks it solved
I have a blueprint actor with simulation generates hit events disabled on the root/sphere component. But hit events are still firing. Is that expected?
so basically what i have done is that i just scroll down and you can see list of maps in packaging i click on + button and write the name of the map and then i package it after i open the game the start button works fine ,if i have done something wrong in this process you can tell me
both level is opening
i can't able to understand what you have said , i have done what coldsummer said and that works perfectly fine
whenever i open my project in debug it shows this warning can someboady tell me what is this and how i can i fix this
I'm not sure how to rephrase that.
anyway to exclude maps? because my brother have tons of experimental maps ๐
well I guess he can place his editor maps in some other folder
thanks for the advice.
Nice, thats neat!
Is that component simulating physics?
I don't think so. Not without specifying directories specifically or files specifically. We usually have developer folders that we stuff testing stuff in so it won't get cooked.
Kinda assumed that was purpise of the dev folders
why am i getting errors attempting to set show mouse cursor
how can I speed up shaders being built?
it doesnt use any CPU and I have an i9 so I am confused
How can i fix this
Hello. I'm wowrking on a train game. I'm trying to procedurally animate the steam locomotive. How can I use "find look at rotation" with another pivot? The white rod should always look at where it is on the pics. But it moves with that untextured thing.
well how do we fix the fab/unreal engine nightmare https://forums.unrealengine.com/t/plugin-installation-error-md-0011-0-after-fab-migration/2083033/78
I cant update my most needed plugins to u 5.5 ****
what a nightmare
Is there a way for the Input Key Selector widget to recognize mouse wheel up and mouse wheel down as keys?
Hello! So, my character can become invisible and fool enemies, but the enemies can still see her when invisibility is active, how do I solve this?
Up is for when the character becomes invisible, down is for when she stops being
Basically I implemented a wave system. The invisibility can fool the first enemy of the type, but not the rest of their clones.
Unsure initially. I've never tried, but glancing at code, it doesn't have OnMouseWheel overridden. Also as a warning, don't try to bind a keybind with multiple modifier keys. I ran into a bug with it that has been there since 2016 at least. Someone derped a bit operation and made it so that if you have more than one modifier it registers it as none.
ah thanks for the heads up, a shame it cant handle multiple modifiers
If you have C++ access it's easy to circumvent, just slightly annoying.
how can i circumvent it in c++?
FSlateApplication::Get().GetModifierKeys()
You can make a new struct for the thing it returns, which is FModifierKeysState. It's a bunch of booleans. I made a blueprintable struct and populated it from the FModifierKeysState and I pass that back from a static BP library function.
TLDR it gets you all of the currently pressed modifier keys the application itself has detected regardless of what widgets have allowed through or not. Much better than relying on PlayerController pressed keys.
ah nice, thanks
You'd need to use "Get All Actors of Class" and loop through them.
So, I am having multiple issues with my camera that I suspect are all coming from the same source. I've done a lot of googling and none of the forum solutions work for me. Probably something basic I am missing but would appreciate any insight anyone could shed on the issue.
-
My spring arm and camera needs to be offset 90 degrees around the player in the blueprint to be on behind them on play.
-
When I tilt the spring arm and camera down everything starts to slant towards it, as seen in the overhead shot.
-
When I move the spring arm and camera too low it snaps into the player. I have turned off testing for collision and it doesn't fix it. Showed in the fp shot.
Thanks!
hey y'all, i've got a missile that spawns and casts a line trace for where it should move to
Buuuuut my delta seconds don't change depending on the distance of the trace so how can i go about making sure the missile flies the same speed regardless of the distance?
theres a distance pull from the break hit.. yeesh i didn't even notice. i'ma play with that - cancel the help unless you noticed im hella wrong
i did "Time" from the breakhit and multiplies it by my delta seconds. Hopefully that's the right way
Unsure if this will help your thoughts but DeltaSeconds is just a time between frames. 1 second divide by framerate. So 60fps has an average deltaseconds of 0.01666. You use this to multiply speeds so that you get an accurate movement per second.
An example of this is something moving at 300cm per second. (300 * DeltaSeconds) = 5, that means each frame this thing needs to move 5 units on a pc running 60fps. Which will cause this thing to move 300 units over 60 frames, which is one second. as 5 * 60 = 300.
So if you know the speed an object should be moving, and you have it's location, and you have it's target. You can calculate it's movement each frame as Speed multiplied by DeltaSeconds, and use that to multiply the direction the object needs to move which will be TargetVector-CurrentLocationVect normalized.
Alternatively, there is also the ProjectileMovementComponent which also allows homing and setting accelerations and max speeds.
I was just about to ask why no projectile movement component
It aalso account for framespikes automagically
hi everyone is there a way to make a line trace from the mouse while in ui mode?
basically i want to have buttons that you can drag and drop on things
What's exactly not working? Have you tried to execute trace while in UI or you just don't know how to get proper coords? i.e. ScreenSpace -> WorldSpace
APlayerController::DeprojectMousePositionToWorld
The mouse position is set to 0, 0 while in UI mode
From the player controller at least
how do you get mouse pos?
show code/BP
i dont have any code yet
Do you have mouse attached?
I mean there might be "bug" if you are working remotely, so mouse is faked 
its not a bug its intended im pretty sure
when working in ui mode the player controller doesnt have access to the mouse position
only the widget does
I'm getting coords just fine
Mentioned util function has "guard checks" like
so if it fails on one of them it will just return default vector 0,0,0
i didnt know the convert mouse location to world space node existed mb
internally it uses same function to get mouse pos, so it will return 0,0,0 if you don't fix issue
it returns 0,0,0 i.e. thinks I have no mouse when I'm using moonlight+sunshine as a remote desktop solution, while built-in microsoft RDP works fine

i do have a mouse attached so i dont have that problem
this wont work in a tick event
does it work in my setup? i.e. on click event
ya
mine works from widget's tick too
if you have studio and C++ skills, you can try debug it with breakpoints
though not sure it will be doable in "non debug" build (for engine), some stuff might be hard/impossible to trace if it's optimized 
if the character transit to another state like from stand to crouch,
when the stand pose physics body catch supposed to be cleared/updated?
I have a water volume and for some reason when my character hits the top, it thinks its in a falling mode, does the landing animation, and then sinks straight to the bottom. ๐
Anyone know why this might be happening?
I mean you swim up and exit the water
Which will trigger your stop swimming code
right... but why would it think its falling when the movement mode is walking? and why would it force me to sink directly to the bottom?
It goes into falling cause it fails to find a floor inside of the walking mode
And the sinking is probably just the gravity still in the velocity when you switch
In theory this needs Buoyancy to push you up against the gravity if it should be somewhat realistic
I'm pretty sure switching to "Walking" from any other mode is what triggers the landing animation.
Try switching to Falling instead when you emerge.
aaaagggghhhh i completely forgot it existed! I even used it in my Nades 
@thin panther same, fam. same.
you are setting the phyics of the character movement
a character is not water
You should trace ahead of you Speed distance x DeltaSeconds
that is how far you move this frame
if it hits, you hit something and explode
if not, you move and do it again next frame
this works. I just need to figure out why he swims above water now.
But I may rebuild this with a physics volume. I'm kinda worried about building a system with the water plugin since its "experimental"
define "above water"
capsule not touching water at all?
i assume the capsule is juuuuuuust below the line, maybe?
yeah that looks correct
make the capsule visible
uncheck Hidden in Game
yeah, its def the capsule. its odd, the couple tutorials I watched, the character just stopped at the top. They never messed with the capsule
other actor -> cast to yourcharacterclass -> get capsule component
at the moment you are just firing the event for entire character class, narrow it down
from within the water blueprint?
Maybe in their tutorials, the collision box for water is a little below the actual visible top of the water?
can you use OnComponentEndOverlap
instead of actor
it wont fix the swimming whilst character is verical though in the beggining of your vid
the best way would be to add a new collision component to your character like a sphere collision, make it small and about chest height
then use that as a check on the overlap events
lower the collision box
now that you mention it... i did something similar to that already but it look to be missing. I'll bet thats it
yeah if you can have a secondary collider thatll work too
still trying to find it with these water volumes. just looks like a plane to me even though its 30 units high
those purple lines are a post processing volume
side question: Should I even be using this plugin since its "experimantal?"
then on your viewport settings enable colisions
However you do it, the problem is that you're considered to be "in water" when your toes are in the water
either have the water test collision higher, or do math, or otherwise get around it
yeah I'm just wondering if using experimental plugins is good practice or generally considered a no-no
or make seperate component in character
explore learn, nothing is a nono unless its something like cheats
my method would be
- add a sphere colision component in your character class
- make it small and chest height
- on overlap events, use other character -> cast to your character class and use the new component as a check to bool
experimental plugins aren't as bad as they sound. Unfortunately the default water plugin is an absolute mess and is an exception.
stuff like instanced structs were experimental for a while and fine to use in production. It just tends to mean that it hasn't yet been tested large scale yet.
Cool cool. I appreciate the help. Gonna dig back in and see what I can do
or even better do 1 and 2 then use OnComponentBegin overlap ๐
i dont think its being set properly
like the set node isnt doing shit
if i set the default value of the variable to WBP_DebugMenu, it works without issue. but when i relaunch the project later, the value of the variable is set back to none
hi, how do i use event dispatcher thats inside of a child actor? the event dispatcher is in the base enemy but i cant call the child's version
If your Event Dispatcher is created in "BP Enemy Base" then binding to it only requires a reference to an BP Enemy Base, so even if your "child" is something like "BP Enemy Zombie" that would not change the target in the event dispatcher to BP Enemy Zombie, but it will still function to receive the dispatch when called from BP Enemy Zombie.
default value of variable keeps resetting to none after launching a project?
Hey there
Trying to make a basic system where the Player Actor targets an Enemy Actor, and traces a line from the camera to a Component on the enemy with the right tag.
Issue is, I can't find a way to get access to component's world location for the line trace...
I think... This works.
Actor Components don't normally have a location. Scene Components do.
It does what I want it to do. Seemingly.
Yes the components in question that I'm targetting are scene components
Since I only care about a single point in space
May as well change your "Get Components by Tag" class to "Scene Component", then disconnect everything from your loop, hook things back up, but then you won't need to cast.
Should I use a get components by class instead?
For reference, I have a real time combat system that has area damage.... Player picks 3 areas on the enemy and if they are visible, they can attack
There are multiple scene components, but ideally only 1 needs to be visible from the camera to be valid
Doesn't specifically matter. The tag allows you to filter further is all.
Got it... I still need to differentiate enemy reactions based on the tag
Which rn I'm using via interface input
(The interface call tells the actor which tag they validated the hit with)
Anyone seen issues with the Event On Possess node in the AI Controller not giving expected behavior before? According to all debugging, it's only getting hit one time, but it appears to be running it every frame based on the behavior I'm getting. If I swap it for a BeginPlay node, it technically works, but my stuff isn't setup to start running my behavior tree on BeginPlay, so I'm trying to figure out how to get OnPossess working properly....
Would this still work assuming there would be more than 1 component with the tag in question?
What you are doing right now with the images you have:
Get all Actor Components (of class Actor Component) with the Tag.
Looping through all of them, casting to scene component, doing your line trace.
What I was suggeting:
Change the class of the Get All Actor Components to SceneComponent (getting a shorter list) with the Tag.
Looping through all of them, without having to cast, doing your line trace
Should work exactly as what you had with the cast.
Less nodes. Less stuff happening in C++ too.
And it wouldn't let me...
The for loop wouldn't update to scene
I still should convert the line trace to C++ later down the line though...
Like any for loop has no business being BP based in release builds
i want to call it from other actor
So based off of my example, you want to call "Im Dead" from BP Enemy Zombie?
im trying to achieve something like, a constant spawn so i need to know if its dead
so the spawner will bind the event dispatcher, right?
Yep. If "BP Enemy Zombie" is a child of "BP Enemy Base" and "BP Enemy Base" has the event dispatcher "Im dead" defined, you should be able to just create a "Call Im dead" node which will then trigger that dispatcher. The spawner can bind to any BP Enemy Base reference it has to know when Im Dead is called.
Single player?
Yes
On possess called when a pawn is possessed, do a print string and see if it's called.
Also post what you have
You said it's called once. So what exactly is the issue?
You have to elaborate on the unexpected behavior.
I have, it is, and it's only called once. But for some reason, my Behavior Tree resets to the Root node every frame as though something is calling RunBehaviorTree continuously, but as far as I can tell, nothing is.
More of #gameplay-ai but show your BT
It will flicker to the root node if othing stopping it the BT is evaluated every frame after all
Probably the tree itself doing something bad
it worked! but i tried to called a different enemies from an array but i cant connect the pin
I have one that works and it seems to only return to the selector node once it's running, not the Root...
Also, I notice in that screen shot I have the decorator set to both, that's been fixed so it's set to self.
But that did not fix the issue.
There's no point looking at the visual right now as you didn't even have any other sub branch other than the selector node
Not sure what the issue actually is
The issue is it gets the TargetPosition, and continuously is hitting the MoveTo node but the character isn't moving.
That's because you don't hard-core the class on the spawn actor, so it will return generic type which is actor.
If I switch the OnPossess node out for BeginPlay, the nodes seem to behave as I expected them to, with the tree returning only to the Selector node instead of all the way to the root, but I get errors because my stuff isn't setup for this to run on play, its setup for it to run on possess...
You can cast from the return value if you are sure you are spawning the type
what do you mean by hard-core?
Your return value is of type "Actor" you need a "BP Enemy Base" type. This can be fixed by disconnecting everything from the return value, and from the "Class" input on the Spawn Actor from Class node. Whatever variable you have feeding into the "Class Input" needs to be of type "BP Enemy Base" and then you can connect up the class variable back into it, which should update the return value type to "BP Enemy Base" which you then can reconnect everything else as needed.
Hardcoded*
I'm not sure what you mean by this. Do I not have the tree setup correctly?
What is the actual issue with your A.I atm?
The MoveTo is not moving the character to the TargetPosition.
Check the movement result
Should there be some sort of debug for that? I don't see anything on my character or it's movement component that shows any values for current movement.
appreciate the replies, but am i doing it right? i want to spawn enemies from a pool
Your move to logic should have movement result. Print that on completed or failed pin
This is what I've got, I don't see any movement result though.
Sorry took me a sec to figure out how to do that. Movement Result says aborted off the failed pin.
Make sure you have a navigation mesh. #gameplay-ai ppl should be able to help more
I do, it works for other characters. I posted in there awhile ago and never got a reply, but I have more info now so I'll post something new.
Sounds like an Initialization problem to me, wild gander ๐
Before running tree add delay of .2
I thought maybe it was this as well, but I tried that quite awhile ago and had no luck. Tried it again just now just in case as I've changed a few things that I thought maybe combined with that might fix it, but still nothing.
I have a question im trying to make a system i have a bunch of items listed in an enum (i have 649 right now) where as item=A spawns in Location=A i got the spawning to work first when i first started creating items but now that i have 649 items every time i select one in from enum to struct or i select it in the master item the engine crashes i was curious if anyone knew any way of fixing this
Wdym by item listed in an enum? Show the variable
gimme a sec im restarting the engine
List to struct
whenever i select one in the struct or the encounter BP it crashes
Don't do this?
this is not what enum is made for. Enum is basically a named integer
So what would be the proper way to create a name list like this?
A name can just live inside the pokemon object, or w.e you are making
Ideally stored within a struct
A struct so I could make a data table of the pokemon and it's information and all that info could be transferred else where like spawning pokedex information or creating new pokemon
You want a data asset, not enum
enum is useful to describe state
not a whole list of pokemon
Ahhh gotcha thank you!!!
but data asset is useful for reading. At the end of the day, you want to store the pokemon information in a struct
(noob here) so guys yknow how the default templates in ue5 cram all the input and movement logic in the default character blueprint?? i tried to refactor it by transferring all the logic to a player controller blueprint. is this the right way to do it
bc i heard for best practices, ur supposed to separate input and movement logic, the former should go in the player controller and the latter should go in the character blueprint. but tbh idk what that means, all this looks like a mix of input and movement so i wasnt sure how to refactor it
Does anyone know how do i get the pawn reference from collision overlap without casting and interface. Right know i can use interface but it is one more step in the process that i dont need. if i could get the pawn ref from the overlapping actor that would be amazing
what's the problem with casting?
just cast to pawn
Other Actor -> Cast to pawn
there will be a few other actor/pawns that might be on the other side of the map, and from my understanding casting loads them into the memory permanently
it's the hard reference in bp cast is what gets loaded to the memory
but you are going to have a pawn in your map all the time anyway
so cast away to pawn
you don't need to cast to your specific pawn type, you just cast to the base pawn which is going to be loaded anyway.
does it matter at all if few pawns will be vehicle pawn and others default pawn type?
in what context?
if you just need to do something that the parent of their has, then don't cast to their type but to the parent
example would be possessing
that's a method that the pawn class has
so you don't need to cast to any of the child, cast to pawn class instead
lets say it is like GTA you have human character and cars, humans can posses cars
in a case like this, you just cast to the pawn class
interface here is ๐คฎ
also ignore youtubers that says use interface instead of casting
they are clueless and will ruin your project
aight aight will do thanks a lot
@rotund quartz https://dev.epicgames.com/community/learning/tutorials/l3E0/myth-busting-best-practices-in-unreal-engine
I recommend having a look at this when you have time
will do
can someone help me with this
You need to feed your controller here
Where it says enhanced input subsystem, the left blue pin
Hook self (the controller) to it.
Self would refer to the instance of the object you are in.
Since you are in the controller, self would be the controller
yeah but what node do i use
Right click empty space and type self
You will see a text saying get a reference to self
Well make sure that you actually have the same controller in the world
like, do i not need to separate the input and movement like those guides said?? bc if i do it like this my character blueprint is empty
Print string something after hooking up the IMC
What guide? Everything is based on context
For me it's fine to control movement in the charactee
A humanoid character can perform walk
While a helicopter can fly
yeah but i wanna do it this way bc i'm gonna have more than 1 playable character
Then you handle the input in the character not the controller
but shouldnt all the characters be using the same controller?? so the input still stays the same even if you switch characters??
You can do that too
I would create event dispatcher in the controller
And any possessed pawn can listen to it
And can perform different move logic accordingly.
isnt that what those red IA nodes are
so everything should alr be set up correctly right??
"correct" would entirely depend on the goal, there are many ways to do something. The best thing you can do now is to just learn all the tools at your disposal;
handling inputs in the controller is common too. Like you don't want to handle pressing E for interact in the character. What if you want to transform to a robot which can also interact? redoing the logic is redundant
so if you have multiple characters, you can handle input in the controller and dispatch an event where anyone listening to it can respond
When they have time? I would say it's a drop what you're doing and read now type of thing lol.
I wonder how many weeks deep it will be before i realize dropping GAS for custom implementation was a bad decision and not a good one ๐
is applying gameplay effect replicated internally, or it's just gonna be applied by the machine that calls it?
hmm I guess it doesn;t but since attribute is replicated, client will get the value eventually.
I still don't understand how can I do server validation using the prediction key and reject
really wish there is a sample code ๐ญ
Whoever told you this hates life, and does not actually understand how the PlayerController was written. Inputs shouldn't just go in the player controller. Inputs go in the Pawn if it's related to the pawn. Consider a very simple case. You have a human and you have a car. You need to possess one of these at a time to control them.
The primary question to ask is, why should your PlayerController care what type of pawn it's possessing? You have to ask that because car controls are going to vary greatly from a humanoid. So much that you should literally have a separate set of named controls for them that people can remap differently.
You would already have a giant mess of input routing logic in your controller for just Humanoid and Car. Now consider adding in Boats, Planes, Mechs, or any other type of specialized control set. And we haven't even talked about special ability controls such as a car also being a semi that can attach and detach trailers, or a plane that has weapons, etc. Your Playercontroller would look like a nightmare.
Instead, these control sets should go where they're used, the base class of your types. Humanoid, Car, Boat, Plane, Mech, etc. The only inputs that should go in the controller are super generic inputs. Like showing an escape menu or something. And there's a lot of us that even argue this, and put it in UI.
Should poke people repeatedly in the GAS channel for that. I haven't done much prediction stuff, so can't help there. ๐
๐ I've been there. I think in any case you'll understand GAS better by going your own way and will be able to decide whether it is good for you or not with much more confidence in the end
then if you have deadlines, that's another story
I went GAS. Never looked back. ๐
It feels like a behemoth ๐
I got it in another long term project, and spent weeks setting up attributes and calculations and whatnot. Bunch of boilerplate stuff just to get it up and running
Bah in the end, for my solo game, i went with GAS and I am now very happy with it. But there were times where I doubted it. It's very complex and takes a while to be proficient with it. Then when you get there, I feel like i would never want to go without it
So does Unreal, but here we all are. IMO I wrote my own little ability system before I got into GAS, and I just repeatedly fell into the cases of "GAS has this.. and they did it so much better.". Kept trying to mimic it and ended up with a zombified version without half the features. ๐ It got deleted.
Thats prooobably what'll happen to me aswell in a few weeks
I can already see elements of it , and i've justgotten started
I just mever reached the "oh this is soo good" feeling with the setup i got with GAS as i never got to the actual using part of it
So i just had the work, and none of the rewards
The other major upside to GAS is that you get new features without having to write them occasionally. Other people understand your ability system so they can help with it. And you get easily transferable knowledge from project to project.
What kind of game are you making with it?
Yeah it makes sense to use some common tool when avaliable really. Having some new person dig into my code would... be interesting ๐
Its a turn based game inspired by a very old ps1 title , "Azure Dreams"
wdym by put it in UI, you don't mean like bind the menu action key to a ui through "listen for input action" do you?
because that sounds like a wild implementation, totally agree with everything else
Planning on introducing some multiplayer elements to it, but should be fairly simple to do since its turn based
You can do that too. I use CommonUI's action router inputs. Allows you to have UI inputs without relying on the controller or focus.
where do you store the reference to the UI
If you put your game in UIOnly or Menu mode, you lose the controller. Which becomes a problem with the ListenForInputAction call since that's all it does is create an input component for the controller to use.
How do you mean?
I always have my options menu created and opened/closed, in the player controller. I guess it's not that hard to get a reference to a UI, but wouldn't it just be so much easier to handle it in your player controller
I didn't know people were going that far
bought my ticket to final fantasy concert today
No, in ๐๏ธ
๐ฆ๐บ but like the most remote city
we're never gonna get to see your 15k actor crop out game </3
๐ it's a little delayed lol. I need you to complete your plugin first ๐
take me weeks just to do a basic attack combo... even now there are still a lot to be desired
I'm so over that plugin, it's always one final task...
Gosh im jelous rn, can't lie about that
if you live in a state, probably just look out every now and then. They go around the world pretty often I think.
The idea is that your controller, or even HUD doesn't need to know about your UI at all. No reference needed. CommonUI has a thing called a CommonActionRouter which handles inputs early on before UI or gameplay does, so it has a chance to catch them. The widget itself registers an action, and the widget handles it's callback. No need for anything else to know about it. Not even the action router really knows about it, just the registered callback for the key.
Cant justify travelling half the world tho
Norway ๐
They'll never come near us, even with a pole lol
@gentle urchin The living legend Nobuo Uematsu returns to Sandefjord, the Pixel Capitol of Norway, with a concert at Hjertnes Kulturhus the 5th of November!
I should really learn about CommonUI, I'm so contempt with the regular UI system it's hard to accept change
not sure if that's real
I'd be the college professor still teaching UE 4.27 when UE5.5 is already out
Damn thats reallly close
Stavanger is ~1h drive with the new worlds longest underwater tunnell
Same, GAS is already an elephant to me but soo seeing many people praise Common UI, I felt like I will miss something important
have you tried it yet? do you like it?
I praise commonUI, and got it as base for many widgets, but not gotten around to actually try/use it ๐
Praise based on other peers praise I guess ๐คฃ๐คฃ
Maybe we should take the leap
the time for inventory will come very soon. I think I will have to start touching list view
think I've used listview once, I made cards against humanity online, complete with steam workshop, youtube music sync, and cardset generator. I never released it on steam because I'm afraid of getting sued
Im lazy, stick with normal one
I should post it on github for free
It's totally legal to release the source code of a non profit game for learning purposes tho
Ill get on the inventory after this ability system is wrapped up. Probably a pretty straight vertical box filled with SlotEntry widgets
I should reallybjust make a reusable inventory with uobjects
So i dont have to repeat code ive already done 44 times
you are making me question my struct approach ๐ซ
Thats why i cant re-use them
All of them are struct based
Well
I can genericly structure the structs
So its less specific
Specially with instanced structs
As a fair note. There's nothing you lose by learning it. CommonUI all sits on top of the normal systems. And if you're not yet into Gamepad/Console territory, you can mostly just focus on the CommonButtonBase class, and the ActivatableWidget stuff.
ActivatableWidgets are like primary menus. They automatically change your control mode(GameAndUI, GameOnly, UIOnly) as they become the foremost activated. And they are required for the control bindings I mentioned before. And CommonUserWidget can register and handle it's own action router inputs, but they have to have a hierarchy parent of a CommonActivatableWidget Activated to use them because it only gives actions to the foremost activated widget's children. So that your inventory behind the options menu doesn't run it's inputs while the options menu is up.
Not to mention you get CommonListView widgets with working hover states by just using their button class as the entry widget. Doing those in normal ListViews is super annoying.
CommonVisualAttachment is really useful
Preset text styles are nice. Keeps you consistent with your UI, and makes it so you change literally one field to update every widget in the game if you decide you want that title text just a few shades brighter.
CommonAnimatedSwitcher is nice as well. So is the CommonWidgetStack container.
Kind of sounds like it makes it a lot easier by managing the whole "handled", "unhandled" returns when you'd override the "on button down" function or something like that
Atleast I'm hoping that's sort of what you're getting at, because that's the most annoying thing for me with UI currently is overriding a button in UI and forgetting to return the function properly as handled or whatever
And then sometimes there's a freaking massive hierarchy of wigets consuming input
Maybe it's just a skill issue
so you mean to say the default character blueprint setup in the templates is correct and i shouldnt change anything??
instead i should create a base character class and put the camera and movement logic there??
what about the imc tho??
Yeah. In fact CommonButtonBase has a thing called a TriggeringInputAction. if you set this, and you put the button in a common activatable widget, or in some other widget that is in a common activatable widget, the button will register it's click event to that. So you can literally just have the button's OnClick for both the hotkey and when someone actually clicks on it with a cursor.
Correct. I'm not sure what you mean by movement logic though? As largely this is already done for you in the character class via the CharacterMovementComponent and you simply call AddMovementInput.
Mapping Contexts tend to be overcomplicated in a lot of cases. If you have a set of mapping contexts that can work at any point in the game, you can simply apply them in your PlayerController's Beginplay behind a check for IsLocalController. You only need to register them all once. In the case of my last point you could register Human, Car, Boat, Plane etc all at the same time and just leave them there.
IMCs are filters and data. None of those control schemes above should share inputs. And even if they did, you aren't going to possess more than one of them at a time. So even if you have IMCs enabled for Human and Car, no car is going to just drive off if you press W while controlling a human, cause the car is not possessed.
Where you DO want to toggle IMCs at runtime is if you have multiple control setups that may overlap. A common case of this may be like a building mode. You're a humanoid and your left click activates an attack ability. But you enter build mode and your left click should now build something. So you apply a mapping context for building above human's where it will handle it's stuff first. And then when you're done building you remove this so that you can use all of human's controls again.
It's also worth a node that if you place InputActions in a component that is attached to an actor, that actor will register them as it's inputs as well. So you could put a Builder component on your human, and it'll register IA_PlaceBuilding for instance with it's own controls so that you don't have to muddle the human class with your building inputs.
Ok wow that's complicated
Input often is. ๐
Ok well if the bottom line is i dont need to change the default character blueprint then that's fine
I want to make it so my character can ride giant hamster
So if i dont need to put all that logic in the player controller, and even ui controls should be put in ui....then what's the player controller for lol
Bc i thought you use it when you wanna have the same inputs for multiple classes but you can achieve that with a shared parent class so like ????
PlayerController houses an InputStack. Which is an array of InputComponents. When an actor enables input, it's InputComponent is added to the controller's InputStack. When a player presses a key, it goes through some stuff and eventually arrives at the PlayerController, where it filters it through it's input stack where it delegates the input out generically to whatever actor the component belongs to that registered the input.
So all input does go through the player controller, but that doesn't mean you should stick a ton of input bindings in it. ๐ And yes you can achieve that with a shared parent class. Or even just make a component that you can drop into each one if parenting is an issue.
Man i still think this feature is way too overcomplicated
I keep getting conflicting info about it
Still dont know how to use it and it's been a month
@scarlet marlin you just got advice from someone that work in the industry, I would just believe him over other youtube videos
you don't have to go that deep into the technically imo
tldr, if you want to posses multiple characters, just implement the input in the character class
So....i dont need a player controller at all??
The core points are simply, if you possess a pawn, and that pawn has input actions, those input actions will work. And you'll have less issues with that, than you will routing a bunch of controls from your player controller to pawns specifically.
don't think controller like a playstation controller. It's more like the brain of character you are playing
Fuck i think im stupid
My entire player controller in my main testing project. Literally just IMCs registered for the local player.
And the interaction one is technically wrong, I need to move that. Should have went in the component I use for interaction.
Ok so basically just put the imc in there and nothing else
Haiyaaaa that couldve taken me 5 mins instead of a month
Yep. Then in your character, some super simple IAs.
Hello, I purchased a horror FPS project and was wondering how to add arms and a simple weapon system with a pistol. Unfortunately the creator isn't too responsive, but I just need to know how to add the Manny arms and a weapon. Any advice is greatly appreciated
Hey, I have a question about Physical Surfaces.
Why do I want to do this?
Because I'm trying to migrate some project, and it has its own surface types.
When migrated, it would read from the specified slots, instead of the actual name.
(ie it would look for "Surfacetype5", instead of "Water")
Meanwhile, in the target project, "Surfacetype5" is already some other value, which mustn't be "Water"
Please @loud vessel or DM me if you know the answer.
or if this is even possible.
In unreal engine on spawning the actor character in runtime, the actor is not moving but the actor that are already present in the level during editor mode are moving in runtime . Anyone know how to fix this issue ?
Only if you only ever want to spawn BP Enemy Base. If you have a variable going into the "Class" input of the Spawn Actor node, you want to ensure that the "type" of that variable is BP Enemy Base so that the return value will also be of type BP Enemy Base. The variable type defines what that variable can contain, and that can include any child classes.
You might need to select this. (In Class Defaults)
That's all I can guess.
ok so... i'm trying to set a data asset object reference default in a struct
and it just keeps getting reset to none when i restart editor
any ideas why?
absolute PITA while trying to migrate code from the struct to the data assets >.<
namely i set this in struct, i save it, close editor, expecting all data tables to update with the new default
but it just doesn't stick, resets back to none despite being saved (the struct) before closing the editor
It works thanks!
is it just the DA or other values in that struct also get defaulted?
the other values i had no problems changing in the past
im talking rn
try to modify them and also set the reference to the DA
normally things get defaulted when you edit the struct
like adding or removing or reordering
guess i can try changing the mesh, that shouldn't make the code explode
in theory
the whole struct is basically
in code form
Personally I believed there isn't a place for bp struct in unreal
you are in the middle of minefield
well this code has been developed in 4.26, i started working with it in like 5.1
and have been carrying it into 5.4, now NVRTX branch of UE5.4
Well, I saw someone with the same broken bp struct in 5.5 today
it will never be fixed
well... the static mesh stuck
wether it's related to your error or not, I would throw away bp struct
unless you are fine with silent error like unknown struct error
literary had a person with that today
and he is already soo deep with his bp structs it will take ages to replace them
Two notes, For starts I would NEVER default an asset in a struct. And second even if it worked it may not update existing fields, but may work on new ones.
but not doing so means he can't ship the game
that gets discovered in cook so im not worried about that
up to you
Need some redirectors. ๐
it's literally the core of the project ๐ i'm trying to get rid of now, it's not too bad as it's just simple fields that i need to redo into primary data asset format
but it's still a lot of code
and it's used everywhere
so right now i'm adding the data asset into the struct, so i can always access it
then when all the code is rewritten, swap out the "get data" function with the asset instead of struct
and after that, add it to an interface instead of a static function call
An interface instead of a static function call???
the get data function is in a static function library
wherever it's used, it will instead call AI actor interface
i didn't write the core of the code man
i know it's heresy
I don't understand though. Why interfaces to replace a static library function?
because what you have at the start is a data row handle
not the struct
so it always goes through a get data table call
so that part is put into a static library
i know :(
I can't even remember the last time I've used an interface.
why not tho
most of the time interface ends up being misused for the wrong reason
it's way better to keep actor instead of "some random BP that has unholy unspoken heresy in it" reference
especially people that listen to youtubers and "avoid casting, use interface"
it's time
@late gorge https://dev.epicgames.com/community/learning/tutorials/l3E0/myth-busting-best-practices-in-unreal-engine
take a look at this
It's also better to have a layer of code only classes that it doesn't matter if you have a reference to or cast to. Interfaces are a bandaid to most BP users.
a lot of time, people end up with a hard ref in their interface anyway ๐คฃ
i've seen this... honestly, not applicable, there's so many other problems with the game
There are actually very few honest good use cases for an interface.
and it still runs alright in the end
in regards to what? you should take a look at the casting vs interface myth
30 fps is doable, mostly bogged down by the ABP anyway
how does fps come into this though
i don't have the time to deal with performance that will get me 1%, there's 3 core issues that will get me from 30 to like 60, swap the ABP, swap the item struct and AI struct for data assets, there you go, easy peasy, i can deal with minutae later
Interfaces vs casting has nothing to do with fps unless there is a structural problem due to linkers. If you're having problems with memory that cause FPS issues that an interface magically solves, you need to rethink the core structure of your setup and why it's causing linkers you don't want to load enough that it causes problems.
it's not about performance...
minutae of performance*
you will have debugging nightmare
yeah ok try being the only coder on a project, this stuff really brings nothing to the table, so long as it's not breaking, which it isn't
have you profiled so see the cause of you're performance issues?
yes, i literally pointed out the 3 things causing the problem
abp
I mean, that makes it all the more important not to obfuscate things and to keep separation of concerns clear.
and structural code issues that come from having convoluted structs
for both ai and items
other parts of the code that use far shallower setups (or data assets) have been running with no non-logic issues
but logic issues are PEBKAC, not engine problem
my man, it is 1 interface call for a core aspect of the project, i don't think it'll kill anyone or anything to grab the core data from the actor and have that implemented only once
instead of something like... 200x
either way, i'm familiar with what you posted about "myths" of best practices, i've been using the profiler lately over anything else as the code is what it is, it's stable where it needs to be
but now that combat needs to be improved, the festering swamp has to be tackled ๐
it's not about performance, but you do you
it is about performance to me, i dont give two hoots about the structure of the code, like i said, single coder, i know the code in and out
well, we said our piece
would obviously care if in a team
it's apple and orange at this point
true
Youtube craps... no one have the code to calculate direction?
game math people ended up helping me
Matt Aspald btw
Calculate the direction of a dodge?
Yea based on the input direction
someone and adriel already worked it out for me
Im just soo mad with some youtube tutorials
O.o Super weird. Would just get the axis values and zero the Z, make a new nornalize vector out of it. Then it even works with gamepads.
Transform it into the character's local space and viola.
ended up needing 2 vectors, the reference vector is the camera forward vector, the other being input direction vector
Well. From the camera's space, to the world space, then to character space.
In terms of performance, interfaces are actually slower. Granted you'll only notice on high loop calls. Just something to be aware of.
Lol, booleans though. Imagine only being able to dodge in 8 specific directions with a gamepad. Sad day.
I mean, he didn't know the logic to calculate for the direction
whos gonna roll with W A S D?
Wouldn't it be handled in a similar way to movement, adjust based on the forward/right vector of the character/
it'll be an init only call, that's why i'm saying it really makes no difference, after that it's a variable on the actor
Hey everyone, sorry if shits rude sending a message during an active conversation but trying anyway. I have a question about in-engine performance.
I've been completely happy with my machine and the way it handles the editor. (64gb ddr4, 12 core ryzen 5900x) compiling times are fantastic.
I'm working with my player character right now and if I add 21 skeletal mesh components to it, compiling time goes from an easy 15 seconds to a solid 5 minutes.
That makes sense, ya? I know that's an odd amount of skeletal meshes but before I go coming up with a different approach than using 20+ visible/hidden meshes, I wanted to make sure that it's not likely something else is going on.
compiling blueprint?
Yeah
well, I never try adding 21 skeletal mesh component
but 15 seconds to 5 minutes is pretty crazy
I got the last movement input vector from character movement component
then I get the angle between what im looking at (Cam forward vector) and that input vector
Hah, yeah that's why I'm looking for advice. Uncharted waters for me too but the amount it tanks seems off to me. Even closing a test play, there's a noticeable delay in the engine coming back responsive
Why not use 1 skeletal mesh component, with 21 skeletal mesh soft references, only loading the one you need?
What's the use case here? Sounds like an XY problem
Skeletal meshes are expensive. Why do you need 21?
I'm using the Astronaut Soldier from B. Maksim (are links allowed?)
There's the full mesh version with all the details and pieces of equipment all in one skeletal mesh but he also has a base model with all the attachments separated. My plan is to make each piece an upgrade/equipment.
I considered making unique skeletal meshes with pieces equipped but the combination of different parts... would really love to have it as extensive as it seems it could be
i understand now. i thought i could use some shortcut to spawnactor from array. maybe too early for me
So instead of loading all components at the start and using visible true/false to handle "being equiped", you're suggesting spawning each piece only as the player needs them?
You can spawn stuff from an array of classes, just the "Type" of that array should be BP Enemy Base. That will allow you to add several child classes to that array. You can then loop through the array, or use a "Random" from the array to get a random item from the array and spawn it.
Yes. I'd also reccomend looking at Epic's guidance on modular characters
Skeletal mesh merge plug-in, per the article you sent me, is exactly what I need. Thank you
But of course, there's always a catch. Material slots get ruined when merging skeletal meshes it seems. Each mesh looks like only gets one slot and assigns the same material to each mesh.
Hi guys
Iโve got a circle spline (not closed) of 4 points and based of a mesh density int varaible I do the math and Iโve got an equal amount of distance along the spline where I add my spline meshes
from this distance I use get location and tangent at distance
location looks correct but the tangent looks off like itโs not follow the spline but more a default tanget , is anything i miss?
default 4 points the tangent looks correct, at 8 you already see some wiggle, at 12 ... it went bananas
I am using many actor components for my systems to make them modular. Is that okay?
may be worth to take a look at mutable ๐คท
tho it's in very early development stage and there's not much documentation around
5.5 only, yeah?
Thanks- ill look into it for sure. Test it out in a different environment and if it does the trick... guess I'll be updating my project. What could go wrong? ๐
apparently it was already in 5.1 (and is in Beta since 5.5)
however, given there have been plenty of fixes, i would probably stick to the 5.5 version
Yeah I just saw legacy sample projects in the github you linked
It does seem to handle exactly what I'm trying to achieve and the procedural abilities really opens some doors. Thanks a lot
For sure. Composition is a primary design idea.
Hi, I need help with an issue. I have a function that converts the mouse position to a world position, and it works fine as you can see it works fine when I run it every tick. However, when I use it during a drag-and-drop operation, it doesn't work as expected
Are you using the PlayerController calls in that function? MouseCapture can mess up with that.
yes
Yeah. Sec
Can you replace that with this and see if it works? Foggy memory.
I will try
I converted a type from UObject to UPrimaryAsset. I was using TSubClassOf<T> in a custom C++ method, but now I have object instances of T. Is it possible to go from an object reference of the UPrimaryAsset to TSubClassOf<T>?
Example:
URaevinInventoryItemInstance* URaevinInventoryManagerComponent::AddItemDefinition(TSubclassOf<URaevinItemDefinition> ItemDef, int32 StackCount)
URaevinItemDefinition is now the UPrimaryDataAsset (was UObject)
So now, in the BP, I have an array of URaevinItemDefinition object instances instead of URaevinItemDefinition class types to pass to that method. When calling GetClass, I'm just getting the base URaevinItemDefintion class and not the actual child asset.
I think it has to do with the internal mechanics changing, where now different assets are no longer child classes, but I am not quite sure if there is a conversion possible the way I am trying to do it.
Without converting the method to just accept pointers instead of TSubclassOf, of course. Basically I am trying to avoid modifying the method if possible.
Hey everyone, how to setup like an item affects the thing that its inside of?
For example, I have a lever, lever will start the train when interacted, so how it should be technically setup? BP_Train should add Level as child actor or smth? Since train is moving object, i need to add lever in somehow train.
Lever should contain a general Activate function IMO,
Level holds a reference to the train in an instance editable variable.
Player calls interact interface on lever. The lever than calls it's activate function/interface on whatever is held in that reference.
Yes, but where should lever be placed?
So the plyaer says "Lever I want to interact with you", and the lever says "psst, train, wake up!"
Since train is a moving object, should add it as scene actor or smth?
whereever you want to interact with it?
and since you probably want it to move with the train, it needs to be a child
not a child actor component, just parent it in the outliner
No, i mean phsically. I am new to Unreal Engine, but i am a Unity developer. I dont know how hieracically work in UE in those ways
lol, is this even possible? What if i wanted to spawn the train? How should i add lever to the train
The same way you can parent gameobjects in the scene and have them move together, you do the same in unreal
in that case, I'm not sure why a train would spawn instead of being there active in the level, but have a Vector variable on the train that you use as the level spawn position. Then in the train's begin play, spawn the lever at that location
Hmm, so BP_Lever reference will be defined in the instance of the train right? I cant define it inside the blueprint directly.
Nah, I asked this for future actually if i would needed to learn. ๐ Thanks for your effor
So normally, In unity, I would make the Train as a prefab, then i would add lever component inside of it in Unity.
But i cant do that as in Blueprint class, but in the blueprint instance in the level right?
It depends. If you're placing a train in the level at design time, then just also place a lever and parent it in the scene outliner. That you have to do in the level itself
If you're spawning trains at runtime, have a location variable in the train, tick "show 3d widget" so you can move it around in the bp viewport, align it where-ever you want, then use that variable as the spawn position for the lever that you spawn on begin play. This one can be done in the blueprint class
If i dont spawn BP_Train, existing in the scene, But could I parent lever inside the blueprint directly? Not in the level scene, but directly inside the blueprint? I think thats why i wanted add it as child actor, but i dont know pros and cons of it
Like directly adding here the BP_Lever, I dont know if thats the good way either.
You can't place an actor inside of another actor in that way
An actor can have actor components added to its default class
You can, however, attach a lever actor at runtime (PostInit components or during begin play)
If you'll notice, each one of those items underneath is a component and not a separate actor.
No
But again, at runtime you could spawn a separate actor, then call AttachTo and attach it to the default scene component or wherever. That's where the vector is coming into play that keeps getting mentioned.
You would have to set a position in the train, then spawn and attach the level
I'll show you rq
Hmm, so whats the best practise here? Should i add it in the level directly? And if so, DO i need any parent for that to make it visible? What would you do to add BP_Lever to it? Directly dragging into the BP_TrainPawn in level and reposition it, do i need to create seperate parent for it for hiearchical organization?
Thanks a lot of your time guys. โค๏ธ I have never thought that i could drag and drop in the instance of the blueprint. I dont know if thats called correctly. The blueprint existing in the scene called BP instance right?
Thats the one called in the Project folder?
SO this one i can call instance, but after I click edit BP_TrainPawn, its now the class itself? I will need that info for future references. and to understand the differences. As i guess, when i click "instance editable" of a variable, this means i can edit in the level. So i think this BP in the picture is Instance of the BP
Thanks, thats much clear. Did you use "Scene Component" to set position? Would this be looking in the hiearchy like we parented then later to debug?
I mean is this the same process, like parenting in the scene in edit mode, and spawning in runtime.
Yes they did
It's a helper, to make sure of the correct placement when generating / attaching at runtime
Like this for example. ๐
Good evening,
Is it possible in Unreal to find objects in the scene based on their size in units and assign them a tag? For example, write a Blueprint that finds all objects that are only 1-2 meters/units tall and gives them a tag of my choice? I'm asking because I'd like to replace all my greybox assets of a certain size with my finalized modeled asset. (I'm not very well-versed when it comes to Unreal, so there might be an easier solution, but I'm currently stuck on what I should google.) I look forward to your responses and thank you in advance.
As like, only an editor tool, right?
If so then you might be looking for an editor tool / plugin.
Or maybe with python scripting? Never messed with python to know if that is possible though
You might be able to create a BP editor extension. I haven't looked personally, but maybe google that
Thanks for that either. There is two option for me.
- Lever should know about Train, and call its Start function when interaction interface called by Player
- Train should know Lever, and listen its "custom event that fired when player interacted via interface"
I dont know which way is better though.
Should super class know about the little one, or little one directly knows about the super one and call the method.
What way would you guys prefer for scalable? My train will have a lot of interactables inside that affects the train.
Thank you for the fast reply ๐
Yes, I only need it in the editor, not in the game (or build). I saw someone using an editor widget to spawn assets, and based on that, I had this thought that maybe something like that would work to go from graybox to "final version" of the asset fast by using the asset sizes. But while blocking out, I was a bit messyโthat's why I think I need to look for unit size in the scene. (googlin Editor widget filter by size was not successfull-unfortunately)
Level shouldn't know about train. Lever should hold a general reference to something that it can call activate on.
Then you could use the same lever to open a door, or activate the train
- Lever will implement Interaction interface, then call OnLeverActivated, Then BP_Train will know about Lever, and bind to the OnLeverActivated event, and start/stop the train.
I can go even more complex and instead of directly knowing BP_Lever inside the train, i know about interface of it, like ISwitch etc. so that i can use it for lights etc. IDK. ๐
This is what I described, however the train is not binding to anything
the lever is calling an interface on the object it holds a reference to
the train is implementing the interface to get moving
a light could implement it to turn on
a generator could implement it to provide power
a door could implement it to open
Aha, so the lever will hold reference to "Actor" for example, then call its interface of it.
Player will interact with lever via "BPI_Interaction", then LEVER will get actor reference -> Call another interface method like ISwitchable etc. Am i correct?
indeed
if you wanted to make things even simpler, the lever could also just use BPI_Interaction
I wouldn't personally
Thats much better than train knows about lever and listening. So that every interaction in the train can reach Train via an interface, make things modular.
Problem:
Iโve got a tree actor (BP_Tree) thatโs like a parent dragging its kids (logs) around. The logs are always there, invisible, and just vibing. When I chop the tree, they suddenly "wake up," become visible, and start doing physics parkour.
What I want:
When I press "E" on a specific log, I want just that log to vanish into the voidโnot all the logs, and definitely not the whole tree. (No collateral damage to the other logs or the tree itself.)
Whatโs happening:
Iโm looping through the treeโs kids to find the right log, but either my logicโs broken or the logs are conspiring against me. Im trynna wrangle these rebellious chunks of wood

You mean train will implement IInteraction interface, and lever will access via it? Now another question is born for me, unrelated to your suggestion.
Assume my BP_Train has "BPI_Interaction", and it has a lot of static meshes inside, Since I "line trace", which one it will find? I mean since line trace is called on "Visibility", how would my train react? ๐ For every static mesh that has collision, would it call interact method? @thin panther
Unreal 5.5 or earlier?
5.4
are they child actor components or just other actors which are attached to the tree?
or rather, show the hierarchy of the tree BP...
it's already showing in the image
nvm
i was distracted by all the images
i don't get why you iterate over GetAllChildActors in the first place
This is my basic Interaction setup. Would it be called for every static mesh with collision inside the BP_Train in train would implement BPI_Interaction?
it looks like you should be able to just iterate over the components of the Tree Actor to find the log
Theyre child actor components, clinging to the tree like overprotective toddlers refusing to let go of their parent
Also my logs are technically part of the "BP_Tree" actor as child components, so when I interact, Im basically hitting the parent actor and itโs going, โOh, you mean me, right?โ Theyโre like kids hiding behind their momโs leg, and all Im basically getting is, "You talked to BP_Tree"
The issue is that the parent (BP_Tree) is hogging all the interaction attention. I need to dig down into the logs themselves like telling the tree, no, Im not here for you, Karen, Iโm here for your kid!
and then DESTROY the kid
destroy all kids, one by one
either you only show us half of whats going on with the child actors, or you are misunderstanding what they are
that doesn't show any child actor components...
BP_Tree is the parent, child actors components are these static meshes contained into BP_Tree1 and BP_Tree2
correct?
๐คท doesn't look like it
why?
can you just skip the first loop and check if that changes anything?
sure
There are no child actor components in your BP_Tree actor. These are all "Scene Components". The "Get All Child Actors" executes the following in C++ which looks specifically for "Child Actor Components" and returns the actor references that they contain.
void AActor::GetAllChildActors(TArray<AActor*>& ChildActors, bool bIncludeDescendants) const
{
TInlineComponentArray<UChildActorComponent*> ChildActorComponents(this);
ChildActors.Reserve(ChildActors.Num() + ChildActorComponents.Num());
for (UChildActorComponent* CAC : ChildActorComponents)
{
if (AActor* ChildActor = CAC->GetChildActor())
{
ChildActors.Add(ChildActor);
if (bIncludeDescendants)
{
ChildActor->GetAllChildActors(ChildActors, true);
}
}
}
}
So when you call the below code, the array is going to be empty as BP_Tree contains no child actor components, so then the loop doesn't execute at all.
are you going to test without the first loop or not?
because there's like 20 other things which are wrong on many levels in your BPs...
also skip that branch
go directly to the 2nd loop
k
I know this branch is kinda useless tbh
It's just skipping the macro entirely or finishing off too quickly, where I can't even go inside of it
yea didn't notice another thing
from your actor reference drag and do get components by class then select StaticMesh component
and use that array as input for your 2nd loop
oh wait a second, I didn't have something connected that's why
it wont work either way as it is in your screenshot
yeah
that isn't possible
ehm, use BP Tree as target then
no idea why your actor reference is an object reference...
my component reference is also an object
ok i changed it
select StaticMesh component?
you mean get it?
i need both the split and not split vector here.. surely there's a better way of doing this?
select static mesh component in the drop down
you target actor is the BP Tree variable
and in the drop down you select actor component classes, which static mesh component is
4 logs but all are this static mesh
ok, so i'll try to use that one, right? it should work i think
no you are going to click the drop down button and seach for static mesh component and just select that one
then you plug the array to your right for loop
If only I had the quick gif edit skills to replace that with sm comps
no, that's not an Unreal issue, for certain...
you still have NOT selected static mesh component in the dropdown
ik but this server only has so few emojis
which is considered a war crime
it should have over a million emojis to select from
also you got the wrong node btw
OH, you meant LITERAL "StaticMeshComponent"
you got get component by class not get componentS by class
yes
i haven't even started, we are just fixing that one macro...
and just because it may work, doesn't mean that it's done or correect
so test it
IT WORKS
now let's start with your macro tho...
1.) when destroying/deleting something which modifies an array, it's a good practice to do a reversed for each loop because otherwise it may skip elements (in your case irrelevant)
2.) when you iterate over a array which comes from a pure node, the pure node will be executed EACH array iteration, so ideally you cache the result in a variable, especially as no one guarantees you that the array will always be sorted the same way (not that bad in your case, but keep it in mind)
3.) you know you have only one entry which will match, so once you have a match you can go straight to the output and stop iterating over the left over elements
now about your player BP.... all the tree/wheat and whatnot logic should be in the actual blueprints where they belong to, otherwise your player BP will become one ugly mess (I guess it's already to late for that....)
so wood chopping stuff goes in BP_Tree
wheat harvesting or whatever YOU do with wheat goes into BP_WheatPlot
you should read/watch some tutorials about how to make interactive things, i can't recommend anything specific tho
iirc Unreal Learning portal has a project for that kind of stuff
so my blueprint setup in regards to those..... https://www.youtube.com/watch?v=QJHUbtR0yI8&ab_channel=fazlee
yea, but more of the later
sometimes Im doing that logic in a seperate blueprint
sometimes Im doing some of that logic in the character
but mostly it's a combination of both flavors into my ice-cream
thats why im using macros and functions
I like to have everything in one blueprint though
Things should be responsible for themselves and should handle what they do. You do sometimes need to communicate to another thing, and ask that thing to do something, and at that point, you should basically be handing it over to that other thing to do whatever.
so that I don't have to search for the needle in the haystack every time, all in one
your player BP is going to become a barn full of hay if you continue like this
Yea, better to put the haystacks into separate piles at least ๐
Im used to the clutter
But I'll definitelly look more into that
in the future
the reason why i don't do each thing on a seperate blueprint is because sometimes I don't know what logic is where
and it's hard to find stuff, and I consider character blueprint good for all that kind of stuff
macros, functions, etc.
they help make everything compact
Encapsulation and separation of concerns
As Datura says, let every thing be responsible for itself
PlayerPawn has no business defining how an ability plays out or what swapping inventory slots mean
Hardly even UI has any business there beside informing the Inventory that X and Y should swap places
Inventory handles the actual swapping. And informs the UI through a delegate that something changed
This makes it trivial to find sources of bugs
I tried that and I have already inventory items, but I couldn't interact with Child actor components inside of another actor for some reason
"Oh. Inventory bugs out. Better check the inventory component!"
cause you have a misunderstanding of child actors
A inventory is in essence just an array
With some helper functions
Anything about an inventory is litteraly just managing that array
for example, I have fruit static meshes inside of a tree, they drop like components and then I pick them up as components and destroy those components and add them to my inventory from the character
If I were to do this with child actor components I would not be able to enable physics from bp_Tree
it's not possible because this node doesn't work with child actor components
same for set visibility node
and I can also outsource that logic into the child actor component BP itself
but still it will not really work for some reason
And inventory items may have data that lives inside a generic ItemComponent, but the component itself is merely a vessel for that information, and should be dropped as soon as the actual Inventory gains responsibility of it
Child actors make toggling physics and visibility a pain, so I stick to my messy but functional system for now. I'll organize... someday
maybe soon if I find how those pesky child actors work
Child Actor Components contain a reference to an Actor. That's about it.
Amount of work to sustain broken system > refactoring and further working with a better system
yes
try from another actor to enable physics of those child acotr components
it will give you the weirdest error you've ever seen in your life
I can try it and show you and you will not believe in your eyes
I dont trust CAC to do anything tbh
I don't trust CAC at all..
but whats the alternative? Do I just give up on child actors and start using magic instead? @gentle urchin

Worked for me no problem.
wizard indeed
Snap
What type is this child actor variable?
The first one is a Child Actor Component. The second one is a reference to the actor that the component contains.
ok so I guess, this "Get Componet By Class" will be my favourite node from now on
It has its uses.
I thought you have to plug in there a blueprint class which you created rather than the generic type of your Unreal Engine component class, like "StaticMeshComponent"
This is what I used to do in the past
,,instead of using that node
and perhaps this is why it didn't work @spark steppe โ๏ธ๐ง๐ทโโ๏ธ
maybe C.A.C.s aren't so bad after all
No, they are outside of extremely simple cosmetic uses
Hell, they're referenced in this
THE KERNING
It should be the bible for new comers
I love how they're using memes there to explain everything in meme terms for the late millenial - gen zers to understand.
Anyone used PCG for railroad tracks? Instead of constructing via legacy way (adding spline component, constructing via spline mesh component etc.), I have tried **PCG **to create tracks, but on when spline is rotated, it looks like this.
And here is my graph, Spline Sampler is set to distance and its distance is exact distance with my mesh.
I could be wrong but it seems like PCG wouldn't be able to stretch and deform things, maybe if you spawn actors and you told those actors to stretch?
PCG is pretty much just data points
your static mesh spawner is just spawning it at each data point
Turn on debugging and visualize the points to see what needs to be adjusted
Yeah, I think i need to calculate tangents or smth to make them merged. In legacy way without PCG, It works fine since we calculate them
Like this way, I need to find somehow apply this in PCG if its possible.
Maybe with an attribute filter
or a blueprint PCG element, where you manipulate the transforms at certain points. I'm very new to PCG, so there might be easier ways to do it, but that might give you something to investigate.
Maybe a start here. ๐
hello all, I am starting on my first project with the volunteer intern basis indie game studio startup i do work for and i was wondering if anyone had any pointers for a time manipulation ability system for enemy AI for a specified duration of time within a level. i am very new to blueprints and i also have a rough time understanding them
So, hereโs the issue: Even though I destroy the fruit, the game somehow lets me keep pressing 'E' and magically collect fruit out of thin air as if im on an . itโs like the tree's playing an endless prank on me, "You think you're done? Think again!" Toooooooo much food. It would be too easy.
The player would die of some kind of type 2 diabetes.
Get rid of get actor class
Surely you are not planning to only have one tree in the world
And even if you do that's just a bad practice
and how could i make this more dynamic?
Dynamic in what sense?
I mean, how could I make this better?
If this is interaction, you want to handle if the player can interact, and if it can, get the interacted actor and the interactor actor can do its implementation
E.g an apple tree drops an apple
A door opens a door
Etc
My suggestion would be to first work on your interaction system. I will use actor component for the job.
I already have an interaction component and I also have these which work with the inventory system that I already have
If your goal is to be the gameplay programmer then you should get comfortable with OOP. Ability system is a pita, to work on If you just started. Most people would use what epic provide for fortnite to go around their ability system #gameplay-ability-system .
But without knowing basic blueprint or programming principle you won't get far. I suggest to go watch the first few hour to unreal and blueprint communication video by epic.
I dislike interface and would use component instead but Ur call
Btw what's all those macro..
You don't check if I hit coconut or hit apple tree
That's terrible, make it generic
You just want to say, ok I hit this thing and I'm allowed to interact, do the interaction logic that lived inside the interacted actor
yes but not every item is an inventory item, and some of them aren't getting added properly into my inventory
I followed the Ryan Lalley tutorial and it was full of bugs
I'm fairly comfortable with OOP things, but one of the members on the team was thinking blueprint would be better for some systems, specifically the one mentioned. I'll definitely look into the resources mentioned with familiarizing myself more with blueprints though
Blueprint is OOP
If you already know any language then you don't have to learn blueprint, you can just use it right away
in a different type of format, yes. the different type of formatting is what doesn't translate in my brain
Well what programming language you know? The concept is 100% the same.
in what way?
the problem is they're not being added to my inventory properly sometimes
sometimes for example when I add wood inside, it gets added but it becomes invisible
if it were cpp hard code, it'd be easier for me to understand. the node system format of blueprint is what doesn't entirely make sense in my brain for putting what i've learned so far into practice
Already explained above, you are checking for what you are interacting with in the player character or something.
Like nested sequence of, if this is coconut tree do this, if this apple tree do that.
Please don't do that and just handle the implementation in the interacted actor
That's kinda hard to believe, transitioning to bp from cpp probably doesn't take an hour.