#blueprint
1 messages · Page 262 of 1
ah you see thast where its worked out for me, ive managed to make it so i can swap the mesh name and description of the object in the editor.
Hello all, I am very new to UE5 and Blueprints, currently trying to remake my Godot project with it.
User-made content is an important aspect of my game, and I need to create a set of folders in the player's local files, for them to place their content. This was simple in Godot with DirAccess.make_dir_absolute("<path>"). However, I can't seem to find any Blueprint nodes that can create new folders. I can check if a path exists, and there is Make Directory Path, but it outputs a "Directory Path" as opposed to creating that path, and I do not know what I'm supposed to do with that Directory Path output.
In blueprints, is there such as thing as a node that I can ask: "hey, is this object of any of these n types, and if so, can you give me an exec pin for each one of them + none"? Almost like a bulk cast attempt.
But why? This sound like a code smell.
You do normally just have the function in the base class.
And if the objects have to derived from different class then this is where interface comes in but ask your self first if the objects can't derive from the same base class.
Nested casting is pretty messy and indication of bad design
It's very much in the temporary workaround territory, you make totally fair points there.
Question: Is there any difference to putting movement login inside of player controller instead of player character?
So you have a Character. And you have a Car. And you have a Plane. You can possess and control all three.
You put the logic in the PlayerController. The PlayerController needs to know about the character's movement controls, the car's movement controls, and the plane's movement controls. These can rebind and are differently named, so you're gonna have a different set of controls for all three. And you're gonna need the controller to know about all three, to be able to send the controls to the character, car, and plane.
Or you can just put the controls in the car, character, or plane.
There is a plugin you can enable called "Blueprint File Utils" which gives you a "Make Directory" node.
how do i enable the node that represent the increment assignment " var a += 5 " ?
Just set the variable
A = A + 5 in bp
The increment node will require a ref
Thank you! That's exactly what I needed, and it works!
U mean , "set A" node receiving as input the sum of "get A" node with flat value 5
*?
if you really want the increment node, you can make your own macro\
just double click the macro and see how its done
Oh, so was probably this, i saw an node with the symbol '+=' in the unreal fellowship series
It was probably a macro
+= is operator in c++
a = a + 5
the shorthand would be
a += 5
they do the same thing
Actally, it didnt have the macro labol
I know, i saw a video on unreal fellowship
maybe you can post the picture here
Where yhe host uses a
gtg maybe someone else can take a look
Sure, im not on the pc, but tomorrow i will take a print of it
Hi, I'm having an issue with importing a model with animations. When I import the model, it gets scaled up, and all the animations turn the model into an eldritch horror. I am remaking my project in 5.5, after wanting to restart to better organize what I was doing, and I didn't have this issue in 5.4, so I don't know why this is happening.
Not sure if this is the right channel for this question, but I don't see another to put it in.
I managed to figure it out somehow
is there any chat to VC in regards to this, not particualrly to help, other than the occasional rubber duckying, just honestly find it gets a bit boring given im out of schedule with most of my teams and even in schedule they understandabvly would rather spend it with their own customized background noise
any one know which collision cylinder setting causes the glitchy walking?
hm nm i think i got it .. set the size to 75 and diameter to 21.5 and also set it so its a spectator
so here's a problem i got. i want my player character to not do a spell animation and attack in the air, but the gameplay tags don't seem to be working with it comes to indicating when the player is on the ground or in the air. its either it will work both on ground and air or neither. any suggestions on what i should do?
How would the tag magically do the check if the character is on air?
Can you go through the logic?
You are saying if character has this tag then do this else do that.
But what drives if the character has the tag or not? Where is the missing bits.
the ground and air tags are mapped to the jump input and toggle in between each other whenever the character is in the air or on the ground.
i think maybe it has something to do with the ability not having the reference to the player character directly
so maybe i could add that
This^ feels wrong
@rugged junco if you need to check if the character is in air, there is already variable for that in the cmc that is evaluated every frame.
BIsInAir or something. If not there look at third person template.
You're also not checking if you can jump in the first place, meaning youd pass tags based on an event that may not happen
And being in air is a state that can happen without jumping
As Cold says, CMC does this, and has a movementmodeChanged delegate one could use
hmm
bingo
weird though, because i tried is falling before, and it didn't seemed to work, but now it does
unreal can be weird sometimes
I am trying to create an Inventory System using Blueprints and C++ and now I'm at the point where I'm adding the Items to a widget (WB_Inventory). I'm trying to add my variables to the other Widget (WB_Items) which will go into my vertical list in My Inventory Widget I don't know how to get my variables to be shown on screen I've tried binding but It doesn't work.
Why do you get player character 0 though
You should make the ability generic (works with anyone that granted the ability).
Instead hard coding player character
Perhaps you don't need to grant the ability to anyone else but making it generic takes a few second.
Get avatar actor info-> get component by class -> cmc -> is falling.
im trying to delete obstacles from a course. I am adding obstacles to a a struct that houses an array like so. Pls ignore the adding to the first array and then carrying it over, im just doing that bc the blocks are of a variaty of actor classes so i couldnt just use make array. And then im deleting them and remvoing the array like this
does anyone why it wouldnt be deleting those actors
The first thing which stands out to me is this. That Remove Index won't do anything since the actor this is on gets destroyed before it can be called. Although, if the Floor And Obstacles variable is on this actor, then it would also get destroyed with the actor anyway technically removing everything since it wouldn't exist anymore
its just the array. Originally it was the array floor and obstacles hence the name but it no longer is
i tried removing that and it made no difference tho
i tried using an array of actors and another array of ints to keep track of how many obstacles there were for each floor but that wasnt seeming to wrok either
maybe its because of the change you just listed tho
I think I'm missing part of this. When this ADD is called it's adding another index to the struct array which contains it's own version of the Obstacles array. Then later you're only getting the first index from the struct array, so if that struct array was added to more than once, then the first index likely doesn't include all the obstacles
the obstacles come in sets, i.e each floor has a set of obstacles, after clearing a floor i want to delete that floor and all the assosiated obstacles, so im only ever gonna want to delete the obstacles in habiting the first index I think. I could be misinterpreting how structs and arrays work
the array is only ever added to once when creating the obstacles for a floor. Everytime a floor is added a new set of obstacles is added to the struct but id only want to delete that one once that floor has been cleared. There are ten floors are at a time so the struct should hypothetically have ten imdexs at a time
but it doesnt
unfortunately my breakpoints havent bee working
going step by step helps
yeah
write down the expected output, work your way up. Test the values
the random aspect of it was making it difficult to figure out what the unexpected output was and when it was being caused
i finally just simulated it like a hundred times and noticed a trend
same here
Life is debug, what else
I need to make a pathfinding visualizer today
So i can visualize the steps
What am I doing wrong with those loops?
Top loop aint comnected
both aren't
So you never loop through the keys
but if I connect it via the loop body it will not do the job properly, it will end the function really fast, it will half ass my function, it will just look at the first thing and then go tell to my branch (found or not found) but will not look thoroughly through everything
I want to make sure that they check through everything
why isn't my line trace starting from the center of the screen?
and then, and ONLY then go on.
You'll likely need a local boolean variable to store true if it can craft, then after both loops have completed you return that boolean through the return node
Return should only be called in two situations :
- Both loops are completed, and thus not enough items were found
- early out if all items were found during looping
Oh yeah, could do that. Just connect both loops instead of completed, then move the unchecked return node to the completed of the first loop
That way it'll only call the can't craft return node if it's looped through everything and didn't find it, and if it does find one it exits early with the checked can craft node
yeah but before that my loop wants to go on to something else via the loop body execution, and If I force it to return back to it via the first "Exec" pin then I will cause an infinite loop that will go on forever and ultimately crush my Unreal Engine Editor
You're doing it wrong then
Or those arrays are stupidly huge
but it needs to run through both loops, that will mean it will only run through the first and then call it a day.
Content is = 30 slots
This is what I mean
Yepp , outer loop is the definition of checking everything and still not completing it
outer loop you mean second loop?
No, first
First is always outer
If youd see this in cpp itd make more sense
/*Outermost Loop*/
for (auto Key : Keys)
{
/* Inner Loop */
for (auto Slot : Inventory)
{
// check here
}
}```
For each key you want to chevk if the inventory contains it
Personally
oh, outer is a preposition word describing external spatial positioning, thats why i was confused here
I would suggest doing it the other way around
So you only ever loop the inventory once
And TMap has a O(1) lookup cost
The way you're doing it you worst case end up looping the inventory once for every item in the recipe
I could make a new array or variable storing all the things and quantity of the items found, like a temporary variable, would that be performance efficient? Considering that I have 30 slots on my inventory, and my crafting can have around 20 different types of items with varying quantities each. (So far I've only added around 6-7 craftable items available in the game)
Or just swapping the order
do you know how you can make a homing shot aim towards an actor only when the target lock is activated? so far, i was able to make it act like a homing attack, but i'll have to find out how to either toggle the homing ability or make it so i can tag enemies when i target them.
I don't understand C++ terms. I haven't **unlocked **this **knowledge **yet.
what's TMap? What's 0(1) lookup cost?
Just know its fast
TMap = Map
Your input parameter is of that type
So thats the recipe i assume
Also btw
I forgot a third returnn
If you dont find an item in the inventory, you can instantly return fast on Completed for the inner loop
No need to check for the rest since requirement cannot be met
I'm getting closer, now the trace starts correctly from the center of the screen but ends a bit too low and to the left while it should go straight out from the viewport. Ideas?
im already doing that or you mean i should try to do that for speed?
Remove this link. When it's there it means it'll exit early no matter what
Let me slap up an example
you mean to tell me i should use maps? im already using that for my crafting
but not for my inventory array
crafting is map/dictionary
no im not saying that at all
inventory is fine as an array
recipe makes sense as a map
You want your outerloop to be inventory
and innerloop to be the tmap
or rather
its not even a loop
ill show you in a minute
the only loop you need is the inventory loop
worst case scenario, you loop through the entire inventory, and return false
best case, you end it before that
I find no bugs with that, though I only test it on 2 items with simple recipes so far.
Loop through inventory -> Check if the current inventory slot is in the recipe -> remove the slot amount -> if new sum is less than or equal to 0, remove the item from the recipe (we've found enough of that item 🙂 ) , else, add (which replaces existing) new amount to the recipe list.
If recipe list turns out empty after removing an Entry, we can return with a success , as all items were found
If we complete the loop, it means we never found all items, which in turn means we failed.
Worst case complexity is O(n), meaning we'd loop the inventory one full loop.
Hi, I want to store pistol ammo without resting when switching weapons. I have an idea to store it in data assets. Is it okay to store them?
no, data assets are for read purposes
while it's not impossible to write to them, it make no sense
The ammunition should belong to your Weapon class
where each instance track their own ammo
The usses of data assets in these casses is probably to just initialize default data for the weapon instance
Thx
the end should be
EndLocation = WorldPosition + (Direction * distance)
not good at math, but maybe you can try that
If you skip the addition, it will kind of just start from the world origin. You gotta offset it to start from the StartLocation
@muted socket
Hey everyone! 👋
I’m running into an issue with my graphics settings in my game, and I could really use some advice.
Here’s the problem: When switching between graphics settings (e.g., Low, Medium, High, Ultra), everything works fine until I select Ultra. Once Ultra is selected, I can’t switch back to any other setting. I’m using a Blueprint setup with a clamped integer variable (GraphicsEX) that ranges from 0 to 5 for the different settings. I’ve also ensured that ApplySettings is called, but it still locks when selecting Ultra.
Does anyone know what might be causing this or have ideas on how to fix it? I’ve attached a screenshot of the logic for reference. Any help would be awesome! 😊
Thanks in advance! 🙏
this code stops the players movement, and plays a message on screen, however it doesnt go back to walking after, i know the walking mode says none at the end. ive already tried changing that.
you have +1 on both buttons
What should they be because I tried making it 1+ and -1 but it still doesn't allow me to go back from ultra to low
try on clicked graphic- to either change value to -1 or use substract node
you can also print the value you are getting after button press to see what it does
So if I do this get a ref to an array element and if I then use Set Memebers on the promoted variable will that alter the array element in the array or would I need to remove and re-add the element with the new values ?
It will alter the array element yes
Why when i changed the resize value, the logic looping by the resize value https://blueprintue.com/blueprint/ib3jxot5/
screen shoot your bp, that website can't represents something 1 : 1
awsome thank you, normally I do this stuff in Cpp thats all so use to how it looks at works in there
So like that
the temp is the cache element from the array by ref and the new item data is the altered version of it with the changes
The Array index should be 0, but when i print the amount is 3
why should it be 0? You resize it to 3.
So you have 0 , 1 , 2
the logic looping by the array resize value
i know but the issue not that
maybe it's language barrier
read the comment
masalahnya apa terus?
bentar
The "Event_Pickup_Gun" Looping by the resize value
but for the "PickupItem" not looping even the resize change
Print the length of the array
1."Items Items"
2."Items Gun"
the len is normal
so you are saying the loop doesn't loop 12 times?
if so, did you print the length just before the loop?
this node really exist ?
wait
i try to make a description from the issue
source?
some ia that i dont remember the name
ia? or AI?
then that explains it
'+='
LLM spit something that doesn't exist quiet often than not
your only option in bp is probably a macro
though what's wrong with just a = a + 5
i saw a video of unreal fellowship, a node with this symbol '+=' that did the addition assignment
it didnt have the macro symbol in the node
is possible to change the symbol of the macro nodes ?
perhaps its custom node
never seen it but I am gonna guess what ever you seeing is a macro anyway
can just make a macro really
"PickupItem" not looping even the resize value change (this is what I want), but The "Event_Pickup_Gun" Looping when the resize value change (I don't want this),
Example :
items_items resize = 12
Run "PickupItem" only playing 1 time even the value 12 (this is what I want)
items_Gun = 3
Run "Event_Pickup_Gun" playing 3 times like the value (I don't want this)
function for that doesn't make sense as you probably want to re-use it in all your bps
do a print string here of your index
before the is valid check
The loops just go over every element in the array
nothing can be suggested without knowing the context
1.items_items
2.itmes-Gun
yup, so everything in order
the loops just iterate every element in the array
What's the logic you are executing for every iteration?
but if i pritn after valid
1.items_items
2.items_Gun
to make Event_Pickup_Gun looping one time
what's the condition? You just want to break away at the first loop (index 0)?
then you wouldn't need to use loop at all and just get index 0, but I have a feeling you will end up with more bugs
make a sense, but the variable need to communicate with another blueprint
that's kinda irrelevant
i can say same logic with different result
look this,
macro nodes can have execution pin ?
What you probably want is loop over element that have valid item
but everything is a guessing game as I don't know how you tackle your inventory system
you should have a function that checks if an element is a valid item or not.
Checking if the name is empty can be one of the condition.
anyone have any ideia on how do i enable that epic library
so i can use/enable this
the first image, I ran the logic and showing 3 result when i picked a gun (1 gun), the secodn image , i ran the logic and showing 1 result when i picked 1 item.(the purpose is if i picked one the array only fill 1)
it's a library, you probably have to download it
then don't do resize?
or like I just suggested, you can just loop over valid items
If the Name is Empty, simply do nothing
Yes, the resize only for the item slot
if you want to loop only over valid item, then do just that.
Check if the element has a valid Item Name, if false, do nothing
The loop only for fill the slot, not for looping the logic
For every Item in Items
Index 0 - > Does it have valid Item Name? -> If true, do something, else do nothing
Index 1 -> Does it have valid Item Name? -> If true, do something, else do nothing
Index 2 -> Does it have valid Item Name? -> If true, do something, else do nothing
......
And so on
Like that, but i don't know why when i picked 1 gun the logic do 3 Times
because For Each loop Iterates every element in the array
that said you can chose to not execute any code on Element without valid item, by doing the check
why "PickupItem" only looping one time even the resize length is 12
not like "Event_Pickup_Gun" looping by the resize length
Show me a screen shot on how you print PickUpItem
It's actually looping 3 times
but it doesn't go past the valid check on some indexes
it didn't for a fact only loop one time
what wrong with "Event_Pickup_Gun"
there are same logics
Use break point and go step by step
-# might as well practice to make a standalone inventory system at this point
don't throw nodes without understanding what they do including the IsValid check
my final suggestion is, if you want to iterate over valid items in ItemGuns, you can check if the element has a valid ItemName
other than that, there's nothing else I can add.
for each loop with break?
no, it's a debugging technique
right click a node and add breakpoint, that will stop the game execution right at the node.
You can then go over the next nodes step by step.
i saw "PickupItem" looping 12 times, "Event_Pickup_Gun" 3 times
i just confused why the varibles fill 3 objects
you resize the array to 3 elements 🤷♂️
PickupItem fill 1 object even the resize 12
i'll use another technique
this is weird
incorrect, there are 12 items in it
the print strings already proof it
why this is fill 1
probably cropped but ItemsItems have 12 elements
you are just changing the first index
the array still holds 12 elements
i created the code but i confused with my code, really weird
comments can help if you forget your code, next time make some comments
but just try to follow the execution to figure out what is going on
unfortunately your lines are a little crossed up and hard to really see what is going on quickly
But this will say " craftable " when you can afford only just one of the items in the ingredients list.
E.g. here:
Note: My project wasn't saved properly earlier, because someone was experimenting with some broken devices and my house's electricity went out and so progress wasn't saved, so I had to redo everything again, there could be some bugs right now. Like for example the way the craft button is set to disabled right now.
Is there a way to edit specific keys of specific bone inside animation sequence? (using editor utility blueprint)
Also I dont understand why it says "Craft" but the button is shown as disabled ???
It's still pressable though, Im pressing it and the color changes but the color of the text looks kinda anemic or smth.
Anyway that's irrelevant, I think the problem still remains here.
Does it need to be true when everything from the ingredients is in the content array?
So I went back and watched the Youtube video , and I found 1 mistake it should be subtract and add , but still when I go past ultra it goes away and doesnt loop back to low
if you want it to loop then make it so
If Index > Max
Index = 0
If Index < 0
Index = Max
as coldsummer says, i made similar thing for my inventory hotbar, wanted to use wrap node but it did not work as intended for some reason so made custom function for that
i made mine like this in function library so i can reuse it
I mean my logic right now would be equivalent to ... You cooking food, making the sauce but skip the pasta, veggies, and sides, and someone says, oh wow "This dish is perfect!"
Index % length
Or, when you go to the grocery store for shopping, you're holding a 15-item list of essential thigns you agreed with your family you're gonna buy... you buy only chips, and the family says, "Great job stocking up!"
any idea why this works when I use the "Play" pin but doesn't work when I use "Play from start"?
Any quirk I should be aware of?
Is there a way to edit specific keys of specific bone inside animation sequence? (using editor utility blueprint)
show your timeline curve
looks ok...what is start pause button?
It's another actor with a simple plane on it. It's these two buttons, I want them to grow slightly when the player looks at them
btw are you sure it's not playing even once?
i mean it's one second it might be too fast for you to notice
yes
bugged how?
I'm sure, I can see it play when I use "play", but it does nothing when I use "play from start"
Once you finished playing, it's not gonna play anymore
since the timeline would be at the end
don't you mean the other way around?
isn't that the whole point of having "play from start"?
100% sure
yea well, it's working fine on my end
child actors have lots of bugs and you better not use it
wait no maybe I know
create another test component on this actor and test if it behaves OK with this timeline
So then you want it to return false if any of the ingredients aren't in the content array. Here's what I would do:
- Make a local boolean var. This will keep track of whether or not an ingredient is found in the content array.
- SET this boolean var to false before the second loop. This is to reset it before it checks for the next ingredient.
- After the branch's true SET the boolean to true. The ingredient was found.
- Add another branch after the second loop's completed and plug the boolean var into it. We'll act on whether or not the ingredient was found.
- Move the unchecked return node to the false of this new branch. If any ingredient is not found this will break out of the function saying it can't be crafted.
- Move the checked return node to the first loop's completed. If it gets far enough to have completed the first loop, then all ingredients were found.
I use a line trace to trigger the "play" even. If the trace hits the button, start playing, but since the trace is still hitting the button it will trigger the "play from start" over and over, every frame
yeah...
I need to keep a "isPlaying" variable and only trigger the animation if "isPlaying" is false
shouldn't use play from start when growing or shringking buttons
When not looking -> Reverse the timeline
When looking Play the timeline
that's what I was trying, but if I only use play I'll have to reset the timeline to 0 and then play otherwise it wouldn't play if I look away and then back onto it
you don't
you just reverse the timeline when you are not looking
this way u get a smooth transition instead snappy back to the scale at time 0 value
The only problem I could see with this is if any recipe requires multiple separate instances of the same ingredient. Since each ingredient will be checked against the entire contents array it could count the same content index for multiple ingredients if that one item is needed multiple times.
Also, if there could be multiple stacks of the same item but in different entries of the content array it wouldn't count them together.
I get that, that's for the shrinking, but if I then look back at it I will have to set timeline to 0 and play. I was planning of using "Play from start" for the growing and "Reverse from end" for the shrinking
No, if you are looking at it, keep it playing
when not looking shringking
so u dont SNAP the value to 0
If hovered Play anim
If Unhovered Play reverse
if I chose to play from the start, I will get snap effect
I'm doing the same thing and it doesn't snap
if you finished the timeline
says it's already 200% the scale
Then you stop looking where it will windback to 0% within 3 seconds
but u look back within 1 second
the scale will snap to default scale again
ah ok, I see what you mean
since looking is evaluated every frame, you can do some checks to not run the play function again when its already playing
but eh, honestly it's probably doesn't take much performance
if it's neglegible, I would just say, play the timeline when you look at it
and just rewind the timeline when you are no longer looking at it
and for the "Look away" part, what would be the best way for it? Do you use the Tick event to check if you're looking at it or does the line trace have a handy helper?
WDYM different entries?
sorry found it, I can use a branch after the trace
You are already using tick for looking and it's only natural that you used tick here so you get the smootest experience.
If HitActor != Selected Actor
Selected Actor -> RunFunctionThePlayerStopLookingAtMe
and that function can just rewind the timeline
Like different indices of the content array. Since it's only checking each entry in the content array individually if there are multiple stacks of the same item spread out across multiple entries in the content array, then this method won't add them together. As in if you need 64 of an item, but it's spread out in two stacks of 32, then it'll see 32, say there's not enough, then see 32 again and say it's not enough without adding them together.
I don't know if this situation is possible for your use case or not though
this is suposed to make the light flash increase in speed but doenst have that effect. Think about it like increasing danger, starts slow and then increases until boom, currently lights flash evenly and then boom. any surgestions would eb most welcome thank you
I sent a functional snippet earlier
This^
@lost hemlock just copy what my snippet does
why so?
You mean the first or the second? Because so far testing on these 2 items, axe (made out of 1 stone & 1 wood ) and basic wooden hammer (made out of 2 wood) gave me no problem with this technique up here
The 2nd is just an example to show the problem, im no longer using that version because it would let you craft even tho you had the recipe unfinished
you just have to find a single insufficient for it being "not craftable"
Indeed
how would I find a single insufficient? 
Inverse of finding the thing
If loop completes and you dont find what you're after ..
But then it finishes as negative
Your setup has a squared complexity as it is now tho so if you aim for rather large inventory or craftables, this might spiral out of cost
you mean in terms of performance?
Yes
what are you trying to do Terra?
But I need to know how to prevent any performance issues
For each item you're looking for you will worst case go through close to entire inventory
(I am nervous about it)
yeah but what other better way is there?
The one i sent you lol
perhaps im using some kind of outdated medieval barbarian slow method
Free of charge 😅
btw, why would it cause performance issues?
if you have 3000 items, worst case you'd have to loop through each one
im guessing it will do no more than 30 loops ?
If hes looking for 10 items, and those happen to be at the end of theninventory array
Thats 3000*10-10 iterations
I think you'd want a map
He got a map
But needs to swap the order
Complexity decrease to O(n), single loop
Which is "just" 3000 iterations
for each, if item is in the map, check if i have enough amount that the map needs
Indeed
yeap
Which is what my suggestion does
Doesn't the "Find" node also do some kind of boring iteration work inside of it? I mean how does it find the thing you want automatically?
that's what I was wondering
No, its using an internal hashmap,
yes but no 😄
Maps are O(1) in lookup
it uses a hashmap to resolve the key to value in o(1)
Meaning that it does not iterate. It simply asks the map where in it's memory said item key is and goes straight to it.
Its like an array index kinda
Not that it would really matter, iterating 10,000 times to check if something is in an inventoryits is lightwork.
Map and Set doesnt need to iterate when doing lookups
If you wanna reduce cost further
Does that mean that you can also get rid of this loop then?
You can maintain an additional list of items in inventory in a map
For the initial "does inventory have this item"
loops are slow, inefficient and bureaucratic like the byzantine empire. I get it.
or are they?
Only in BP.
Lightwork in cpp
this is so wrong nvm
Also you can improve the foreach loop blueprint macro in UE by far if you know what you're doing
this is what I'd do
maybe yall can tear it apart lol. I only work in bp so I don't know jack shit about inefficiency
This is wrong i think
The issue with BP loops is that for start they're a macro. Which means they loop every internal function each loop as well. It's something like almost two dozen function calls before you even get to what is in the loop body. Now if you access the array element or array index, you're also running much more than just a getter.
I remember seeing a video about that
Using increment int
And a few other tweaks
I'm making a soulslike so I dont care about BP performance heheh. Graphics are what will do me in
it will be okay until a gamethread spike killed you on boss last hp 😆
lol i had some things backwards, i thiiiink this would work. Would require everytime you add/subtract an item form inventory you update a map
I still dont understand garbage collection and at this point Im terrified
looks good to me
question for data assets, if I change data during runtime (like i have a variable stored in a data asset and i change its value), does it persist and if so, for how long?
it does persist until the asset is being reloaded(aka restart game), but you dont really want to do that
perfect
i just needed it to be able to reset if the game restarts
does it restart if i were to go to different scenes?
i dont know if it will go away or not when you loose reference to it (open level)
no body does that anyway
eye sea
i guess on safe side i'll just store some of its data onto a save file when moving scenes
mostly was the idea of storing a cumulation of a resource per skill to be used to activate it
and being able to keep track of it even if the skill were to be swapped out and then back in
just for as long as the player is in the dungeon
and then it just resets when they leave it
Hello, I have this projectile that I cast to overlap with my pawn, but I also have other projectiles that I want to do this same code with, how do I make them all cast to this code?
if the other projectiles are children of that projectile, package that into a function and the rest of the children will use that same function
Souls like but instead of ghosts invading your session, you get ghost frames invading your session
Ghostlike
you have infinite I-frames but you don't know what attacks can actually hit you
You get infinite iframes, spend them wisely
Wouldn't this be faster? If Im arraying over the inventory Content first and then the ingredients?
Comparing this to what I had before.
Am I missing something when it comes to debugging a function in a blueprint function library? There's no debug objects to select, so I can't watch or see any of the variables as they get set. Are there tricks to debugging these?
Did you look at what I posted?
oh, this?
Yea that one
Print strings. Print strings everywhere
Map container for inventory is usually not something one wants
To limiting
Not replicating etc
Order is not preserved
Couldn’t you have the inventory and just keep a map that checks the items?
You could maintain a map alongside the inventory array
Yeah maybe not the best way to do it. I use an array of strucs
If you truly aimed for 1000s of items in the inventory
That’s what I meant
And needed a quick out, in bp only project
Ita troublesome to remove items then
You basically need to looop theninventory again
And check if any of the same item remains
Yeah you wouldn’t be able to get out of using a loop at some point I don’t think
If you had the inventory array and inventory map you could get the index without a loop using the map
And one for checking after you're removed it from the inventory, so the map would be updated
But yeah I don’t know what the logistics are of keeping the array and map in the same order
I suppose you could get away with using the very same loop, since it would take the first index, and you'd "only" need to check the rest
dont prematurely optimize
True
Take the low hanging fruits 💁♂️
Sometime you should
if you call it just once its not worth it
I think there’s a balance
If you already have the solution and know the full skeleton of your system
And if editing that later costs to much time and rework
You always should be thinking about optimization, but you need to balance over engineering
Imagine setting everything up with casts instead of interfaces. Couldn’t be me
Maps for inventory are not always used because Maps arent supported in multiplayer
Oh shit really?
Damn I had no idea
So you usually use Arrays, or fast array serializer (c++ only thing)
The later is useful if you add/remove/edit elements in a big array and get events when something got added/edited/removed
Theres caveats with that one aswell
Fastarray, that is
Its not always what its named to be
Its has a bigger overhead
And is slower in some situations
If your array is max around 20-50 you can be fine with regular arrays
#multiplayer message you were in the chat ;p
Anyhow , tmap recipe list and array inventory goes neatly together so its a fine setup imo
------------question : best approach to handle x amount of actors , each with different logic ?
*context :
ive got a base bp actor that holds all the data regarding every other actor like mesh size , icon ....etc (extracted from data table)
now each actor can have different behaviour/animations/functionality , so im faced with two options :
1-use switch and enum in the base actor bp and go from there
2-use child bp from that and then do add the custom logic
ps (i tried child bp but casting to the child bp always fails )
Child bp, with the events/functions in the parent
Then it just calls the functions as normal, and child overrides what that actually does
Regular inheritance
Never cast to a child class in a parent class
And dont push all your logic into a giga parent actor , imho. Separation of concerns and logic 🙂
the casting part happens in another actor bp which is trigger box to make the item placement at specific spot , i made the custom logic in the child bp , and i need the overlap to be caused by this specific child to trigger the event yet it fails
thats if i were to avoid crowding parent bp with the logic of every actor
will this cause any performance issues ?
i can manage ,since its the only approach thats whithin the range of my understanding
thank you
famous last words
How do i remove a widget from viewport?
Remove from parent
I need to cast to the widget then, right?
or store a reference to the widget when you first add it
Or let it remove itself
Depending on whats fitting
I prefer, when i can, to let the widget logic rest in the widget itself
How
101 things
Thanks
Guys I feel like I'm going crazy, this feels like such a mundane thing and I cannot figure it out for the life of me. I'm making a linetrace of my first person camera and trying to get it to output to it's forward position, could I get some advice on what I'm doing wrong here?
I have no clue why it's firing in such a specific direction when all I'm trying to do is fire straight forward?
you need to multiply it
you are adding to the forward vector, when you need to multiply
i've pulled my hair out over tiny mistakes at night several times
why is my 4 second delay taking 12 seconds
Haha
why is this 4 second delay taking 12 seconds
hello - currently working on an animal crossing cylinder world style shader using this tutorial https://youtu.be/VCmDwfMz-jk?si=PBYzNI95XqbCL3Ri i've got the curvature working currently but all of the other things in the scene are floating. any ideas? I believe i've applied the function to all of the materials but that hasn't changed anything
This is my first Unreal Engine 4 tutorial about Curved World Shader.
Chapters:
0:00 Introduction
0:28 Add Material Function and Material Parameter Collection
0:55 Add parameters to Material Parameter Collection
1:43 Make Material Function
3:45 Add material function to our materials
4:41 Add default parameter values
5:37 Flickering meshes fix
6:...
please can someone help me
im no pro but it seems like u made a loop in there (assuming thats the case ) which means somehow theres a condition before that that makes those instructions fire 3 times ?
can you show the set up before that
here it is
can you disconnect the link of the last print node ? and then test and see if the prob still occurs
its still not working
try remove the delay and test again ?
like this?
yeah
it shows up instantly
hmm , okay , put back the delay but disconnect the two branches
fire it directly without conditions , and keep the delay and see if it count for 4 seconds
Things that would affect delays
i shouldnt have anything that affects the delays
If they take 12 seconds when they should take 4, im inclined to think you do
Check class defaults
I think it'd show up there for default values
And please 😂
Collapse things to functions and clean it up a little :p
For your own sake
its at the top in that bar where the green play button is
Guess its not in class defaults then
Yep
On beginplay
You can print them
GetGlobalTimeDialation
And
GetCustomTimeDialation
Youd probably know tho tbh
Game would run slower
4/12 = 0.33
it prints 1.0
i just counted
So its not reset ?
exactly
As in yoj cant jump again?
yeah
Set timer by event
otherwise u can just fly by spam jumping
how would i do that? can u show/explain how i can do the set timer by event
bc i tried that
and
it didnt go so well
but
Get character movement component -> isFalling
then?
Use that in a bramch instead of the reset
Remobe the 4sec delay and let the IsFalling ditctate wether you can jump again or not
Aalso, why isnt this regular jump?
yeah but i also need the delay so u cant just run away from your enemy
its a dash feature
how do i do the set timer by event
Call that functionn
Drag from the red pin
Create custom event
Reset "DashCooldown"
how would i reset it?
With the custom event
Noot really
Replace doOnce with branch
On true of branch set DashIsOnCooldown (bool) to true -> call Swr rimer by event -> dash logic
Then Set timer by event -> custom event which only sets DashIsOnCooldown to false
Any shader experts that can help me out
Getting there
Branch checks that DashIsOnCooldown is false before continuing
And sets it to true instantly
The custom event sets it to false
ok
lets say iw antewd a proggress bar that indicates when u can dash agian
how would i do that
Allowing you to read elapsed time
ok
how?
SetTimerByEvent has an output pin
Promote that to a variable
DashTimerHandle
Now you cam use that variable to get some info about it
how?
Grab the variable ?
Id let the widget read the dashTimerHandle variable from the characterbp
Not push the data to the widget
But let the widget read it
You could set it up with an event dispatcher instead if you wanted to
Id just let the widget tick handle it tho
Dashtimer should be the timer handle
Then you need to check if its valid
And if its valid (or the DashCooldown bool is true), take elapsed / DashCooldownTime(the float variable used in the timer)
how do i check if its valid
Drag from it
how can i do allat
Type is valid
in the widget or
Yes
i cant
You might need to clear and invalidate it when you set the DashCooldown to false
Im unsure if its invalid once it runs out
Wrong variable
Or variabletype
Right click the outout pin from SetTimerByHandle
Promote to variable
wait
Thats the var you want in the widget
this is in the widget blueprint
Yep
Yepp
is this right?
Dashtimer should be the Time input on the SetTimerByHandle
With default value of 4.0
(Name is not very descriptive imo)
set timer by handle doesnt exist
Huh?
We're in the char bp still
yes
u mean set timer by event?
Sry yes
I made a glider system, I switch to flying mode while flying. I use on land for landing on the ground, but on land does not work when in fling mode. I tested it, if I touch the ground in walking mode, on land works. How can I solve it?
awesome
this is how mine would look like
ish
and something like this in the widget
since we have a timer handle, the extra bool is sorta redundant
switch mode when you land
do a ground trace and define when to switch
or see if collision gets a hit
How do I change the mode when I land without realizing I've landed?
OnLanding is very specific for falling
try EventHit instead
could be usefull in general, when gliding 🙂
thanks I will try. have a good day
@gentle urchin a very patient teacher 🐱
Sometimes, not always lol
Anyone every used Set Focal Point for an AI?
is there a way to add a gameplay tag to an object you are targeting? i'm trying to make a toggle for a homing attack and i can't seem to figure out how to make it so the homing attack only homes onto an object when the target lock widget is activated
I will try to understand one of the "issue" here
lets talk about adding or removing gameplay tag
what issue do you have with it
i need the gameplay tag to be added to a object when the target locks onto it in order for the homing shot to tell what to home onto
right now it will lock onto a target by default if the object already has the tag on them, but i want it so the tag toggles when the target lock widget is locked onto them
lets focus on the gameplay tag
did you succesfully added the tag to the target actor?
verify the result
unfortunately no, it didn't work. the only tag on them is the enemy tag on the actor menu
The details panel there doesn't show you the runtime values.
You can use breakpoints (selecting a node and pressing F9 on it) which can halt execution and give you an indication of what logic chain is flowing
Alternatively, you can put print strings around and see which ones are being hit.
read what datura says
you can eject from your controller, click on the actor during pie and see the value. Or just print string
what you seeing up there is a "template". It doesn't represent the actual instance created during run time.
i tried added a sphere collision to the target lock actor and seeing if that could trigger the overlap, and didn't seem to work
Tried helping you with one problem at a time but you are too focused doing stuff without testing if the actor has the tag or not.
i tested it, and no it didn't recognized if it had the tag.
i tried with the breakpoints and print string, and none of them triggered
Your earlier picture proves that you don't know how to check the values.
Show
Have you tried ejecting from the controller, select the actor and check the values?
excuse the bad editing, but i haven't tried ejecting the controller but i did do the breakpoints and checking the values of the actor
If the function never get called work your way up
Find out where it's supposed to be called and find out why it isn't being called
is there a way to bind on widget destruction or removal?
increment and decrement don't call RepNotify?
Not on the server. The Set w/Notify node does that internally for the server. It's something that annoys a lot of network engineers because it's not as common to run OnReps on the server. Setting the value in any other way than that set node will only make it run when it arrives on the client if the client has a different value.
Event Destruct is ran when it's removed from it's parent.
Thanks, now i understand.
I dislike how Bp OnRep fire on server
Curious why they didn't make that a project setting.
so, I have a problem where Structure is unknown again and gives me packaging errors. I know that this is a common problem with unreal engine where blueprints for the structures get corrupted, either by moving them or something else. is there a way to fix this without creating another structure file? I cant really replace the references everywhere.
Don't use blueprint struct if you don't want to get that error
the "fix" not even fix, I would call it a bandaid, is to rename the struct
but this will revert all the values to default
blueprint struct is a minefield and it kills the project silently since you won't know you break it until you try to package the project
@mild jacinth declare the struct in cpp if you want to keep your sanity
Heya guys, back again with another query - trying to update a widget to display a specific string of dialogue on click, but my text variable is returning none despite it being inside the widget? InteractiveText is the name of the widget while it is being accessed by another blueprint, and it seems the issue is specifically coming from the Interaction Text variable?
Am I just missing something here?
When I go to assign something to the text (which I don't understand why I would need to if it's a variable from an existing text component?) I don't have anything to assign to it.
That's just a variable of type text, it's not the text component inside your widget.
Show your widget in Designer tab
I'm trying to get a secondary widget to remove itself once the other widget is removed from parent
show the full error
weird, it looks like it should work
Yeah, I might just remake the widget and see if that fixes things
No dice. I've got no clue what I'm doing wrong here.
What does this do as opposed to a binding?
in a widget
I know bindings typically work on tick
does this work in another way?
you probably just bind it to barPercentFill variable?
it will just set the percent to barPercentFill value every tick
my guess
yeah but when i change that var, nothing happens
I normally just use the create binding if I need something updated every tick
i dont need it every tick
but i figured i could find easy ways to update it
and by easy i mean lazy
The only two bindings that are not every frame, are TooltipWidget, and the new MVVM bindings.
Are you sure you're setting that variable to a value between 0.0 and 1.0?
yup, print string confirms it
It definitely works. That said, I tend to personally despise UMG bindings. Run into too many issues with them. And on top of that I prefer just to be able to open my widgets and look at Event Tick to see everything that is poll updated.
need some help with math
I got the green vector, but I want to clamp it by considering the capsule radius of the target actor
How can I get the orange location?
how are you getting the vector? difference in 2 locations?
does subtracting p1 and p2 location gives the green vector?
((Direction x -1) x CapsuleRadius) + P2
yes
did you want the location or directional vector?
Direction is going towards P2, want it going away from.
kinda complicated, when the player too far away, I'm trying to just pull the character towards the target by some Pull Distance
but when too close, I need to clamp the range
Try Authar's method
Presuming P1 and P2 are on equal Z levels, the above math will work to get the yellow location.
yeah doing it now, thanks
I got a flat level atm, but it wont always be flat
what if the Z is different?
btw direction would be P1 - P2 then normalize right?
Maybe project it to a plane in that case. Get the yellow point in the same way. But then line plane intersect the points to a plane at that yellow location, facing P1
P2 - P1.
i would figure you want the same Z as the character so just break vectors and set the Z
Target minus Start
Do I still need to flip the result if Target minus Start?
You could do it the other way around in that case. I just assume you already had the direction from something else. 😄
what you could also do is normalize the vector for direction, get the distance between them and subtract the radius
Doesn't quite work at differing Zlevels though.
🥹 I will try to use the basic solution first
Yeah, you could do that and add the P2 Z back maybe.
z problem can come after
alternatively, if you know where you want it relative to the player, or character, put a scene comp and use that as a ref
which is probably easiest
hii, what did i do wrong here? my gun isnt shooting straight but i dont see anything wrong with the code and the socket isnt rotated weirdly
// Too close, get the point just outside the target capsule radius
FVector DirectionFromTarget = TargetingComponent->SelectedActor->GetActorLocation() - Actor->GetActorLocation();
DirectionFromTarget.Normalize(0.01f);
FVector FinalLocation = TargetingComponent->SelectedActor->GetActorLocation() + (DirectionFromTarget * Cast<ACharacter>(TargetingComponent->SelectedActor)->GetCapsuleComponent()->GetScaledCapsuleRadius() * 1.5f;
disregarding the Z, does it look correct?
attach a preview asset to the muzzle
see if it actually pointing straight
how do i do that? this is the first time im using unreal sorry for the dumb quesiton lol
right click here and select add preview assets
you probably want an arrow or something
hmm yeah looks like thats the issue, so do i just rotate the muzzel by 90?
that's not the best mesh to visualize
i searched arrow and this popped up so i just used it
what is 1.5f?
instead the edge of the capsule, I want to offset it more
oh ok
Red arrow forward. Green arrow right. Blue arrow up.
yeah looks good to me
testing X_X
ahh ok that explains it thanks!
i changed it and the red arrow is pointing forward now but its still shooting sideways, this time more like a 45 angle
If keys dont show up in Blackboard blueprint, is that corruption or something? I remember that you could add keys in there.
It just shows parent Blackboard class dropdown and thats it
Hello I am having an issue with using PCG. I am creating a backrooms level 0 using PCG. I have created a way to specify where i want walls to not spawn (creates a room of whatever size i choose but no way in or out) and i have created a way to make doorways for that area. My issue is that instead of creating a doorway using the provided SM, it creates gaps. I will attach screenshots of the issue, the code, and a little debugging if anything else is needed please let me know
in the build or PIE? blackboards work differently
In the Editor
No keys tab just the BT tab
No + sign to add new keys
either the BB wasn't tied to a BT or.... something else
when I open BT itself under details I can see the default key
no way to modify or add new ones or remove any of those
I'd remake it and see if it works. Somewhere the link is broken
still nothing
wasnt enabled
works now?
yeah it was just hidden. no idea why one of the windows was disabled
doesn't it work?
i mean, in the static image, looks good to me 😄
I didn't flip the vector, it came out at the other side
flipping now
the red arrow is pointing right now and the preview looks good as well but its still not shooting straight and for some reason it all looks like its pointing in the same direction
you should... uh... flip em with their legs up once in a while, you know, extra stun for the fans 😉 @frosty heron
try this @final ferry
it's probably hard to align the muzzle to where the crosshair is pointing at
not sure how others do it, but I would probably just fake it in a sense that, there may be a little bit of bending but what;s important is, the linetrace hits where my crosshair is pointing at
works perfectly now thanks, but can you explain it?
oh, is he trying to get where the screen is pointed at?
im just trying to get it to where the gun is pointing it, for now
i will have another mechanic for where the bullet shoots later but i want to figure out what is happening with this for now cuz i might need to know later and its just better to not avoid bugs
sure, so basically you have location vectors and directional vectors.
In your socket transform, your start is the location (hi5!)
For the end, you took the forward vector (a direction) and multiplied it by 1500. That makes no sense. You basically made something pointing somewhere times 1500.
What you want to do is add that value to another location to get the resulting location.
Location + Direction = new location.
Location - Location = direction to location (i forget which).
i think i understand, i just followed a tutorial and it worked for him, i did use a model that i need to rotate myself so i thought that was the problem
@final ferry If you are missing the MuzzleLocation in EndLocation, then you will start from the world origin (0,0,0). You have to offset and start from the point that you want, which is the muzzle location
vectors just need to be understood as either locations or directions.
In traces, you have 2 locations.
If you want to point from A to B, you need to add a direction to A to get to B.
Wellllllll
and this is the code from video im following, so now im confused why his works
is the forward vector of the rotation, the direction?
it probably doesn't. he probably cut out when he does something out of the ordinary
yes
it's in the name
forward
thats annoying, why would someone make a tutorial where they cut out the important bits lmao
Moving from A to B requires a directional vector multiplied by a magnitude
because they needed content and doesn't understand how it works
yes @gentle urchin is correct, i forgot to mention magnitude
good catch
and magnitude is the 1500 i multiplied by?
@gentle urchin How's the path finding going?
yes
got it thanks!
otherwise direction is 1
No goood , no time yet 😅
? what's going on with pathfinding?
Directional vectors are like an arrow. They got a fixed magnitude of 1, and only points in a direction
Nothing much, gonna give A* a go implementing my first pathfinding algo with some visualizer
turn based or live?
unreal has its own pathfinding thing
i used it for a maze game
Turn based
hm, do you want a resource?
Yeah i know but its not really attuned for any grid alternative
For sure
i'll dm, sec
sec
So could you say, you're having trouble finding the time to find the path to the path finding?
found another thing where in the vid its perfectly fine but mine doesnt work
so after i damage an enemy they die and should ragdoll, they dying part works fine (i removed the ragdoll and the model just falls through the floor)
but with ragdoll, it got the error "Set to simulate physics but Collision Enabled is incompatible"
searched it up online and put collision enable to physics only and i stopped getting error but the npc stopped dying
the hitscan doesnt seem to work anymore so i checked the ignore box on hitscan for mesh like the capsule but that didnt fix it, whats wrong here?
(sorry for a block of text)
Query and Physics instead of Physics only
you mean this?
i put it on mesh and it didnt work..
Go for Collision Enabled (Query and Physics)
well that might not make all your problem suddenly go away but that's should be the setting imo
As for your line trace, what are you trying to hit againts? The capsule or the physic assets of the character?
That would be accurate 😆
the assert itself
if you are trying to hit againts the mesh component, then I do assumed you already have Physic assets
still isnt working
Post the physic assets and the collision settings
Also play in editor, open the console with ` key. Then type Show Collision
i honeslty might be wrong and think the physic asset is something else so ill post the entire thing(this is the one that gives error)
ignore hitscan in mesh gives no error but enemy dont die
snickers
when is this called? You are overriding the collision settings
at the time this is called, your hit scan will no longer work
well you are ignoring visibility
this is the whole code
in your previous shot, your collision for trace is visibility
but you set it to ignore
make it block or overlap (maybe?)
for all 3?
for the Mesh component
whatever you want to trace against
is there a way to detect the normal of collision touching my pawn?
I mean, if you switch it on the capsule component then the trace would hit againts your capsule instead
unless you need bodyparts, do capsule