#blueprint
1 messages Β· Page 189 of 1
hm need to dive deeper into your screenshot
I am not sure if this is the right chat, but I got a question on UI blueprints. I want to make the UI to fit to the player's screen, no matter which ratio they have got. Is that possible?
if yes, how? I would love to know π
use canvaspanel and set anchor to this
You are a hero, thank you π
sure guys! np!
im still looking for my hero to show up π₯²
I actually tried to do the same. Didn't find a way up until today π
btw I don't find anything called Anchor in my widget π¦
I can only find that in the children of the canvas panel
If you do find one, pls tell me π
child of canvaspanel should have anchor
Ah okay, now I get it! thx
I have a blueprint that does an HTTP request, it's an event that I'd like to reuse, it has an on complete method inside of it, I'm wondering how-to reuse this blueprint?
use blueprint interface?
or if you want to reuse it on another blueprint just make it as blueprint component, to reuse just add it as component anywhere you like
Hello everyone
I accidentally made two dimensional loop in widget's pre construct
That blueprint code is too heavy for my computer I can't open that file I again (it's crashing unreal when I try to open)
Is there any way to stop execute that pre-contruct code so that I get my logic and optimise that
this bad boy disappeared for a mysterious reason. There is nothing to fix this except redoing the whole terrain?
HTTP requests sounds more like an UObject thing
I'd put it in a uobject, so you can use it anywhere
found it, this was the feature I was looking for
Have any links to documentation on this? I can't seem to access on complete event
I'm able to make an instance easily enough in C++ but I can't for the life of my figure it out in bp
Construct object?
Have any docs or examples?
Can you change the root of a blueprint at runtime? This is what I've tried, but that didn't seem to work.
Thanks a lot bud!
I'll be able to get the on complete event right?
the what?
it creates it in the same call i didn't know the whole context of the problem...
Idk what you're doing with the http request or in what way it's relevant to your code execution, but there's a bunch of ways you can do this. UObject, Blueprint (with interfaces), Function/Macro Libraries.
If your only intention is to reuse this function in several different places; I'd suggest a function library though. Might be a bit easier to work with.
Delegates in blueprint, or even better latent function in cpp so you have the fancy arrow
Changing any default components in runtime is sketchy
I poked at this some more and spawning UI items is at odds with doing careful UI design FWICT? Unless there's a way to spawn into placeholder slots or something. But yea, a little big of language level introspection would really help me tidy things up e.g. "get me all the BP variables (in this case UI widgets) and filter them by some naming convention, so I can bind event listeners and attach UI interaction states". I can likely model the whole piano/synth keyboard and control knobs in data structures and just bind them to existing UI widgets programmatically. So long as I can get a handle on those variables first :/
I'm trying to create something like line with splines so I can put mesh on it and then add nice animated material. Third photo is what I will try to achieve.
I have problem with a tangent I think? The mesh I added is a cube, when I use plane it's not visible. Any tips? These 3 weird things are what is basically drawn right now.
I need 1 point to be always on the same location, and by clicking I set end location for the spline and there it draws static mesh that I will put material on it. Does it make sense?
I see... Well I can do it in C++ if that'd be less sketchy I just thought that it'd be the easiest way to handle my item's different states. (Placed/Held/Dropped/etc) My alternatives I think are breaking the states up into classes, or just letting components go far away from their actor.
If changing it in C++ would be less sketchy tho I'll probably just do that. Sorry this is a bit vague, but it's a complex system. 
Ok I made it if anyone is interested here is code.
I think I have a solution, in case it helps anyone else. If you mark your parent UMG panel as 'is variable' in the designer you get a generated getter for it in the BP so you can iterate it's children at runtime π
Is there a built-in function to count the number of duplicate entries in an Array?
Ex) If I have an Array containing {0,1,1,2,3,3,3} is there a function that will let me input "1" and output "2" (because there are two 1's)?
Doesn't look like it https://dev.epicgames.com/documentation/en-us/unreal-engine/BlueprintAPI/Utilities/Array
I know it's been mentioned but creating a key widget and then creating multiple of that widget from a piano keys widget isn't difficult. You just add them to a horizontal box and add some padding. Doing it grammatically would be a lot easier. You could then dynamically change the length of easily.
An easy way to do it would be to sort the array. (i believe there's a node added in 5.4) and then find the index of the first time the number appears, then add 1 to the inputed number and find the index the first time it appears then subtract the first index from the second index and boom, you have you're answer.
Sure but I have use cases for other UI items e.g. control knobs and I want to be able to control the layout visually, not in code. Think what I have here will do the trick
You can call it on pre construct so you can see it in the editor.
Ooh, that's good to know! So you can create and preview dynamic UIs? Nice.
Pretty much. Just make sure you double check you haven't created any infinite loops though before you save and compile. π
haha, true β»οΈ π₯
Yea it'll just crash the editor. You can disable the pre construct from calling to fix it but it's an added inconvenience haha.
i'm asking this here because it kind of pertains to several things overall but like, how do you know how heavy or light something is on a computational level? like if i used the bare minimum needed to spawn a projectile then process dealing damage to an enemy, would GAS or blueprint interfaces be better, or a little bit of both? i'm asking here because i use blueprints for programming primarily and it's not specifically about one of the two, just what might be a better way of processing longer damage calculations and if one is just better than the other
You know by trying both, profiling them in a package, and judging which is better from a performance-maintainbility-usability standpoint.
Something super performant but that is super hard to maintain, and can't be used easily is way less valuable than something that costs a bit more, but is intuitive to setup.
The two you described are also not really equatable
Blueprint interfaces don't replace GAS, and whether you use GAS depends on what you want
It might be a bit overkill if you just want simple add damage, subtract health, but once you start adding armors, effects, AoE, buffs, debuffs, regen etc, GAS is a lot more valuable
yeah i suppose that's my bad, i was mostly offering either or because i've seen cues and effects used for damage calcs, same with interfaces.
Then yeah, it really depends on your usecase
but yeah if that kind of stuff is easier to do in GAS then i'll look into it a bit more, that's the kind of stuff i'm looking to add
Definitely GAS then if it's moderately complex
Resistances, cancellation and stuff is an out of box feature with GAS and whatnot
Want to add a potion that reduces damage taken by 10% for 5 minutes, it's pretty simple
There's a guide in the pins of #gameplay-ability-system that goes through the super basic C++ setup
Hey I was wondering how you could switch in between BGMs inside Data Table... the way I made my blueprint... I can`t seems to find a good way to stop the current BGM and switching it to a diffrent BGM... I use sound cue for multiple BGMs and switching them with Set Integer Parameter. I was wondering how you would approach to switch BGMs inside Data Table... cuz my brain is kinda fried right now...
I guess you need the following 3 switches ?
- A switch that does Play and Stop BGM according to Set Interger Parameter
- A switch that continues current BGM
- A switch that stops all BGM
@rain timber Hmm I am actually making a Visual Novel game here so I was wondering how you could change BGMs depending on the dialogue I have... I would want to control eveyrthing inside Data Table but there isn`t anything on the net...
No I am building it from zero although I take references from here and there
still new to UE5 and no programming skills
Yes but in this case u don't even need to spawn any. Have an audio component somewhere and just use thar
After all you are only playing 1 bgm at a time
mann i really dunno cuz i am linking my Data Table with my Dialogue HUD and when i use Play sound 2D there is no other way to bring in audio into widget blueprint...
i see so spawning isn`t used for BGMs that plays anywhere the player goes I guess ?
my VN has a FPS like game mode where players can investigate and such
the characters are just 2D in a 3D world though
yup something like that !!
but BGM works all around the world so guess no need to use spawn eh?
I will have an actor manager that handles the dialogues and audio
Here is this an overview on how I made my system
maybe some pointers on how to manage the BGMs ><
would be a great help... just started UE5 like 3 months ago so kinda noob...
Is there a proper way to do move on keypress? For example actor moving up using W key and moving down using S key. Any best practices and suggestions?
Thanks. Idk why I didn't think of that. Sometimes my brain works less good.
Well, it took entirely too long, but now I have Doors added to my randomly generated Rooms....
- Red boxes are "Chunks" of floor tiles that were placed next to each other before adding "Stray" tiles around them (this guarantees some usable area of floor space in each room)
- Orange boxes are "Protruding" tiles, which can later be flagged as room features, corridors, and/or sectioned off as secret passages
- Pink boxes are Doors
Should probably make my next step be "define what can be considered a 'Core' area in each Room", which should allow me to later apply Themes to Rooms and create somewhat sensible Core areas to fit the Theme. Ex) Dining Rooms should have things like tables, chairs, and chandeliers in their Core areas but not in their Protrusions
But idk wtf I'm doing anyways. I feel like disregarding all the existing algorithms and making my own generator was a weird choice.
Sometimes it's the best way to learn and even understand the existing ones. Making your own does mean it's better taylored to what you want. (usually that is)
Hello everyone. I don't know if this is right place to ask this, but does anyone have the issue with blueprint instances inside a level keep resetting their properties back to that of the parent blueprint? And if you do have this issue, how do you go about handling this?
Almost forgot to mention, this always happen after recompiling the parent blueprint
Should I use a variant of this for all input? Also for switching cameras or activating abilities etc
Simple little question here (and maybe a little picky/silly): While in the BP editor, if I move a node horizontally, is there a key I can press while moving to keep that movement ONLY on that axis? I think in Photoshop, if you hold the ALT key while moving an object in a certain direction, it will lock your movement to just that direction, so you couldn't veer off from a perfectly straight line.
Not sure, but I usually just "nudge" with my arrow keys until things are where I want. If my Blueprints are getting big enough that I need to drag things long distances, I'll generally find ways to convert things into additional macros or functions.
hey quick question how do I modify location of "Snap" grab type on VRTemplate grabComponent?
Hey can someone help me understand why this doesn't make my train move?
Crystal, thanks for your input (pun intended)
Ooooo I didn't realize that I could just select a group of nodes and move them with the arrow keys. For some reason, I thought that could only be done with a single node. That very well might be the solution I was looking for! Thank you, kindly!
Haha, glad I could help. Real talk though, ALSO don't be afraid to make more functions/macros. It'll save you a lot of frustration later when you need to come back and change things.
Yeah, I am coming back from a bit of a hiatus in game dev/programming and a ton of info atrophied, so I am having to relearn a bunch of stuff, functions being one of those. I don't know if I ever even messed with macros in the past (at least in UE).
Did your train have an "End Location" point on the VP?
If so, you could maybe try something like this? It doesn't have any additional custom events or anything and the clamp would be a good thing so the train doesn't go indefinitely faster.
At compile, you would set the default of approach to TRUE so that is can kick off
I recently had to do this for movement of a platform from point A->B so, in theory, it should be the exact same thing but with a different object.
Here is a video of the flow for mine going back and forth
Iβm using this pure function to get the end location
I'll read your message when I get back, appreciate you taking the time tho π
There is also Shift+W
That a nice new one as well! Thank you π
Hello,
I would like to know, how did we trigger an event or notify after an animation is over. By example, i have a hit animation, and I would like to put back to false the value at the end of the animation. Did it have a way to do it?
If I'm understanding the question, within the event, after the animation, set the boolean that is originally TRUE back to FALSE manually, you will have to make sure that the boolean is turned back to true at the start of the event though
hey everyone I've created a score system for my project following this tutorial.
https://www.youtube.com/watch?v=sAy-rCwJ8y8&ab_channel=TheUnrealCousinzzz
But sometimes my score goes to negative integers due to component begin/end overlap. How can I make a "if Score is below zero, set score to zero." and which component should I apply this logic to?
shows you how to give your character a score that you can change.
Want to support the video? go to https://francisbunker.net/
For instance, here, the value (TRUE) is set as a condition at the start of the event, the branch executes, and at the end of the execute, it changes the boolean value to FALSE. I would assume a similar concept would be applied in your situation with an animation
That sounds like a Branch situation
@somber latch no, what I mean, i have a c++ blueprintimplementable event, that I use on my Animation Blueprint for put the character make the simple hit animation, but it never comeback to the official state like you could see on this capture :
Ahh, dang, I wish I could help with this one. I will definitely be following to see if someone can help, though. I would love to know the anwer as well.
how is the branch being pinged back and forth?
or executed
So, the condition for the branch at the beginning is a TRUE bool, on TRUE, the branch executes through the body and at the end of the execution, it changes the condition bool to false which then causes the cycle to repeat, but on the FALSE execution. The event indefinitely cycles since it is on Event Tick
Another option, instead of interpolate, would be utilizing the Timeline feature. That would also give you a bit more control of the movement stuff in a similar and more accessible way
should I attach it to eventbeginplay
or what is the equivelant of Void Update from unity in Unreal
@south raven I believe Update in Unity would be Event Tick in Unreal. Event will be called on every frame
In the video you had shared, it seems like the guy uses EventActorBeginOverlap since it is running when the overlap conditions are met
It's a collision event so that way the game isn't checking for the "score" every frame, but only when then collision event occurs
Hey everyone, I have a quick question. I am currently building a Damage Component and I wish to create a HealingOvertimeEffect and DamageOvertimeEffect. Only issue is that I cannot use Timeline or Set Timer By Event in it sine it is a Function. Anyone has tips on how I could replace those nodes but still have it in my damage system so it can be easily applied to any Ai or player?
you can set timers in functions
Hi guys, I have an issue, when I drop an item on the ground and immediately pick it up after, it doesnt save that it has been picked up and after reloading the save it is still on the ground
its in event graph of my master item
Indeed but I cannot create custom event to my knowledge ! Normally, I would do something like this
there's another "create event" node where you can select an event/function from a dropdown
if you select that event in the dropdown, yes
why would you use a timer to begin with if you are going to create another loop in the event?!
what if I use event tick on VRPawn, if score is below zero set it to zero
smt like this
unnecessary
clamp the value when you update it instead of checking each frame
It would probably be better to assign a clamp
I've couple of different BP for example one of them improves score by 3 one improves it by 1
so I need to clamp each time I make adjustment to it?
it'd be better to just show, this is attached to begincomponentoverlap
the clamp will just set a min max, and you could assign that to the score. That way, it clamps what score can possibly be and it wouldn't matter what value you add to score. Make min=0 and max to whatever crazy high number you want it to be XD
Is this what you meant?
then either make a setter function which handles the clamp
or add the clamp everywhere where you update the value
it's a waste of CPU time to check the value each frame
no, you have to move the event to the event graph
and you will not be able to add a parameter to it, neither should you do it that way when doing it in the event graph, don't drag variables from one event input to another execution stack
Probably initialize the clamp through a setter on BeginPlay, so it only runs once the game starts and then adjust the score through the collision event
so I need to do this to VRPawn I believe
or any component that has the money reference should work?
Would there be another way to do healing overtime in a function then? Or do I realy need to do it in the event graph
what is wrong with doing it in the event graph to begin with?
If VRPawn is the actor that will be picking up the money, then I would create the Money var there and then for the UI aspect you could cast to the character to access the money variable and show on screen
Because all of my Function in my Component are done in the function and i would like to keep it this way but maybe it is not the right way?
Seeing things like this makes me really enjoy using GAS. π
Maybe I should do that too but I've never touched any C++
can i seperate left and right click events on a button>
Why can't I bind an actor component event to the parent pawn's possessed / unpossessed events?
This is a HUD manager component, basically I'm trying to have it remove some HUD components when that pawn is unpossessed and readd them when possessed
did you make a blueprint called pawn?
Nah I'm just casting to pawn because I assume that's where possess/unpossess are implemented
I can bind OTHER events like this, it's just possess/unposses that seem to be absent?
Hello, is there a way to offset this function? Currently it snaps on 0,100,200 etc. But I want it to snap to 50,150,250 etc
subtract 50 from in vect y?
Hey guys when opening and closing assets (whether it is blueprint, animation sequense skeleton etc.) it freezes the engine for like few seconds does anybody know the problem causing it?
Yea you would say so right, I tried, didn't work. Tried it again, it did work π Dunno guess I misconnected something
How can I animate a static mesh from this actor? It is a base blueprint that many other objects inherit from, and I want all to be animated the same way.
I just want an animation to loop going up and down, while rotating horizontally.
print in vect Y and see its valu
oh nvm u siad it worked lol
π Yea sorry, I rambled a bit π
Hi, does anyone knows if there is a way for a line trace to work only with objects in the same level? I have overlapped levels that are streaming at some point and I have some actor doing line trace, but they detect the unloaded level so is not working properly.
I originally used a timeline, however I had issues with it so thats why I'm exploring this interpolate option
Well, if you'd like to dm me or something I'd be happy to try and help you get this figured out! That way the convo doesn't get too lost in all the madness
Sure
https://blueprintue.com/blueprint/4yu1x-37/
Hey im trying to detect from wich direction im getting hit
but its not working ideas :/ ?
Hello and greetings, can someone explain to me why my life counter still shows the last number?
Do I need a custom event in the BP widget that calls the whole thing again and again?
You're only setting the text on construct, so it spawns with the widget and never updates
But don't worry there's other ways. Simplest is a binding function, lemme see if I can find a good example
ahhh ok so i need an updater? that will called in the player bp every time he dies?
So in your widget designer look for this, the "Create Binding" option beside text
ahh ok
That'll make a stub method that I believe gets called on tick to update that val. Mine sucks. Look at these four fucking layers of dereferences! This is bad code, don't be like me π
okok i get it thanks a lot grinning π
God, see how "Active Room Manager" has a "Current Room"? Make up your mind, past me! I code like I hate myself

Anyways, this is only one of two ways to do this. The disadvantage of this approach is it does get called every tick, which is probably fine if what you're doing is computationally cheap, but if you already have some event where you know that's when this value changes, you can PUSH the new value instead of polling for it on tick
okok thanks π
You can go with a Play Montage, that work perfectly
You can clamp from the detail panel of the variable. You should be able to see a range where you can set the min and max
i want to make it so as long as i keep pressing the mouse button it shoots with 0.2 sec delay like an auto rifle but in this configuration the first shoot is getting delayed. how can i make it so it delays after it shoots not before?
Set Timer By Event / Set Timer By Function Name
anyone else ever run into an issue where all float variables are permanently stuck at 0.0 and/or have idea idea how to fix this issue?
thanks! looking for it! π
refreshing the node and restarting the engine does not fix
Never in my life, describe your issue in detail. Are you setting the variable somewhere and it doesn't change? If so debug. Print string to see if the set even called.
Yeah 99.99% chance the fault is on user
yeah i print string when the variable is set and it shows the new number but when i reference the varable after its always 0.0
i even set it to set the variable every tick
ok i changed literally nothing and the issue is fixed
hey i need advice, im linetracing each loop from the event but its still not "fast enough" its making big holes
ideas ?
i think i broke the engine again
the game starts and z is pressed once what is the cube size
Does anyone know what is beeing usually used when you want to program something like maybe not procedurally generated terrain, but a terrarin that automaticaly asigns proper tiles when you are using brush for landscape? I guess this must be some kind of mesh that uses some noise to distribute itself on the edges. But what is the proper name for ''programming'' logic so the terrain know where is edge, where is inside and where is I don't know maybe like 90* angle? I remember something from unity where you could generate logic for tiles and you could then use brush to draw it, but in case of 3d what should I check? Any keywords what is used in things like that?
somehow its 11
those are all the set nodes shown for those variables
Z always triggers flase first key press
Set default value of Toogle Cube size to true
Do you want to switch the values etc. each time you click? Like you want 2 results from the same click but never 2 times the same?
You could use Flip Flop node that's first thing
so just take out booleans and use Flip Flop
is there any way to do math operation with bool input without connecting an exec. like if a value less than 0 multiply it with 2. first thing i can think of get a less than node and connect the bool out put to branch and set the operation on true and false branches. any way to do it easier?
Hello guys i am making notify system for my game, i have to make that the notify Go in a Vertical box so we have "list" effect, i have the Vertical Box in a widget placed in the BP_HUD, i have the event that throw the notify in another Widget(Menu widget, i m watching that child are created but does not display can anyone help me?
That's already simple to first check if something is < 0 to do something. It's good approach, don't overcomplicate π
Solved Guys don't worry!
added that but it still giving the same broken output
are you printing it and it always printing the same thing?
ok so if i print immediately after cubesize value is set it is 100 or 33.333 but if i print the value at a different time it is always 0.0 even though nothing else is setting the variables value
Yes many ways. You can turn boolean into an integer (1 or 0) or use the select node to handle it in a pure function way rather than with branches. Which there is reason to do.
so here i made with the branch, each spell has delay afterwards before the next spell is casted. i wanted to make it so if the cast delay negative it shortens next spells cast delay. if the first spell has -1 delay and the second spell has 4 second delay this makes it so that 4 second drops to 3 so the third spell only needs to wait 3 second instead of 4. but this configurations looks a bit complicated π
let me try it! thanks!
it worked perfectly! and looks cleaner! knowing the right node is everything!! thank you very much! would using this configuration might cause any issues in the future rather than using the branch?
Trace backward too, to fill the gap
There shouldn't be any issues; though as a side thing in many cases Delays aren't the best to use; but it depends on the particular thing and all that; no such thing as general advice imo.
When are you printing these things?
Loop happend in one frame btw, so it's nothing about that.
Your issue is the computer is simply not fast enough so you want to compensate that by tracing backward to the last capsule trace
Show how you print it
Usually handling it that way, rather than with branches; is better because that way you don't need to calculate stuff twice.
Like in this example; the math would only be calculated once; If you used branch it'd be calculated first on the branch, and then afterwards as well.
oooooooooooh
i had one of my test variables set to print for one of them
oof
i figured it out
thank you very much!
There's almost no engine bug in blueprint, it's pretty safe place to do simple operation like this.
Show your entire code next time if you want another eyes to check
it really was broken for a second
Doubt it
blueprints nice uwu, blueprints wholesome safe space; blueprints fast 
dis what my blueprint look like lol
That's just an image you find on the internet
LOL
Anyway to flip boolean you can just get the bool, plug it to !(not) node and set it
Don't use flip flop as you have less control
is it possible to add linear damping along a single axis? such as up down?
to what
you can't do that just with the physics settings for a collider
but you can do that with a constraint
or you can do it yourself on tick
Awesome! Thanks for following up with the solution!
You are welcome. You will just need to handle the attack statement, but there lot of tutorial on how to make it in Blueprint. On my end, I do it in C++ ^^
in blender there is a way to group nodes and duplicate it and use it else where if necessary, is there any way on blueprints do the same. like in the comment group, i'd like to turn into one node with selected inputs and outputs.
Macros or Functions
YES! Functions mainly; Macros rarely
Macros mostly if you want the functionality to have multiple execution pins
alright! lots to learn! thank you very much!!
is there a way to check if an object is being held by a physics handle?
just curious, but it's possible to add an actor component when spawning in an item from its actor class right?
tho it connects in the event graph it refuses to connect in functions or in marcos even tho i selected the same class in the input, what is the issue here?
Your "Spell Delay" variable belongs to a specific class. The return value from "Spawn Actor" return value is of the class that was passed into the "Class" variable. So if your variable is of an "Actor" class reference that you're feeding into the "Class" input on the spawn actor node, the return value will also be an "Actor" reference.
"Actor" references will never have any custom variables you make. In oder to access the variables you either need to:
A) Change the variable type that you're feeding into the "Class" input to whatever custom class has that variable
B) Cast the return value to your custom class that contains that variable.
are you able to point me to the right way to do this? I basically want to decrease how much an object can move on the up/down axis depending on its speed
a few pointers will go a long way
Hi.
I have a question regarding 'Export to Disk' node. I'm saving a render target and it works great in editor. When I make an android build, it doesn't work. It just returns false in the dynamic delegate. I already have the android permissions for read and write to external storage, and I have the 'Use ExternalFilesDir for UnrealGame files' checked.
I've tried googling but haven't found a solution yet. Does anyone know if I missed a step somewhere for android to allow the export to disk to properly work?
Is there any blueprint node to reload mesh?
Why? It wouldn't change anything
I'm trying to create a Editor Utility to re-load static meshes once selected in editor.
But again, why. What do you want reloading to do? You reimport and they reload automatically, and there's nothing else I can think of that requires it
Sorry, I might not have explained myself clearly. My goal isn't to go into the content browser to reimport the Static Meshes (SM). Instead, I want to be able to select multiple Static Meshes directly in the viewport and trigger a blueprint that reimports each of them automatically. Does this make sense?
Ah that makes sense, unfortunately I haven't come across a node for that. #editor-scripting might know though π
what do you mean by "how much it can move"
dampening would be "I want to add a force to objects based on how fast they're going."
i guess i mean dampening
hopefully im not too unclear
Are NPCs typically actors, characters, or pawns?
It really depends on what you need that NPC to do. A shop keeper that doesn't move around and doesn't need any AI Controller, probably just an actor of some kind. Something that would be possessed by an AI Controller, a pawn. Something that needs to act like the player in terms of movement, probably a Character so you can use the Character Movement Component.
I have a weird case that I am not sure what is causing this.
I have a UMG that is a list. So it uses the User Object List Entry interface.
In my list container, I add an item of the previous type and when selected through indexing, toggles an animation.
I cannot stop the animation for some reason.
it doesn't help that you can only work with items that are currently displayed either, items are thus reset when removed because of scrolling
I am wondering if anyone has ever tried alternatives to this in a way that can be handled by inputs other than mouse
Hello, how do I make a timer that starts when I enter a hitbox, that then destroys an object 5 seconds later?
Set timer by event
β¬οΈ this, on begin overlap
I have timer here that loops the projectiles out, do I add it before that?
do I copy the overlap, cast and timer and then add it to the old timer node?
What object are you destroying
it's a blueprint of a turret that shoots projectiles
Is it this bp?
yeah, I need this blueprint to happen for 5 seconds and then destroy itself
Just add another timer after the first one
But also name your variables properly so you know what they are at any given point
Given you promoted that handle you can now GET it, so youβre free to organize your code more
I did this, but it just instantly deletes it when I overlap
That's because your destroy actor is on the overlap execution path.
If you want that 5 second timer to destroy it, then hook it up to that "Timer_that_deletes" event instead.
I want the timer to start only after I overlap, wouldnt I need that node for it?
Yes, you have the start timer by event on the overlap, but you don't want the destroy actor on the overlap.
I added a 5 sec delay node inbetween the fast looping timer node and destroy node and that worked
What do you think this combination of nodes does?
Hi everybody. Please help me. I created some logic using variables in the blueprint (actor) in constructor script. Then in level blueprint and called the βspawn actor from classβ node. After this I want to change the values ββof the variables used in the constructor script. Is there a way to do this so that the constructor script uses the new variable values? That is, just restart CS. I found an article about this, but it didn't work for me https://forums.unrealengine.com/t/is-there-any-way-to-run-the-construction-script/656744/2
You sure this is not working? When an instance editable variable is changed, the construction script runs. It also runs when you move an actor about. And yet, when creating an object of this class using βSpawn actor from classβ, there is no way to specify a different count value than the standard one? You flag that variable as Instance Edita...
Have your construction script call a function that has the logic you want to run. You can then call that function at any point in time in the future.
If you want to be able to set the variables on the spawn actor node like in the image,then you set them to "Expose on Spawn" and when the object is spawned it should use those values.
That defeats the purpose of using a timer. If you want to do it right, do it the way Datura indicated it.
It seems to be working. I did as written in the article - I created a function, as you said, and then created a custom event and attached a function to it. and then, after spawning, i tried to call this event, instead of directly calling the function. Thanks
How can I diff blueprints if I'm using Git source control? It doesn't find the p4merge.exe (I think this tool is for Perforce).
Thanks!
If I need Component to have a hard reference of the ''owner'' so I can then communicate back to the owner of component and also pass the reference of owner further to another (for example widget) is it bad by design? Should I change these communications to interfaces?
The component is never loaded alone, it always first need to have owner(building). The component itself is very light (2 events), but because it has reference of the owner it's size map is 150mb.
I pass reference of the owner (building/self) to the component, in the moment I create that component in the building. Should I pass just actor reference, and then use interfaces for the component to communicate back to the building? Would that make it ''lighter'' or it would not change anything?
Why does the component need to know about the specific owner its placed on? Generally, you want to keep component logic generic.
It's gonna be used only for one owner, so I don't need it to be so generic. I have components where they are more generic if they need to be used by different owners, but in this case only building can have component that takes care of recruiting units, like I'm not gonna place that component on the unit or resource π I think I'm overthinking this? ChatGPT says there is neglible difference in performance if I would switch this hard reference to interface because there is still reference, just hidden if you use interface?
So in this case this component is not really a ''system'' that needs to be generic. It's more about making it more cleaner for me when one building becomes Recruiting Building because it got component added to it (and you can modify 1 building with 5 different components to add functionality to it).
If the component will only ever be placed on that one type of actor it wouldn't make much of a difference.
However, to me a cleaner approach would be to use event dispatchers instead. That way what you add the component too can decide what it should do when the event dispatcher is called on the component. This means the component wouldn't need to care what it's placed onto. Whilst you might not intend to use it anywhere else, it does give it some flexibility in allowing you to use it somewhere else in the future.
That's a great idea. Didn't thought about using dispatchers here but it may work here.
Yea, it can save you having to worry about getting and checking the owner is the right type etc...
Hey All, somewhat new to UE5 so apologies for asking such a simple question. is there a way to get specific components to ignore Begin Component Overlap on another actor? I'm stuck in an infinite loop. i would have thought turning off generate overlap events for the component would work yet no luck.
It would if the overlap event was specific to the component. Are you using the on actor overlap event?
so here's the basic set up. the red line is a material set up on a plane which i want to be completely ignored. the issue started when i tried making a child blueprint to do the same with the moon (currently using a simple ribbon in image.) there is an "Interaction Zone" set up around the planet which is the above overlap event. when i try to use child blueprint for the moon it just starts shooting off errors around overlap event.
wanted to give as much context as possible. sorry for the overload. haha
Hi guys, i can't find the reason why my packaging always failed and point out this Blueprint Function Library.
I have delete Binaries, and all UE cache folder but still can't solve this issue. perhaps any of you have face same issue?
..FunctionLibrary created at wrong time and restart session multiple times and still not solving the issue.
Have you checked each function to make sure there's no compile errors? Also, if you use any world context nodes, delete them and readd them. (it can sometimes help)
If that doesn't work, it's most likely corrupt as the error mentions. In this cases, normally you would have to recreate it if you don't have source to roll back.
Share the error messages you recieve.
each function which using that Shavelfunctionlibrary been recompiled and no error..
what is your suggestion? should i recreate Shavelfunctionlibrary?
what is world context nodes?
I was referring to checking each function inside the library.
can you give example of what world context nodes?
There a special node you can add to functions inside a library to provide context to the world that some functions need.
yeah sure thing, if I remove the pin for the begin overlap it then give me an error for the end over lap, if i remove that pin it give me an error for end overlap still. this only happens when i swap the temp moon i have for the child bp. ive not really messed about with child BP's before i was just hoping to save myself some time rebuilding the functionality. I know its spawning at the actor location but the only part of the child bp that should intersect is the plane i mentioned.
Actually, when are you spawning the temp moon?
would someone mind briefly explaining the process of getting a bow and arrow setup for 2D sprite game. This is what I want to do https://youtu.be/acPRFLSmSi4 . Ideally hold down the shoot button for more power (but can come to that later). I currently have an arrow shooting in 1 direction that spawns inside my character and not the bow (like so https://youtu.be/EHP6lVm1iwU)
Should I have 1 BP for the bow and another for arrow? and use player controller BP to aim etc? I'm not entirely sure which BP I should be building each action. Hope that makes sense
on the begin play of the planet. the planet is spawning the begin play of the sun, which is the only object in scene at the beginning. was planning on make a more tidy system for spawning later on. could this be part of the issue? plan was to have all objects spawn in the Level BP, just hadnt gotten around to it yet.
okay so seems that was case. so i'm guessing spawning a child actor on the parent BP was what caused my loop. makes sense thinking on it. Thankyou for leading me there. seems to be working fine now. β€οΈ
Don't use level bp
if you don't me asking? how come? still very much learning. what's a better option to spawn actors at start?
Depend on your project and scope but deffinitlt not level blueprint because the communication goes one way.
Other blueprint class don't have access to level bp
hmmm... i only need it to generate them initially though?
The communication goes one way, it is never the right place for gameplay element
A quick google search about level bp should give the same advice
i'm not questioning your advice but just so you know the first thing that popped up literally says to use level BP? im assuming thats just for tutorial purposes> i get what your saying though. what do you suggest as an alternative, create an actor to spawn them in?
That's gotta be a shit article circulated by the like of youtubers.
Personally, I will have an actor blueprint that manage the spawning, the same manager can also hold all the references to what it spawn.
Create blueprint BP_Spawner and put logic there for example, you can reuse it easier later. I might be wrong though.
makes sense. and yeah probably. but you see why i just asked straight out. quick google searches don't always give you what you need. thanks for the advice i'll go that way.
still learning, so trying to sift out the good info from the bad is always the toughest part.
yea we all been through that, it's probably better to ask around in discord. Many times I was saved by the people here.
and they also de-mystify common bullshit like avoid casting, avoid, tick, etc
Using the level BP almost guarantees you'll end up repeating yourself. I think the only time I've used it was to know when the level has actually loaded. The level BP just reminds me of the old kismet days of UE3. Haha.
i was under the impression Tick and casting were bad options is that what you mean? I've seen a lot of tutorials where they use it. up until now its just been trial and error for me so its great just have people to bounce off of.
so just avoid all together?
I'm saying don't listen to certain group of people that says avoid cast or tick.
I don't avoid level bp all together, I actually use them for one specific task in my game but I know it's limit and I know my use case.
Try to avoid, there might be genuine cases where the level BP should be used but it'll be rare as using either an actor or actor component would be a better option.
tldr, if you are not sure, don't use it imo.
People who say casting is bad generally don't understand hierarchy very well. Casting is required and essential but if you're class hierarchy (and it's content) is structured poorly, it can mean casting can result in assets being loaded that aren't needed/being used. Instead of teaching good hierarchy they just tell you to use interfaces which isn't good advice.
yeah okay, i haven't really had a need to use tick so far. i do use casting when necessary and was worried it was not a great way of doing things so that's good to know. I'm sure there's plenty of things i could be doing better though. i use interfaces to interact with planets and bring up the commands when the player ship is close enough, i'm curious now if that was the right way to go. you guys have me rethinking a lot of my work haha.
Generally, Interfaces are for when you have multiple classes that don't share a common class but need to have/share the same function. An interact function is a good example of this as you could have an actor and character that both need to be interactable. The only common class they share is 'Actor' but I wouldn't recommend modifying UE's base classes. An interface allows them both to have an the same interact function. There are ways to set up and interaction system without using an interface but isn't always needed.
Honestly could be either. If that interface is only for planets, it could be a cast, but an interface isn't an awful call here either
Ah good stuff, so I think I was on the right track there at least. I intend to use it for several classes; planets, ships, asteroids, stations etc.
really appreciate the advice, getting a lot out of this. glad I joined this group.
You weren't just on the right track, that's one of the most perfect usecases right there :P
honestly only just started to understand them better in the last week or so. I've seen a few tutorials where they are used, but never really explained. i spend most my time just trying to make sense of the UE documents trying get my head around it all.
MathewW has a great channel with short bits that cover a specific node or class
Anyone experianced with UnLua? There's plenty of exmaples of howto access Blueprint objects in Lua, not vise-versa. Any idea howto access a Lua fuction in Blueprints?
Thankyou, its getting late for me now, but i will definitely check out his channel tomorrow. Have a good night/day whichever it is for you haha
What is the easiest way in blueprints to pass a list of key value pairs in a gameplay event payload?
Hello i have the problem that as you can see in the video my player hud do not update anymore after he revived but before death everything is ok everything is working
Im totaly stuck and cant understand WHY?
Because as long hes not death everything is working π¦
Red picture is the player death settings in the player BP
the green is respawn system in the player bp
The other pictures are the widget settings
the only thing that is working after the death is the health (the hearts)
Check out Ask a Dev, he has amazing beginner tutorial, didn't find anyone better that would explain you the fundamentals and then you are ready to go and get knowledge from other places, but he was great starting point for me.
My guess is you are destroying actor, and then the way you bind to the HUD/widgets, it's still trying to access old actor which was deleted. It would be the best if instead of destryoing actor and spawning it again from 0, you just rested his stats and teleported him. Or maybe you just forgot to set shields to be 100% on respawn? You also gained 1 shield after getting 2 health hits? Also you should not be creating HUD or widget again after respawn, but rather just updating it. You just need to create it basically once, and then you just manipulate data, you either remove it from viewport and then add, but creation of widget should not be done in 3 different places - on start game, on respawn and anywhere else. Game starts - create hud - and then it should display whatever is beeing fed to it.
thanks a lot give me 45 min after trainig i go for it!
After you try some things, you can update me. I'm not sure 100% what I'm seeing so it's just guessing, might be something even simplier that causes that π
ok π i let you know just finish the trainig ^^
ok i checked now the informations while trainig and i dont have any "destroy actor" in my player bp
Could it be that I'm calling up the hud too often? Is it enough just once at event begin play?
then you need check all variables and how they are set, and how you are reseting these variables, maybe you set variable -1 on health damage, and then this variable is used when you reset it, and instead of it giving 2, it gives already 1 because it was substracted
you should have variable Max Shield and Max Health, which is beeing used to set Current Shield and Current Health on reset
hmm ok but its not only the live also the shield do not work correctly anymore and all the other numbers like the score also
ok i will check it out
check where you are pritning add shield and how it's called, I can see it's printed 2 times in random times, try to simplify it and just set shield to 2 and print Shield Reseted and same with health, set it to max and print Health Reseted, so you know when and what is beeing called
basically either simplfy code to check what is not working, or literally go and print everything so you see when things are called
Trying to close the editor I now get this error.
I can't remember exactly what changes I made. They are all BP stuff though except for 1 material.
How do I figure out what is wrong?
Cancel and go there and check this blueprint
maybe it's open in some other program?
Am I supposed to do something different when push a widget in common ui for an activatable widget stack?
when I push a widget ontop of another, the (what would presumably be leaf-most) widget doesn't seem to get input?
It fails on multiple blueprints. Even my BP_GameInstance that I do not have open, nor changed anything in.
If you go to them one by one can you save them ?
Do they maybe use that material you changed? Go into one, select all nodes, click on one and click Refresh Nodes, and then compile and save
I'm okay just closing stuff down and not getting stuff saved if I have to. Just afraid it might create further issues next time I open up the engine.
was a good idea. Did not help sadly
maybe do you have project opened 2 times?
check in Windows Manager if you have 2 instances open
I do not. Maybe the log helps
Hmm, can you try to maybe duplicate this material you tried to modify, and the previous one just for a moment clean with all the nodes, save it so it's empty and then try to save project? Just to see if it's what is causing the issue. You will have nodes in the duplicate but it's just not referenced anywhere so shouldn't cause issues with things that use it.
The only time I've had this issue is because I have the project open twice meaning the file was already in use. If you don't have another instance of UE open, check to make sure you don't have anything else running that might be doing something with the files.
ok let me try now
any solution for unreal 5.3 just freezing when importing an fbx
how can I remove the widget after condition is met?
with that node you already dragged out and didnt connect up
you really don't want to be doing that first chunk though.
Get actor of class on tick screams that you don't understand proper referencing yet
No
Casting isn't bad if you've properly setup architecture
You can load assets into memory for the duration of the game if you misuse it, but setting up a code only base class negates this problem
is it not like a direct reference I'm providing to it so it doesn't have to waste resources looking
No, you're saying "search every single actor in the scene until you find the first one of this type"
Depending on where this is depends on how you get the reference. I'd watch the blueprint communication video in the pins.
In short, you could, get this actor and store it in a variable on begin play if it isn't being made and destroyed and will exist for a while.
You could have an instance editable actor variable if both objects are in the viewport.
You could have an expose on spawn variable if the Actor A spawns the thing that needs the reference.
You could use a manager class that holds the needed references.
just to stay with the current scenario... this isn't working, because I think the widget already created with "Add to viewport" just stays and is not destroyed
Can any1 please help me achieve what I try to demonstrate in this video?:)
Box with sphere on top is player character
The cross in the front is a sword (actor)
I want to spawn the sword/actor in front of the player character.
Make the sword do a 180 swing. (in front of player character even while moving)
Destroy the sword/actor.
Repeat.
So far I have been able to spawn the sword in front of player character, it stays where I spawned it (doesnt move with player character). And it get destroyed after a delay. And repeats itself.
I'm new to unreal engine, but I'm slowly climbing out of tutorial island(hell?). Any detailed reply or link to some kind of resource would be very nice. Thanks for taking your time reading:)
***I'm trying to make something similar to Vampire Survivors (the whip) if that makes any sense to anyone:P
I made this video to post in the Unreal Source discord channel. In hope of getting help:)
This is wrong on many levels. First thing you don't want to do this on tick. You are creating Widget every Tick, you are Getting actor of class every tick. Then you are checking if the actor that you got (this actor might change every tick) has boolean true, and then you check if it's true on not. You might want to get actor of class once, not every tick, save it as reference and then use that variable to get boolean from that. You for sure don't want to create widget every tick (you are basically starting the game, and you end up to create milions of widgets after couple of minutes). Then you have problem because you have 1094984322 created widgets, but the logic you created for add to view port / or removes (based on what true/false was on the tick frame (keep in mind you get 60 fires every second). This just totally won't work. First go and watch video about bp communication, how event tick works, when to use it. You might want to use it just for checking the boolean and reacting when it's changed, but that's what dispatchers are for or just events.
As described above, that's because it's being made every tick
That widget probably wants to be made once, and shown/hidden as needed when spotted.
Remove from parent doesn't destroy widget btw
(I'd definitely use delegates as mentioned for that btw)
In short what your code is doing now:
- Create widget
Is True> Show it
Is false> Hide it
But these 3 lines above are getting fired around 60 times per frame
so you are creating 60 NEW widgets, you are not removing or adding or just working on a single one, the code creates widget, executes logic to add it or remove for that single widget that was created in this exact frame, which you may end up with for example 46 created widgets that were shown, and then 34 widgets that are hidden (in case boolean changed). After couple of minutes you have milions od widgets in the view port either added or removed.
thanks, yes makes sense..haha this must be a pain to even see haha ;D
Create a variable, call it w.e
Check if it's valid, if it is. Get a ref and do something with it, if not create one and set the variable.
This way you just create the widget once and refer to one if there is one already created.
https://www.youtube.com/watch?v=PBFdbD0OBL8&ab_channel=UnrealUniversity maybe something like this will help you
πLearn How To Make Full Games From Start To Finish At : https://bit.ly/3SyYx5x
πGet My Free Unreal Engine Beginner Course : https://bit.ly/46mUWMr
Animations + Sword Model : https://bit.ly/3RgDJzb
#UE5 #UnrealEngine5 #Uisco
what is the best way to select a random mesh from maybe 4 or 5 meshes?
without to load all meshes in blueprint?
or does a array of meshes doesnt effect the performance?
by making them an array of soft references and using select random from array
If they are hard ref, they will be loaded. Remember to not have a hard ref in your data table. I saw you got one yesterday.
You will essentially load the entire item in the game when you don't need to.
Use soft ref like source control suggested
There's a bit of learning curve tho as they are just a path to an object. You have to load the object pointed by the soft ref using async load or blocking load
compiler should show a warning to everyone who doesnt use any soft references xD
Grab last index instead of length. Array start from 0
You may possibly access out of bound index
Thank you for your reply! I scimmed the video, but I don't think it covers exactly what I'm looking for. But good suggestion:)
K so like this are ok in most cases but if you are for example calling the function within the same frame, you may end up with a mesh that get loaded last. So the order is not guaranteed.
Shouldn't be an issue if you just want to change one component randomly tho.
Just something to think about when using function to load soft ref
Yeah it's the same thing, in cpp that's very common when looping thru array
There is 1 more reference I have where guy explains how to equip sword and then animate it so it looks like it's https://www.youtube.com/watch?v=-t3PbGRazKg&list=PLNwKK6OwH7eW1n49TW6-FmiZhqRn97cRy&ab_channel=AliElzoheiry just not sure which video exactly but probably like 3-5 one.
Chapters:
00:00 Info on the Full Series
01:29 Info on Part 1
01:52 Enemy and Player Setup
04:43 Basic Enemy Behavior
08:30 Fix Leg IK issue with Ue5 Mannequin
11:33 Creating the Behavior Tree and Blackboard
12:43 Quick Explanation on Behavior Trees
15:02 Building the Behavior Tree
17:20 AI controller Setup
21:27 Testing the Behavior Tree
23:05 C...
But my actual plan for this blueprint may be impractical
for savegame and multiplayer π
I need help trying to pick up in item for in my inventory, I tried to run to a object, but it wound not pick it up or even destroy actor, any advice ( hate getting in the middle of a conversation, but I have to go the a doctor's visit soon) Thank you in advance. https://youtu.be/2Bq0vzixlV8
It looks like the weapon is "rooted" to the arm, and that the wep is following the animation of the character/arm. If possible, I would like to stay away from this solution because of now, I have no plans of animating my playercharacter. I just kinda want to spawn a moving actor and then destroy it again. I try to make my project minimalistic and the code easy to reuse for other weapons/spells, let's say sowrds spinning arround character. I might have missed some parts in the video tho, since I haven't watched all of it
So you want to spawn the sword, swing it, and destroy it?
Hi, what did I do wrong? I want it to update the rotation rate, but its not working, its not supposed to be 0
correct, kinda like what I try to show in my video:P
So that's quite easy. Create actor that is a BP_Sword, on a key or whatever event, spawn that actor in location, and on BP_Sword create logic on begin play to: 1) Rotate 2)Create Trace Sphere which gets every actor that was hit > for each > call to deal dmg by interface for example.
So you need to know :
- How to spawn actor.
- How to rotate actor (probably on tick, with lerp node)
- How to create trace sphere which will get you actors it hit
- How to call (by interface for example) to actors to tell them they were damaged, and inside these actors you would have logic Take Damage > Get Health > -Health > Set Current Health> etc.
You want what to update rotation rate? RPM Value inside Propeller BP has set value of RPM to not 0? Is the Proppeler BP in the level?
yup Propeller BP is in the level
Propeller_BP
and default value of RPM value is set to ?
right now its 700
Try to put a small delay before Get Actor of Class
testing
alright
nice its working now, thank you!!
Yeah, if you imagine on Begin Play is getting fired everyhere in the same time, so probably your RProppeler, Got actor of class, but it haven't got the values set yet, so it returned 0, and probably after 0.002s these values were set in Proppeler, but the other blueprint already set it to 0.
also, right now I'm using begin play, but the RPM value changes dynamically, and its stuck at the initial value it read, should I use event tick?
You might want to use dispatcher for that and bind in the RProppeler_BP to that event, so it will update the RPM Value when Proppeler_BP calls that it was changed and then you can also print it at the end of that event.
Thanks!
in your part 1
I have some problems spawning the actor in front of the character, and attach the actor to the character so it follows (stays in front of the character) for it's duration.
This is kinda where I'm at right now, it spawns different places each time.
ah I see, thank you
Oh, so you want it to follow the character? Then you could maybe add it as component to the character.
So on key event, add Static Mesh component which is sword, and after spawning make sword do something.
hey diyon i solved the problem with the widget interface for the player as u remember
The problem was that I didn't delete the old interface widget after I died, so it just kept overwriting the old one. Now I delete it and add it back when I revive ^^
glad you fixed it! gj
gg π
This makes alot of sence, I will try do that, thanks!
do I have to repeat get actor of class again so that it get the new rpm value?
Nah, just in the dispatcher add Input with new value, and on Value Updated you will get that variable and set new RMP Value
when you click on Dispatcher you have Inputs in the right corner, add new variable Float
and then when you Call RMP Value Updated (that dispatcher) connect current value to this.
and when you are binding, you might need to Add Custom Event again, so it will this time create event with that variable
and you get that variable from Value Updated event, and set it as new RMP value (or straight to the Rotation Y)
Hello, I have tried several things but nothing seems to work I am trying that when a character gets out of a car even if the car is upside down the character remains standing and the camera is pointing correctly as it was before the character got in the car because currently the character is upside down if I get out of the car and it is upside down or sideways.
have you tried saving the rotation when getting into the car, and then applying it when leaving it?
or you can just use the cars yaw rotation and offset it by 90Β°
and set the pitch and roll to 0
at starting I have this simple line trace from muzzle [socket] of my gun, its gud and i m also getting recoil cuz of animations, but problem is if i try to shoot a far or from very close the line trace gets away from crosshair.
Then I have this 2nd type of line trace that i found from yt, its working gud the trace is precise, but the animation recoil doesn't work in that one.
I want to combine both of these into one, so is there any better way to do that?
Easier if you trace once from the camera to see what the player wants to hit. Then you trace from the gun's muzzle to that point when shooting.
that will always happen if you dont trace from the camera, unless u know how to compensate for it
ou yup
wait i m doing that in second implementation but the problem is that even tho i have the animation recoil, the trace doesn't get away from the crosshair
its like either i have to create like a fake spray on 2nd implementation or just use the 1st one
Sorry I never got back. Appreciate your help. Somehow I did have 2 editors open even though I did not have 2 icons in the hotbar.
Had to go to work hich is why I was trying to close down. π
Hi guys how can I calculate the enemy directions movement for a top down npc?
velocity
if you want to know what direction they're moving in
Thx π
I don't know how I can do that could you help me with an example? I'm new to unreal
does a node like this exist in unreal?
where you can input a float, and add multiple execs that will fire if the float is within a given range?
no but you can make a macro
that's a pretty specific need
aah
if I made it a macro, could it have arbitrary amount of execs, like, the programmer can add more if they want to per instance of the node?
like this
Compare float is probably the closest.
Not in macro
I mean you can make it with a bunch
but no you can't add
aw
ill try this one out
Someone also posted this not that long ago which has smoething that allows you to define ranges for a switch statement, though I haven't used it myself. https://github.com/Amir-BK/ExtraBlueprintSwitchStatements
The rotation value keeps printing 0,0,0 whenever I change look direction. It only changes when I move. What am I doing wrong?
And if I Tick it with SetActorRotation, it works well but I just need the proper values, don't know why I keep getting 0 0 0
I created a simple throwable object that should explode on contact with static objects.
This I set it up to create hit events, and block world static objects. And world statics are setup to block this object type.
Also collision is enabled.
For some reason there is no hit event created and I don't quite understand why (and I don't to have all my world actors generate overlap events^^)
Check this
well yeah, that's what I was refering to with "set it up to create hit events" ^^
Do you have only one collision in your actor?
Make sure only one component has collision
I have a static mesh, setup to have no collision, then my sphere that has collision, a niagra system and the projectile movement
Ok so only the sphere hits
should, yeah
it doesn't I hooked it into the code path that works for overlaps
Are you using projectilemovement or anything? How are you applying velocity
and the projectile movement
I had same issue, give me one sec
check this on ProjectileMovement
And make sure your Capsule collision is the root
that's enabled
What's your root component on the object
default scene, will test with moving the sphere to root
Do it
Indeed, that fixed it, thx π
Yup, pulled my hair out with this one
nice, setting it up for query&probe only also works now β€οΈ
I don't remember why making the collision component the root is necessary for ProjectileMovement
i just know that's how you do it lol
even works with query only, interesting
I guess this is how the component determins which collision component to use \o/
from the code this is the component used for everything location related and sweeping, so yeah, makes sense
So does the DefaultScene, just not sure why collision doesn't work as a child
fair point.
I guess this is why
Hmm So they don't combine hierarchy into a single motion object
well, that's a topic to dive into the physics engine^^ eitherway, I'm happy it works now, so thanks again π
Yeah man np
How do you repeat a begin overlap?
I want something to constantly be staring at another thing while it is in the collision
See reply in #ue5-general and donβt cross-post
Anyone know of a way to rotate a skeletal mesh asset without having to export it to blender/maya and reimport? I have a BP_MainFirearm blueprint and this one mesh is 90* off.
Details panel rotation?
take the collision box out of the hierarchy temporarily if that's the issue
Scaling is the only option and opening up the SKM or skeleton and rotating the root seems to have no effect
hmmm this component only appears to have Scale options in the details, even when I trace back its inheritance to the parent SkeletalMeshActor it is a child of
Ah I see if I put a scenecomponent above the skm in the heirarchy then I have control
thanks for the help π
You should do future you a favor and just blender it and fix it.
I think you may be right. The actor class that I'm changing here is for my item pickups. Do you think having a scene component be the root is problematic vs. a SKM being the root (where the SKM can actually simulate physics)?
Depends. If you're just using it to simulate physics, why does it matter what direction it faces?
When the actor is picked up it gets attached to the player's back, can be held in their hand, etc if its a weapon. Atm every other weapon SKM is working totally fine, but because this one is 90* off, it clearly doesn't look right
If it's just the one, Authaer is right about just fixing it in Blender
Feels odd that UE doesn't have any way to edit skm assets in engine. afaik you can easily do that with static meshes in the modelling tools
Realistically the main reason I would say import it correctly is because you'd be attaching that thing to a pawn's hand. And yeah as you just said most will work fine.
As a general rule, scene components are costly. This is why some games don't have a lot of enemies. EG Mass Effect. Cause designers throw a lot of shit on things, it adds up, scene components cost every single time they or their parents in the hierarchy move.
It doesn't seem like a lot at first, specially in testing on a PC capable of development. But get 20 pawns running around with some extra visual components and profile that on a PS4 and you'll cry.
Even adding that extra scene component. You make a game with 20 enemies using this weapon and using that component to attach correctly, you have 20 extra scene components costing on every single animation and actor movement update.
That's a good point. There will potentially be many of these pickup actors on screen at once so I should definitely design with efficiency in mind
I've always wondered how games like Overwatch are able to have dozens of random little physics actors on screen at once with no performance hit, lag, etc.
Pickups are less of an issue. Most don't move that often. Things just chilling around don't cost a ton besides on the renderthread for rendering or culling. It's when you put it on characters that move constantly even when standing still due to animations, that it gets tricky.
Anyone have issues before with setting up rounds and matches in BP?
I am having issues with spawning in characters after I reset all the variables used in the round.
Overwatch's little physics stuff is locally simulated. And not tied to gameplay. Most of that stuff cannot hit players, and has simplified collision meshes to let it move around cheaply. You can see it in some of the items when they roll like balls despite definitely not being such. Physics sims aren't terribly costly for a few dozen things as long as they're not generating overlap or hit events.
Are they locally simulated? I assumed they were all somehow replicated from the server but that could just be the ones with some gameplay relevance like the basketball
Most of it is not. Like all of the little knickknacks you can knock around. Things like the LucioBall are more likely not run on a physics engine but done similar to Unreal's ProjectileMovementComponent, which is more costly, but can kinematically do bounces and whatnot.
This is good to know π
But what happens if you put the SKM in a regular actor, rotate it and make it the root? Or are regular actors more expensive than SKM actors?
The issue is that it is the root, which you cannot rotate, as it is the defining component in the actor.
Like for example, actors themselves have no real definition of a location or rotation. It's all defined via their root component. But visually, his mesh is oriented wrong.
Right but rotating it when itβs a component and then moving it to make it root I meant
Or does that undo the rotation
Making it the root would set it's relative rotation and location 0,0,0
Why are my rocks not getting collision? just started so im very new to programming
Here is the static mesh that the rocks are based on, it has collision turned on
and what is not colliding with them?
my actor (space ship) or with each other
is this preset collision on static mesh?
Show the collision?
You are showing the collision settings but you did not show an actual collision the asteroid has
Now you also want to check your collision settings in the static mesh component detail of your blueprint actor.
That settings will override w.e you have on the image above
Finally also check the collision of the other actor you are colliding with
Ok, if i toss in the rock manually instead of the one generated with my blueprint i can collide with it, but when i spawn them with the blueprint to get them have different shapes, speed, rotation they no longer collide.
How do i check the settings of the static mesh component detail of my blueprint actor?
Is it this one?
Thats the problem. You are giving them the appearance of a different shape but the collision isn't automatically generated like that.
Ohhh
ok I understand, yeah that makes total sense
Can i generate a collision mesh/body after the last node in my blueprint? when it already has its shape?
Hey guys how can I check if AI is moving?
Add Sphere collision with radius scale
Velocity > 0?
FindLookAtRotation
You can check their velocity but im pretty sure thwr e is a "is moving" node
Or maybe not its for player controller
#instructions has information on how to post a job. if you have general blueprint questions people here should be able to help you out.
Unsure if you've solved this. But you have to generate collision for the mesh. These should help.
- SetDynamicMeshCollisionFromMesh
- SetGenerateOverlapEvents
- SetCollisionEnabled
- SetCollisionResponseToAllChannels
Mostly the first one generates the collision on the component. The rest affect the settings for it.
When you move it, you know itβs moving.
Behind that youβll need to be more specific
In a data table, how do I get the Row Name column? I know about the get column as string node but I cant figure out the property name for the life of me
Get Data Table Row Name?
ohhhhhh, Idk why I thought that wouldnt result in the right thing, was being dumb ty
Data Table / Struct dilemma:
- I have a data table that includes items and variables such as weight, value, mesh, icon, etc.
- My item spawning system uses a base blueprint and then I make a child BP for each item.
- I am trying to set each item's variables during the object's construction, but the UE data tables make it very confusing to do that.
Right now I have a BP interface that tries to pass in input of my item data struct to an output of the same type (maybe that's stupid and pointless?) I then have a function on my base item BP that takes the interface input, tries to "Get Data Table Row", then sends the Out Row to the interface output. Finally, on Construct, I have a function that calls the Interface function, sets a struct variable in the BP, and for example sets the static mesh of the BP to the mesh in the struct (meant to originate from the data table).
I can get some of this to work, but not all, and it seems way too messy to be usable. The way Row Names, Handles, etc. work hurt my brain.
*What are some better ways to accomplish this? *
I mainly want to be able to easily edit item data from a single source (data table) and not have to manually set things for every item I produce.
Any help is greatly appreciated...
Here is the interface "struct passing" function, and then the function for setting the data...
Doesn't make a lot of sense to have each item be their own child blueprint and have them be part of a data table.
Ideally you'd probably only use a single "Item" blueprint and when you want to spawn them you can feed in the data table row which would have all the details required for each item so that it can generate itself.
You'd be able to access any spawned item using an "Item" reference and there's no real need for an interface.
Thanks, I'm not 100% sure what you mean by feeding in the DT row.
And how would something like that work with placing the items in the world? I'd also like the items to show up with their appropriate meshes while in the level editor so they are easily recognizable.
You'd make a data table row handle variable that is set to "instance editable" and "expose on spawn".
You'd use the construction script of your "Item" class to read that variable, get the details from the data table, and set up its mesh etc.
When you place an item in the world, you'd select the data table and row on that variable.
When spawning an item at runtime, you can feed in the data table row handle into the spawn actor node.
Oh, that sounds essentially like what I'm doing now, in a way.
The problem I had was that when referencing the DT row handle in BP, it needs to be manually typed (which isn't the worst thing, but it's a bit annoying).
I'm interested in the idea for sure, but I'm not experienced enough to know if this will impact organization or scalability down the line...
Might want to look at data assets
Aside from the UE documentation page for them, is there another good resource that gives a good rundown of those? I haven't touched them yet.
I suppose scouring the internet should give you the info you need.
Yeah, I was just hoping you had a specific resource in mind. Every Google search adds a tiny bit of overhead to efficiency and it has certainly added up a lot so far π
You use a Data Table Row Handle. It's a variable for specifically referencing a specific data table and its rows.
No manual typing of the row names, if you select the table, you'll get a dropdown with all the row names.
I'll have to try that out more. I remember the dropdown showing up in one instance but I wasn't able to find that again. Thanks for the suggestion.
Does anyone know how to repeat AI Move To without creating an infinite loop?
I have an enemy that I want to follow the player constantly, but as soon as it gets to the player it will stop and stand still.
Use the "On Success" output from the Move To node to call the function again.
Create an event that you call to start the move. OnSuccess > Call it again. If you want some more conditions about whether or not it continues to call it, put a branch in and create the logic you want.
dose anyone know of a tutorial or just know how to make like a metal pole bend on impact of object using bones to get some thing similar to this plz @ me
Hi everyone. I'm having an issue with camera rotation lag of the SpringArm. That is, if I enable it, it only affects the camera, however, the character itself rotates without any lag. So the camera lags behind the character. Here's an illustration, when I move my mouse left, the character turns left first, without any delay and then the camera follows.
Is there a way to make character strictly follow camera yaw rotation even with the camera lag enabled?
I tried that but it errors and complains about infinite loop detected
Possibly because you're getting to the point where it's at the player so it's successful and then it tries to move to the player but it's already there, so then it's successful and then it tries to move to the player, etc. You'll need to stop the logic if the distance to the player is too close or something.
Then just have a timer running to check again in a few seconds or whatever you like
I wasnβt sure where to ask this but is there some sort of way to prevent something like a third person mesh holding a longer gun from sticking through walls so that a player couldnβt see you from the other side. Is there something I can do with materials to hide the part that is clipping through?
Why cant i attach the node from my dynamic mesh to "set dynamic mesh collision" node. It auto generates a new dynamic mesh component node
I'm just wondering is there a way to slot this waypoint marker so that it will follow an actors position around the circle? the idea is to make a radial waypoint system. this would be the ideal. but I'd be just as happy if it just followed around the edge of viewport for now. just looking for a good tutorial or to be pointed in the right direction if possible.
Is this sort of like a compass waypoint? So when the player rotates, the waypoint rotates as well?
yeah exactly right.
I've done something like this a while back. Let me double check how I set it up.
absolute legend! i've been stuck looking for something like this all day, its killing me. thankyou!
I have my compass and my quest marker (waypoint) as two separate widgets. The waypoint widget is made up of a size box and an image. The waypoint has an event tick that keeps the image rotated upright at all times because in my case that was important as it's an icon of a chalice.
Then my compass is a separate widget with that snapped onto the center. It rotates around based on a look at direction from the player to the actual waypoint world location in the map.
It's been a while, so I honestly don't remember how this works. lol
I have multiple waypoints on the compass at a time, so you wouldn't need a for each loop or any arrays.
So you just need your player's location and rotation and the location of your waypoint, then set render transform angle of the waypoint widget image.
You don't necessarily have to have two widgets to do this, it could just be an image, but the reason I used two widgets was so I could anchor the image to the center of the compass and have it rotate around the edge while staying upright.
Your image should be the same size as the compass though if you just want to rotate the image. Then put the actual waypoint image at the edge of the blank space. If that makes sense.
Here's a cleaned up version to make things easier.
Amazing, that definitely gives me a few ideas to work with. I'll do some tinkering and see what i can do. thanks so much! i really wasn't sure what direction to go here.\
There might be cleaner ways to do it. lol. I've definitely been known for finding duct tape solutions to problems like this.
You could probably do it with a material as well.
Though I don't know a ton about materials to be of any help there. lol
i hadn't considered a material. that would be an interesting solution. i'm always amazed what you can achieve with them.
Same!
man my whole project is duct tape at this point π€£
(Most games are!)
i'm just glad i'm not the only one that feels that way haha
I've found that everyone starts a project with super clean organized code, a plan in mind, and the best of intentions to keep it that way. But a few months down the road and you're going "Who put this here? Why is this broken? Why do I have so many circular dependencies?"
yeah that was me a few months ago when i moved and started a new job. took a few months off and came back and just decided to start again. worth it though project has come together so much smoother this time round. thanks man even just starting to implement the idea i can see this should work for my purposes.
No problem! Good luck!
And it definitely happens. My main project (released in Early Access, finally) was restarted 3 times before it finally saw the finish line. Well... the pre-finish line I guess. lol
not sure if your allowed to post it here, but whats the project. i'll definitely check it out as a thankyou.
Not sure. It's called Swords 'n Magic and Stuff though. Probably safer if I don't post a link. lol
yeah better to be safe. i'll check it out!
Hey everyone, does anyone know if there's a way for the player to physically push a platform he is on with an object he is holding? I as just wondering if there is a smart way of doing this that I'm missing
How do I fix this? I followed Gorka's tutorial here: https://youtu.be/O7vmp73ue4Y?si=hVZO1zakfs1pQqFs .
Hello guys, in this quick and simple tutorial we are going to learn how to make an interactable door that will open and close in Unreal Engine 5.
Follow me on Twitter: https://twitter.com/GorkaGames
Subscribe to the channel: https://www.youtube.com/channel/UCv_n9oioNF6OpzR2dt6E4xg?sub_confirmation=1
unreal engine 5,ue5,open and close door,tuto...
Don't follow Gorka
He does not do good tutorials
Why do you say that?
I was watching one of his RPG series ones, and he hit literally every single possible piece of bad practice
He doesn't seem to care about the quality of the teaching, just pushing out the videos
Thank you π
Doors are pretty simple, I'd go as far to follow patty's interaction stuff, then just hook it up to how you want a door to work. I.e. rotate then rotate back
Cheeky plug. π lol You will need an interaction system though but interms of just setting up doors, they should go over the basics.
Oh what? Why? I thought he had a good tutorial for how unreal works. He was the first guy I watched when learning
Watched one of his video and I want to puke
Unfortunately most vmcreators regarded as good by newbies are really bad.
Attack 1 , 2 , 3 roll up down right left with Booleans for each in anim bp
This guy is maniac
It's because they know how to make a video to keep attention, and you don't know enough to spot their bad practices
Hm
I.e. baiting you with promise of shiny things, when it's actually a gold plated turd
Gorka has a GTA6 in BP only tutorial series, and if that doesn't say enough about his goals, I don't know what does.
Lol. Game of that scale without real data assets. lolnopefuckthat
Kinda curious how they're gonna tackle modding support. π€
Not to mention dedicated servers
Hell even making a save system for a game that size :P
Ugh. I can't imagine save systems anymore without the serialize function which is C++ gated. Even watching C++ people make save systems without it hurts my soul.
Real quick, what do you think of Matt Aspland?
I used to think of him as one of the better ones, but not anymore after seeing one of his multiplayer things where he multicasts spawning.
lol wtf?
@clever rose My two cents would be.. If you're newer to the engine and specially to programming. Follow along with something. Doesn't matter what it is, you need to saturate yourself with the tidbits of engine knowledge you can pick up from easy sources. But keep in mind along the way that a ton of youtube content has two issues.
- The person making the content likely just barely learned this new thing and thought it would be a neat content video. Chances are they likely have never put this feature in a shipped title and probably can't even see half of the issues with it themselves.
- The videos are structured in a way to retain views per video, thus 7-25 minute long videos, breaking up multi hour content into smaller videos to get you to keep watching their content. They need you to open and leave their videos open for a time, that is their main goal, teaching is secondary to this.
This said, it's a necessary evil. You have to learn from somewhere and it's either paid structured learning, which isn't really any better. Or this. You just have to learn the caveats along the way.
Duly noted. Thank you!
I'm still having the issue where the door just pivots from the center of the door
Is there any way to control the Opacity of a mesh? Or must I create parameters in the materials it uses and set those?
- I would like to fade away corpses over time.
That'll most likely be down to the origin on the mesh.
Pretty much yea. You'll create a dynamic material instance of the material and apply it to the mesh. You can then set the parameters you've exposed to update the material such as the opacity.
Yeah okay. Thank you π
https://youtu.be/csSvlhfHxaU?si=KeufuEjXoYkQrKlK I fixed it with this video
In this video, we cover a few ways to move the pivot on an object in Unreal Engine and UEFN without going back to a modeling program. We cover how to change a pivot:
PRO TIP: Holding Ctrl and clicking and dragging the Gizmo's will allow you to snap it to a surface. You will see a "circle with an X" indicating the placement surface.
0:00 Movi...
Hello! Is there a way to call a custom event from a level blueprint from an actor in that level? If so what would you suggest is the best way?
Not unless you made a level script actor. Which I don't advise. Normally Level BPs are avoided. You cannot reference a specific level's BP because you'd be linking that class to the level, forcing the entire level to load when that class is loaded.
Allright, so better to move that event to like an "empty" actor so I can call that one?
Probably, depending on what it's for. Sometimes there are better tools made for certain things. What is the general use case of the function?
Its the event(s) that match gems (for like a bejeweled game)
Match and resolve those matches if any
Yeah. Materials are the only opacity control. Which you can do both via making a dynamic material and setting vector parameters, or by utilizing CustomPrimitiveData.
Would recommend checking out material layers. You could make a layer with a fading param and override any other layer's alphas. Makes it easier to slot into thing's materials without needing carefully structured material hierarchies.
Then yeah. Some other BP. Depending on the case it could be a gamestate component, a custom game state, or some actor placed in the level.
Smart. Thank you.
Aight, thanks! Appreciated
I'm getting an infinite loop issue in editor. I don't see how it could happen though. Am I missing something obvious?
That is all the code the BP has
Why is destroy self calling it self?
That's the reason btw
This is the one I thought I had π
On a side note to this. There is a better way to handle that.
Make Beginplay call SetLifetime. This does the same thing you've done. Sets a timer and calls destroy actor. Override EndPlay and kill your Timer you're clearing there.
If I don't clear the timer and the actor is destroyed, does the handle just dangle somewhere?
I suppose timer are created with timer manager
I think it will just sit in the timer manager until it finishes. But because the actor is no longer valid, it just won't run the bound function at that time.
Probably not a big deal to clear it or not unless you have hundreds of instances, and there are many other issues like BP to consider at that scale. π
Hey all! Does anyone have experience with using level instances to create procedural levels through BP? Iβm rushing for a game jam and hit a brick wall yesterday π
Iβm attempting to spawn level instances at a specific location and rotation (using the βLoad Level Instance by Nameβ node) so that they line up with the prior level instance seamlessly, but running into problems.
Despite debug messages saying everythingβs firing correctly, I donβt see the spawned level instances ANYWHERE in my map.
Even if you just set the spawn location and rotation to the world origin?
Did that recently for work. Can't say I had any issues with it. Was spawning in a level instance at 1,000,000 Z for camera stuff. I didn't change any parameters but location and rotation.
Is this failing in PIE or Standalone or Cooked?
Thatβs a good question! I didnβt get the chance to check last night but Iβm taking a look right now!
Nae did you end up figuring out why these all return zero?
I see the same thing.
Not at all π¦ I think it's a bug unfortunately
Thatβs awesome to hear! Based on the documentation it looked like the way to go but I havenβt been able to figure out at all what Iβm doing wrong. Level instances are a fairly fresh concept for me π
Oh dear! I was really hoping to get the time ratio out there π¦
It Ould really interest me to be able to modify some Niagara/Material parameters depending of this as well :/
so disappointing π¦
I also worked with spawned level instances fairly recently and they seemed to work just fine, 5.3 I believe. It could also be the case that you have nested levels in the instances? It's possible that's supported now, or works differently, but you could always try to spawn a very simple instance (just a level with a cube in the persistent level).
When I used them I didn't use World Partition but I doubt that should cause issues
Also need to know if this is happening in PIE or cooked game. PIE means there's an issue with the code. Cooked might just be an uncooked level missing because it's softreffed only.
You mean this one right? (with a value of course)
Well I called an event I made myself for an infinite loop so don't be too harsh on yourself π
I just tried spawning the Level Instance with basically the same location and rotation as the world origin and still nothing spawned π¦ Here is by BP for reference:
I'll give this a shot next!
LevelName would be my first go to to check. Replace that with a LoadLevelInstance using softrefs.
I just tried that with a manually set level instance and no luck either... I'm wondering if a bunch of my logic is just getting skipped - the only print string I'm actually seeing is at the end of everything where it prints "Success! Destroying now..." upon destroying the actor that spawns the new level instance.
I'm going to try simplifying things I think to start from square 1
Yup, it's my logic - the new LevelInstance worked fine when setting it manually so I'll just have to tinker more
Hello I have a pretty noobish question. I have this function and it works properly but when I collapse it the is valid node just passes everything through as if it's not there, and I'm not sure why.
When you collapse the red circled stuff?
In the same place. It;s overall the same thing but with the function collapsed that doesn't work.
Are you using Collapse Nodes or Collapse To Function?
Collapse to function. When I collapse nodes it's working properly.
This is intended.
Collapse Nodes simply visually condenses them. It has no runtime effect.
Collapse To Function creates a function out of them.
Are you at all familliar with normal written code enough to read pseudo code?
You converted
void SomeFunctionThing()
{
if (ObjectIsValid)
{
DoSomethingWithObject();
}
}```
To
```cpp
void SomeFunctionThing()
{
SomeFunctionThatChecksIfObjectIsValid();
DoSomethingWithObject();
}```
IE you removed the conditional check from the DoSomethingWithObject.
Ok, so I would have to still have Is valid before the function. No reason then to collapsing it π Thx.
Sooo, quick wonderment: is casting bad? π Or let me rephase: Is a lot of casting bad?
Not in the slightest. And anyone who says otherwise flat out is bad at project management.
So where did it come from? I guess this seems like a scary warning? It does seem scary to me π
This is a complex topic. But I'll try to sum it up.
Yes please π Appreciated
The 'Can' should be a 'Could'. π
@dry sleet @maiden wadi As a heads up, I think I got the level instance spawning working! Huge thanks to both of you!!! Here's what I'm using now:
The first point is that casting in itself does nothing but change a pointer's level. EG you line trace a PickupItem. The line trace gives this back to you as an Actor type pointer. You have a function in PickupItem you need to call. So you cast to pickup item. This does nothign but convert that pointer's access level from Actor to PickupItem. This process is nearly free, it cost practically nothing. In blueprint with a normal cast node is that it casts the pointer, and then runs an IsValid on it and that decides one of three things.
- The object was null and could not be cast.
- The object is not have the correct hierarchy for the cast, the cast fails.
- The object had the correct hierarchy and the cast succeeds.
Linkers are the real cost of "casting". And that is quoted because linkers have nothing to do with casting. You can link via a cast node because the cast node has that as a return type. You can also link by simply putting an empty pointer as a class property. Or even by making a function with an input or output of the same type. This has nothing to do with casting except that casting has that as a return type.
Linkers cause issues because they keep objects loaded when they're needed. For people who don't understand basic project management this means that they link to classes with assets specified and do not have a clean layer of code only classes to work with. Thus people run into this issue because they don't know how to make those code only classes, and then casts cause linkers which force everything to be loaded all at once. EG casting from player character to the boss that only exists in level 3. That boss and all of it's sounds, particles, materials all stay loaded in every level the player character is in.
Linking every code only class is fine. They're tiny. They should all be loaded at all times anyhow. Thus, proper use of casting and composition is perfectly fine. And anyone who says otherwise does not know how to structure a project.
Okay so for example
I have like 200 actors that have a certain "type" I can do that two ways
- Add the type to the general Tags and then later on cycle through those tags to see if the "type" is in there and if so then I found the type of that actor
- I add a variable to the specific actor BP and instead of adding the "type" to the general Tags I set it to the variable, then cast to the BP and get the type that way
So to sum up:
Or I cycle through the tags of 200 actors or I cast 200 times to the specific BP to get the variable.
Which is better?
PS I guess this type of casting falls under the first category and is nearly free, right?
Casting is faster here. You would check tags from the actor. Which means you're running the same IsValid already that a cast node would. And then on top of that you're checking an array and running a compare which while fast, will certainly lose out over a simple cast.
Crystal, thanks!
If you really want to be wary of the pitfalls people run into with casting. Check your code only classe's sizemaps often to make sure they're not referencing gigabytes of assets.
You will need to add return node for each end of branchinh in function
How do I add +1 value to the Key of the map?
Like I have Teams 0-5, and I on overlap I get team of the unit that overlapped, and I want to increments number of units for that key value. Is this going to work or will this also increment the key because it adds itself already? Like how to get ''row'' of the map, and increments the 2nd value +1 and set the map? Which nodes should I use?
Will Add work like Set in case the Key already exsist?
the ++ node requires you to pass by ref. Make a local variable, set it to the value you find, then do the ++ on the local var and then add that as the value to your map.
btw to simplfy things I already added Keys as defaults numbers
Hmm, but then I would have to put like different local variables for each team? Otherwise 2nd team coming would get local variable of the other team that already increased it?
No because you set the local ref to the value found in the map.
If I have a widget and within it another widget, what would I do to get the parent of the child widget
Add in a map will either add if the key does not exist, or overwrite the current value if it does exist.
Generally, don't. Child should not care about parent. What is the need for it?
If it doesn't find the value, it'll default to 0 anyway.
so I have a Widget and within buttons that are a widget of their own and when you click one I have it call to the parent so the widget there within an interface call with a string
what version of UE does it use to smooth blueprints ?
Ohh, like that, got it
just thought it would be better then doing dispatcher
Good one, cheers
Thank for help, these maps are not so intuitive at first glance π
Dispatchers are better. Child shouldn't care about it's container. Just chills and exists and screams like a child when something happens to it. Parent listens and handles what it needs when it does.
Event Dispatchers are what I would use. That way the parent decides what should happen. The child is just like 'Hey! I've done a thing.' and the parent can be 'Wow, great job, here's a sticker'.
They other way is like the child sneaking into the parents sticker draw and taking one for itself. π
well thats kind of what I was trying to do with interface haha
I've switched to dispatcher π
If you're pre assembling your widgets, with the child selected, you can create automatic bindings in the events panel. All accessible event dispatchers will show there.
unfortuantly not, they are created at start as some terminals won't have all the buttons etc
tbf I could do it another way but down this dispatcher path now so haha
Ahh, yea, you'll just have to manually bind to them when the children are created.
Like this.
This is free Flat Nodes plugin from Market Place + the lines are Electronic Nodes for 10$
are these more memory optimized than the original ?
This is only for visuals. I don't know about memory, are you talking about editor memory?
yes editor memory but i will find out when i will test them
well lucky for me I've adopted a String command type thing where I'm passing strings around and then using switches with the string I am looking for to then do stuff
quite affective
saves having two events going to same place
If I get a random array from a pure function and feed it to a for loop, it seems like that pure function is called each iteration of the loop? I guess then also the array the loop operates on is different each iteration?
I'm leaning more and more to avoid pure nodes without caching the result.
Hello all, I wrote a character customization system from scratch but a little confused now that I'm getting into depth with it. I got one category working now I am having some trouble adding more.
my system seems to only want to use what was last selected and not use both categories
anyone here willing to take a quick look?
Hey guys! Could you please help me just a little bit here. I have some problems with timeline node. And I believe that's just lack of understanding how it works on my side. I have a character who suppose to bite when it overlaps a candy. And the first bite works perfectly, but then it just does nothing. If I connect everything to "play from start" it just shows really weird behavior
...When you open your project and get something to drink real quick... return... .. and see the "restore 46 Windows" button fade right in front of your eyes π± π
it feels like a reset
how do I get current window resolution? I tried to use Get Screen Resolution but it returns 0 both at X and Y
In other words, why does the event tick timeline only work once in my blueprint
like it should be something resetting it idk
show the rest of the code
all the way to the event that starts that chain
yeah don't play a timeline inside a timeline
why do you have 2 timelines?
one to open the mouth then one to close it?
Hello everyone in my VR project there are small grabbable objects that player can hold, I'm looking for a system which highlights the object if you press the grab button. I've searched for "UE5 VR Item Highlight". Almost every tutorial I've watched uses sphere collider which triggers when player collides with.
one is for blinking
and another one is for biting
@somber elbowThis is sus
Update runs EVERY FRAME for the duration
so every frame you're calling Play from Start
when do you want to blink and bite?
i want to blink when Z velocity > 0
and when do you want to bite?
when the character overlaps pickups
then why are you calling Play from Start on the bite timeline inside the update of the Blink timeline?
during a blink, you're saying Bite 60x per second
you want to blink non-stop when your velocity is > 0?
no
What class is this in? You don't need to get player pawn and cast if you ARE the player pawn
ok back up, first tackle the blinking. WHEN do you want to start a blink animation?
I just don't know how to manage it any other way. I made everything inside the player character blueprint
when the velocity is greater than 0 it should launch the timeline
where it perform blinking. And when velocity is less than 0 it should go to the normal state
You can do that without tick.
BeginPlay -> Play from Start -> Update -> morph target, selecting the lerp output or the default based on velocity > 0
-> Finished -> Play from Start
assuming a looping timeline isn't a thing, it might be a thing, not sure
Event Overlap -> is it food? -> yes -> Play from Start the eating timeline -> Update -> morph target
it shouldnt be in event tick at all?
no
why would it be?
tick runs every frame
you don't want to START a timeline every frame
you can just have the blinking timeline run all the time, and just choose the lerp output or WhateverDefaultStateIs for your morph target
idk i thought the logis supposed to be to check the statement evey frame if it should blink or not
timelines tick too, you got a tick firing off a tick which fires off a tick right now, it's a mess
Timeline Update fires every frame
just check if it should blink or not by selecting a float.
Float track -> lerp -> select float -> morph target
0 or 1, whatever default is -^ ^
Velocity > 0,0 -^
i plugged all these into begin play
what should be in a and b than? just 1 and 0? I mean i should plug the condition there somehow
and i cant connect "finished" withg "play from start"
can you set a timeline looping?
just hook select output up to morph target and you should be set
although idk where current velocity is set
assuming it's set correctly
i checked it with print string
also if the blink track is 0-1 then no need to lerp
you're lerping 0-1 based on 0-1, just feed the blink track output into the select
yeah just lose the lerp
now it blinks many times just while falling
it'll blink when that current velocity variable is above 0
whether or not that's what you want is up to you
it just performs many blinks while falling down and i need him to just close his eyes while he is jumping and gaining the height
well then do that
Is there any way for me to make the text change color on hover?
yes in the event graph you can set it
make sure the text has "is variable" checked then drag off from that
I just didnt get it how to make it ask every frame in begin play if it should bling or not
it suppose to go morph = 1 smoothly following the timeline when it goes up and then when the character is falling it should go morph = 0
owhh thank you
then add that
add another select with IsFalling
the thing is i dont understand how to solve it in event begin play. I asked chat gpt and it says do the stuff in event tick thats why i have all the things connected there
chat gpt
is useless with unreal
literally has wasted so much of my time even trying to get answers out of it that make sense
but thats all i have and youtube videos
you shouldnt need to do anything in event tick also, that would be a waste. you're trying to make the guy shut his eyes ascending then close them descending right?
its not working, where did it go wrong?
yes
ok so how id approach that assuming the "cat_blink_shape" is a variable from 1 to 0 where 1 is fully closed eyes?
youd play a timeline with a value from 0 to 1 when your character jumps which shuts the eyes then you can either have a rep notify in the animation or check if the z velocity is negative i think and on either of those you can play the timeline in reverse
because if it is less than 0 then the character is falling
yeah these selects dont make sense
just check somewhere if it becomes less than zero then play the timeline in reverse
its a blendshape
its all plugged to begin play and it will check only in the beginning of the game
i mean it should check all the time somehow if it should blink or not
I have set the actor not to have replicated movement and I cannot change the position of an actor belonging to the server on clients
is this a player controlled character
yes
client sets the server position locally
but this position does not change. Some ideas?
the timer by event is basically calling the open eyes custom event every 0.033 seconds (30fps)
i mean why is it so complicated? do i really have to make custom events for such things?
and the clear and invalidate timer is just stopping it looping
the timeline is outputting 0 to 1 over whatever time you give it which you can use directly in the morph target
reverse just means if the timer is at 0.7 and you tell it to reverse it will start at 0.7 and go to zero again
so the player goes in the air when they're hit?
yes
so when they get hit call it then?
i would also add a check at the start to make sure it isnt called multiple times then also
because they can get hit rapidly i assume