#blueprint
1 messages · Page 156 of 1
it's on an per actor basis (unless there's a second implementation which i'm not aware of)
so it's best to just put an interface on all the actors that have that component, do get all actors with interface, then from that interface "get component of class"
no
it's on an actor instance basis
not for all actors of the same type
ah nvm
you want to filter all actors first by the interface class
that may work
yeah, then do a for each loop, to cycle through them and inside the for each loop, get component of class
yea that would do it, however that sounds like a weird use case...
it's for save files... saves are weird
I'm basically trying to grab inventories from chests and NPCs to store their contents
i would register them to some global actor which can fire an event that they can listen to
or if you do C++ use a subsystem and register them there
yeah no I'm not doing C++
or wait, didn't 5.4 or smth even introduce blueprint subsystems?! :>
might be worth looking into that 🤷
I'm not upgrading to 5.4 until it's FAR more stable
there's been so many complaints coming out of that version
but the thing is they already are kinda registered to a global actor, like all NPCs in the game are children of a parent blueprint, same with all containers in the world are children of a parent box, but I wanted to get a way of folding NPC inventories and box inventories together when saving
another question that, again probably sounds stupid but I need to know
Whenever as the gameinstance you do the "get all X of Y" command, if there's multiple levels in your game, say your character leaves city district A and goes to district B each of which are distinct maps, when you get all X of Y would that cross all levels in the game, all levels that were accessed during that game session, or just the level the player is currently in?
They did? 😋
Using ue5.3
Is there away to show with better quality video inside the game?
I show some video that was captured from a some programs like slack dc and more .. and it looks bad with the media player
@hoary junco I do this via a data asset that holds the hierarchy of anything that needs saved. Requires some data entry, but saves a lot of time iterating through stuff to save.
don't take my word for it
there's also a paid (~$10) plugin on the marketplace which adds support to 5.x
I should prly read the release notes
can't find anything regarding it in the release notes
I didn’t realize they wrote a whole novel for this version lol
anyways, with $10 it's a fair price, better than the mosquito net that just went to trash an hour after i bought it xD
Got a name/link for the plugin?
Awesome! :D
don't ask me why we get such weird marketplace links now...
I am ready for all the trojans coming my way
it's a good oppotunity to learn C++, too 😄
if only I had $10 to spare XD
subsystems are kinda easy
Jeez there’s so much new stuff in 5.4. I want to see what this Material Designer is all about
I personally wouldn't use the game instance for managing things in the level.
Regarding saving, I would have the component register with a manager. The manager would then store a ref to the components.
The alternative is using the get all actors of class set to actor and then use the get component by class on all of them. This isn't an ideal solution though as it could result in a lot of iterations.
You can make subsystems in 5.4? 😱
so would you just do an async save when someone moves between maps and run it on gamemode?
I'm just wondering how you keep hold of the save data if someone does something on map A, moves to map B, does more stuff, then hits the save button,
Hey folks
Is there anything wrong with nesting a Struct inside another Struct?
apart from it just getting complicated not really...
Each map would have its own save game object that's saved to disc.
Not really but nested BP structs can be bug prone.
But if I declare them in C++ and them use them in BP's as I want. You think it is still bug prone?
yeah I've seen that happen, with the fully built game do they then combine themselves into a single save file? Otherwise I can imagine whatever the designated save folder is getting incredibly messy incredibly quick if the game has a lot of maps...
Should be fine. Nested structs can be difficult to manage but if there in c++ should be fine.
No as in each map saves it's data to a different slot.
'WorldData_MapA'
'WorldData_MapB'
Etc .
oh, because when you said save game object I thought you meant the things that generate the .sav files
Pro tip, use \ in the slot name to denote a folder. 🙂
\Map_A\LevelData
This would create a folder called Map_A and put the .sav inside it called LevelData.
If map A has other stuff that needs to save, you could have them be placed in the same folder.
is that how all unreal games operate when it comes to save file structure? like they aren't contained within a single file? If that's the case how can you have multiple save files without it becoming an overblown mess of files?
hello, is there a way to always have the mouse cursor on, even with gamepad connected? setting show mouse to true doesn't work
Games can have as many files as it needs for saving it's data. It's what ever feels appropriate. Having everything in a single .sav isn't always ideal as it means data could be loaded that isn't actually needed at that moment.
Using folders can help structure your files so they're more organized.
Whilst Minecraft isn't made in UE, they have a separate save file for regions in the world. This can keep the overall size of the individual file manageable and not having to load the entire worlds data when a world is loaded.
You want to try and find a balance between the number of files created and the overall size of them.
Lots of small files can cause the overall size to become a little bloated due to the overhead for being a file. Files that are too big can take longer to load which could affect responsiveness in game.
try in player controller class
I'm pretty sure it does work. It might be that the cursor is off screen.
You can use the touch pad on a ps controller to move the cursor. Something I learnt a few months ago lol.
does anyone know if there exists a node that fires repeatedly when something happens? basically my health system is very crude, it changes a variable when player overlaps enemy box collision. but currently it will only change the variable once, so i lose 1 health each time enemy hits me, but i can stay touching the enemy and take 0 damge afterwards
Set Timer by event
You want to start a timer when they overlap that fires every x amount of time. When the overlap ends stop the timer.
no (apparently they didn't add it, idk where i got that from)
Me sad panda... O well lol.
ohhh okay, thanks
Hey everyone, in 5.3 using the enhanced input local player subsystem, how would i get the keybinding of a specific action? Im trying to make a widget that shows my players keybinding when they pick something up, and i found out how to do it using the old system, but cannot figure out how to get a specific keybinding with the new one
@iron furnace
Should just map the data in a single savegame to level names. Managing multiple savegame slots per user save is going to get very nasty.
bless you and your future endeavors
This checks the speed of the player and if he;s moving right? and not just if the player is holding down shift? because when I let go of WASD but keep on holding shift, footstep run keeps on playing
Not really. Unless the amount of data per level was small, I would have each level have its own save slot.
I use gameplay tags to denote the folder structure. After that I can prefix for the user specific save folder and if needed the save instance (like save 1, save 2 etc..) then I append the actual file name at the end.
I actually just finished dealing with this myself, its super ugly but it works
Yeah, but you have to be really careful relying on folder names. Some platforms don't allow very long slot names. I had to write a special converter for our slot names to be able to save easily on Playstation and then severely limit how big of a savename the user could input. So using the save slot folder hierarchy isn't a solid idea.
where did you stop it?
The timer for the footstep loop clears when player speed isnt within range, the two branches check for walking, then sprinting, and if the value isnt within either speed it resets the do once nodes
I've not worked on console so I can't comment but using gameplay tags they can easily be renamed to be shorter. \a\b\c\savefile.sav haha
Yeah. 😄 I don't remember the exact count but it was pretty annoying. Specially since it actually saves normally... The file actually exists But if you have two similar named save files, you can only load the latest one saved because loading either cuts off the name and it'll just load the first one it pulls.
Ooof, yeah I can see that beeing annoying.
I do like using gameplay tags though because they are easy to rename. My saving game was a miserable one before it haha. Having to manually search for each save game to slot and update the slot name. 😭
ill try that
cursor is on but as soon as i plug my controller it turns off
cursor is not offscreen im setting the position myself, so im not sure why is that happening
I got it working lol
F
That's one reason I don't do much more than the user's specified save name. If even that. Sometimes it's just Slot1, Slot2, Slot 3.
But this function helps a lot. I had to double check it was BP usable. This is how the normal save system grabs all saved slots.
why
🍝
ohh lol
Do you know if there's a way to just get the root folder names in the project save directory?
I'm just thinking of an issue I had a while ago trying to handle multiple player save games. My solution was a bit messy but that find files could lead to a better solution for it lol.
You don't want to cross pins, it makes the code very hard to read.
if you are working in team environment especially, they will slap you for doing that.
prolly 1 month in I'll try tidying up on my nodes
Get Saved Directory?
but you probably know, so what root folder do you mean.
@dark drum
So if I have folders in the save game folder called 'slot1', 'slot3' and 'slot8'. Is there a way to get these folder names? There could be other folders or sav files inside them.
The folders themselves could get created dynamically at runtime or even deleted.
Can they be used at runtime?
yes
Ah, yeah I forgot about the file utilities. 😄
That's probably what I needed. I'll check it out, thanks. 🙂
Other basic idea is just to find all files in that directory, then put their first substring directory into a set of strings. And then you have a list of unique directory names in that folder. Lot more code than the above though.
Is there a rename function in that library?
hello, i made a blueprint class actor and made this simple print why there is no output?
i get folders in my Saved/ folder
The actor doesn't have inputs enabled.
yes, or at least a way to do it, let me find how i did it
how to fix
other blueprint class?
'enable input' node. Provide the actor you want to handle inputs and the controller it should receive inputs from.
Don't forget to call 'disable input' when it shouldn't handle them.
I think i used Move File and kept the same path but different filename
yeah found it
Ahh ok, I was hoping for just a rename option for renaming a folder. This might not be a terrible work around though, just a case of looping through all files and changing the name where the folder that needs renaming is different.
How do you break from a for each loop?
If it is in a Function , you can just Return
If not , use a For Each Look With Break
There is a break node? I don't see it. It might be because I am doing this in a control rig blueprint.
Either that or it's under a new name
Hmm yeah I don't have it. Only have a regular for each
you could make your own
When you want to break, set a Bool to True and the remaining array element wont go beyond the branch
There is no 'for loop' with break macro, but really if you double click the 'for loop' and 'for each loop with break' nodes they're both blue print macros, you can quite easily duplicate the 'for loop' and create a 'for loop with break' macro.
What would be the best solution to handle this situation? I have a 2D game, where I want to move a projectile from left to right or vice versa. After it reaches the end of it's life, on event destroyed, I spawn the same projectile in it's initial Location. Also, I have a boolean moveRight, and depending on it I change the rotation of the projectile to 180. It works well and all but because I have the default rotation set to right the first object always moves to the right, after it gets destroyed, the subsequent objects follow the instruction. My question is how best to handle this situation?
I apologize if it's not the place to ask this type of question
sorry to bother you
this widget surprising me again
i'm drawing a line from the click point to the mouse cursor now, using OnPaint function
but both start and ending points is offset at X and Y, more and more, depending how far start click from top-left corner
i try different anchors and getting mouse position scaled by DPI, but nothing changed
run out of ideas how to fix it
That still iterates throughout the entire array thought right? It just does nothing past the break index.
correct
my example would only do first index
but only set it to true when you find what you want to trigger a break
I see, in my case that would be ok because I'm just running it once in a constructor script
I was thinking it may be possible to use a for loop and then set the index to end earlier
i believe its something to do with viewport scale
nope, nothing changed, same result as before
How can I get the average of a float array?
I think these are the nodes you need
Add them all together, divide by amount of entries.
yeah okay
Pretty funny that 'average of int array' is a standard BP engine function but that 'average of float array' isn't, you'd think averaging real numbers is actually more common than averaging ints, and the output of the 'average of int array' node is a float anyway. funny, maybe.
its working better this way, offset is less then before, in a top-left corner coordinates are correct
but far from corner its still offset
looks like something else is missing
Hey guys, I want to do a Notes system, like Resident Evil, where they do not occupy the main inventory system, which I already got set up.
My question is, besides doing another inventory system with a Struct just for the notes, is there a more efficient way, like a set of Text or someother shenanigan?
That would depend how your inventory is currently setup.
I´m thinking a button withtin the inventory with "Notes" that takes me to a widget with the various notes and their respective text.
Nothing fancy.
The current inventory is simple, 6 slots, you can collect and inspect items, but I don´t want the notes to share the same inventory space
I could replicate a similar system just for the notes, but I would like to avoid working with Structs in the engine for now, as everytime you change a value, you have to compile everything in a specific order, else it crashes alot, in the future I´ll move the struts to C++
That doesn't really give much indication of how its setup. Do you have an inventory component or is it just setup on the player character? How are you're items stored? Is this just an array of structs etc...
Sorry, got distracted, my bad.
It is an Actor Component, added to the Player Character BP. There are 2 Structs, one with all the Item Data, and the other with the specific Item reference, which the array makes up the Inventory slots
I would just create a new variable inside the inventory, when the player picks up an item, check if it's a note. If it is, place in the secondary inventory var.
Not actually a bad ideia, I would still have to store it in a different inventory layout and create some stuff to access it, but it might be enough.
Thanks for the reply, cheers!
is there any way for a timeline to run while game is paused?
You could try checking this in the BP where the timeline is see if it works
Does this give -1 or 1 value when scrolling up or down?
no dice unfortunately, ty though
Yes, but you should probally use enhanced inputs. The old system is depreciated.
it seems a lot of tick-related stuff works. I think I read that timelines work on a different timer and thus dont work on paused. I've created a variable thats adds Tick Delta every tick (i.e a timer), and branches based on when the timer enters specific ranges, but the blueprint layout starts getting pretty bloated if theres a lot of activity
would be great to have something akin to a timeline to make it cleaner
Hello. Is there some way I can force a teleport? The teleport node occasionally fails (when the destination is slightly inside of something). However, I want a teleport to always go through even if it means glitching through a wall or whatever. Is there a way to do this?
Do you know what is this? How can I create this?
That looks like the curve editor for a timeline.
So I created Input Action but where do I set that this is mouse scroll?
You should probably give this a good read first.
https://dev.epicgames.com/documentation/en-us/unreal-engine/enhanced-input-in-unreal-engine
in the input mapping context
Do i need something else here?
and then I call Input Action, not Input Mapping Action yes? but I have to activate somewhere in the blueprint IMC ?
not sure how to call it?
To use Motion Matching feature in UE 5.4 it requires to have a many animations. Is there any info on when Epic will release animations pack for Motion Matching if they ever will?
so now this will be counted as 2 different Input Actions? For example IA_MoveForward and IA_MoveRight? or I can put it in one as IA_Move
Hey guys, having some issues with my box collision, when the player throws it, and its the target, it works, but if its thrown again at the target, it doesnt trigger and actually pushes the enemy player
they already have it inside their character
search "get enhan" when dragging the output from the player controller and you should see the option
and you can only do that in unreal
found it.. fk me
If I use Get Player Controller I don't have to cast to PlayerController, right?
nop
is there an easy way to know when a variable is being set?
like I have a simple increment node on one integer that fires only once every few seconds
then suddenly the same variable has its value incremented twice then it increments normally further on
Hi! I'm using an old version of UE4 (4.22.3).I use 'Set Anim Instance Class' to switch the BP animation of my AI, but it causes a desktop crash. Is there another solution for set a new Anim Class or reset the Anim Class? Thanks!
I'll just figure it out by spamming the print strings everywhere
If I have a variable which is soft object reference with no type information, is there any way to convert it to a soft object reference of a given type, without loading the asset? For example, I have a primary data asset type, and I can get a list of all the ids and convert them to soft object references. But then if I have a function that takes an input of type Soft Object Reference to my specific primary data asset, I can't send the soft object reference into that because it's not of the right type, even though it has to be by necessity of the pictured nodes. Any equivalent to "Cast"?
I now know whats happening.....
execution order mistake
I don't believe there is, when a soft ref gets loaded it just becomes a generic object/class anyway. What are the functions doing with the soft ref?
what am I missing? I check for IsValid but it's still invalid?
soft refs are typed, too
e.g. in C++ you have TSoftObjectPtr<AActor> for an actor soft ref
he probably gets TSoftObjectPtr<UObject> tho, not sure if there's a BP way to cast them
maybe you can get the object path from the soft ref, and then create the softref of the other type from the path
huh
that's not related to your issue
never had to cast a soft pointer, but it seems strange that you couldn't
Any easy way I can clamp so I can set maxzoom and min zoom?
i think the BP isValid check can be funky by times
there's a method to check for pending kill iirc
have you tried to search for Clamp...?
buf if I use clamp after multiply, it's not clamping 100 to 500, but the amount that is multiplied?
so it's 100 or -100 always
so clamp before?
before multiply? so it's -1 or 1?
can you Set World Offset, and (Get Current Offset +(Action Value*NewSpeed))>Clamp
nvm Ill do it other way
easiest would be to have a relative offset tho
idk if the world offset is even tracked?
well that's not apparently the uobject that's null, which is also quite confusing
if you destroy the actor in the same tick, it may be pending kill and still be valid
at least i had this with components
it is being destroyed, but I don't know what's referencing it
the isvalid check passes?
this is still bad
spawn the effect before you destroy it, or cache the location
do you now get the transform from a "dead" actor?
oh, transform
cache the transform, destroy actor, spawn hit effect
or just spawn the effect before you destroy the actor
transform was it
thank you
I'm good now
just had no idea what exactly it was referencing that was pending kill
Do any of you know if it is possible to block a Widget from being created if another one of the same class is called?
I have fixed the problem of creating infinite copies of the widget everytime it is called.
My problem lies when 2 different actors call the widget, then they overlap.
Like so
The subtitles are being called everytime you interact via an Interface widget that then creates a widget interface that displays the text.
infinite copies?
GetWidgetOfClass()
oh, that's fixed
or make a HUD with a slot for that text, which is exclusive
two things want to display text
what do you want to have happen?
probably only the later one to appear
or use common ui widget stacks. It'll reuse widgets where it can.
I have used it, the problem is that it checks in the specific BP, and since another actor is calling it, it assumes there is no widget yet
Exactly
or solve the issue of trying to do two incompatible things at the same time, rather than just fixing the UI problem
is that a widget component or what?
it checks for all widgets of that type on the viewport
no matter which actor created them
unless this is a widget component, then it may behave different (and may not list them at all)
I wouldn't solve this by preventing widgets from overlapping.
I would solve this by preventing two things from trying to display at the same time.
something should manage that
It´s a Widget Blueprint (User interface)
Anyone knows whats going on?
That could also be a solution, as long as it solves the problem tbh
Things I would do:
- create an interact widget that always exists
- interacting with something tells that widget what to display
creating and destroying a widget every time you interact is not ideal
Doing anything I want with it...the feature one gets is that picking a default or literal value for a typed soft object reference provides you with a list of just objects of that type, as opposed to the list of all objects one might get if you just made the input a generic soft object reference
I thought this but couldn't find such a create option in BP
search for make (when dragging from the soft object input of your method)
i think there was a make method which uses a path as input
Hmm interesting, I did that with the HUD, i figured having it always existing would be worse than calling and destroying it.
I´ll give it a go
oh, no
not at all
creating and destroying is waaaay worse than leaving it up
leaving it up costs nothing but ram
The more you know 🙂
no reason to not reserve that memory all the time since you might need it
the MOST expensive stuff you can do in programming (generally) is to create and destroy things
hey i have a problem
everytime when i reopen my project
CHASE dont work for spwan wave
and only for bp_enemy
There wasn't when I tried... Hmmm
Any good ideas how to make camera move more smoothly? I tried Flerp but I think I would have to put it on event tick or something like that?
If I have a game that can potentially have 100 enemies, I prefer to create an array of 100 units and then activate/deactivate them, rather than create/destroy them. If I can have 100, then I might as well reserve the memory. And creating/destroying is sloooow.
you see the enemy that i create is chasing me but spwan wave isnt
doesn't the swingarm component do some of this for you?
Not sure? I want it to be more smoothy like it was swimming and I want to be able to set how much smooth it could be.
yea just checked, i don't see any way either
the one i meant only works for object soft refs, which is what you don't want to begin with
if you load the object anyways, i would probably go for a wrapper, which takes an object soft ref, loads the object and casts it to your type, then call the other method with the softref from that
the object should still be in memory, so you wont load it twice
after all it kinda makes sense to not allow upcasts, since it's just a object path information
even in cpp you only really want to cast that if you are sure that it's the right type, as it's never a safe cast
How can I make my StaticMeshComponent no longer the main root of my BP and replace it with a SceneRoot?
@dusky cobalt ?
It looks like this is a child bp which means you can't. You would have to do it in the parent bp.
Yo i was wondering for my anim blueprint how can i implement a branch node or boolean logic so that lets say only play animation if is first person is true
is valid
no
blend by bool
or use a statemachine and check in the enter condition
Yeah but in this instance I'm not wanting to necessarily load the object. For example let's say my quest objects are PDAs. I might want to write an editor utility widget to let me toggle quest info. So I might want to like, get all primary data assets of type Quest, then create a widget for each one with it's filename and a button to Start Quest, and then when you click that button it calls Start Quest which takes in a soft object ptr to quest. So I need to go from the soft object ptr I get from the primary asset id, which is necessarily of type Quest but is in fact a soft object ptr to object, to a soft object ptr of type quest
use is valid with ? not function
i tried that but it bugged all the rest of my anims
i tried
show code, we are not magicians
it wanted an obj class
ok
idk what to show you i havent added anything
that your suggested
it didnt work
finterp to target on tick
??????
ty all got it working i had to get a cache and use that with a blend bool and the put the cache onto the end of the false so that false and true would have both anims
If you want an actor to move by itself. you put everythine into the Event Tick? or there is another way?
or just make timer on event if you want it to search for other location every x seconds for example
but generally event tick is not place for this
so my game the character move automatically on the Horizontal axis, so what i did is a
so now i will rework on that "working" part and check if there is a better solution or a proper solution
so when the game start: my character move by itself on the X axis with a amount of Speed
and the speed change during the travel
So i did everything into that Even Tick. is it the good solution or is there a better one
Endless runner?
like an endless runner i guess
automatic movement and you can controll up and down movement
Should maybe be fine but I would possibly ditch the forward part and just put a world direction for your level. Just incase you ever accidentally set the rotation or anything for any reason.
is there a way for a thing to execute just once when on "event tick"? or do i need to learn custom events
there is a Do Once node
thank you, does it need to be plugged into something from the back? (left side)
oh wait
nvm
For what reason would you want to only do it once?
when score variable reaches 20, it spawns an actor (fire rate up powerup)
What controls score?
when projectile hits enemy it increments it
Because that sounds more like your score should have a setter with an event dispatcher in it. And whatever needs to spawn that should be bound to that dispatcher. When score >= 20, unbind the event and spawn the actor.
no idea how that works. im very new to this and this game will be full of janky systems.
guys my struct is showing this error what can i do?, easiest fix would be delete and duplicate but is there a simpler solution?
i can open it in visual studio but i have no idea about it
The TLDR of an event dispatcher is that it's a subscriber list. Things can ask it to notify them when it's called and it'll run all events bound to it. Worth learning
Looks like the struct asset named Weapons needs compiled.
Is it a Blueprint Struct?
yes wait im restarting then i send picture
thank you, i need to write that down. but its gonna be for some other day cause there is a million things i need to learn. i got this system to work for now. im tryna finish this "test" game as fast as possible.
Supposedly adding a new property and then saving it fixes it. Could add a new one, Save, Delete it, Save.
there is the weapons one and its normal
Into weapons or the errored one?
Weapons I think.
I have another quick question, my array list got completly deleted and it had allot of stuff inside. now it would take me a sht ton of time remaking all of this but i still have a save file with the variables. Is there a way to get the variables from the safe file into my base variable?
Sounds weird but could it work?
yes it's possible, make some 'call in editor' function that loads the data from the save game file into the relevant object, this should update your 'editor world' instance with the data.
like, think about how you'd initialize the data from the save game regularly, just put that sequence of actions inside a 'call in editor' function. BTW if it's not possible to make a call-in-editor function on the actor/object itself (say it was a gamemode object, or something like that) you can load the data into any actor in the level really, and then just right click copy the array and paste it somewhere else, data in blueprints is always textual and can be copy pasted into other matching arrays and objects.
I've got a missile that's supposed to explode when it hits something, provided it hits hard enough. Problem, despite ramming hard into a wall, the returned impulse is always 0
Hey folks
Is there not supposed to be a node to clear (remove) a Niagara system at will instead of letting it play out?
Am I searching for the wrong thing?
You can use "Deactivate" node
Thank you very much. Do you know if this actually gets rid of the system?
So I don't end up with a bunch of invisible systems running in the end?
If you're using Spawn Attached, it's created as a component that can be destroyed.
I am. But it is giving me an error when trying to compile:
That's because it's not on the same execution thread, so that blue line is basically fake.
Promote the output to a new pointer variable and call Destroy on that
where would everyone say I would be best creating my Question widget and saving it's reference ?
would Game Mode be a good place ?
trying to think of a place that mostly everywhere can get eaisly without going through multiple actors and objects to get to it
By pointer variable you more or less just mean variable?
What is a Question Widget?
That
GameMode should have absolutely nothing to do with widgets, ever, for any reason.
Does anyone has some camera rotation examples in their own code? I want to rotate my camera around with 45 or 90 angle per click.
where would be best to store it's reference in that case?
Depends. What is this widget for. Why is it being put on screen?
so the AI may ask the player a question and this will then show on screen for the player to answer it
technicaly you put the widget on the GameMode
but there is a dedicated place for that
so I'm trying to get the helth from boss to my UI, only problem is that I don't know what to put for the kind of object to look for, my boss is a character, any suggestions?
the HUD
is it the HUD class
AHUD is usually a decent manager for widgets. Realistically it would be better maintained by some sort of ability where the aI interacts with the player.
it's an extention of the gameMode that manage all widget
arr right okay sweet
and normally it's
You "can" put widgets in the GameMode. But you should never, ever, for any reason. It's bad practice, misleading, and just not a good idea for any use case outside of "I don't care I'm making a singleplayer game that I'll probably want to be multiplayer later and hate myself for putting a widget in a server only class."
Game Instance > Game Mode > HUD
apparently this doesnt work
HUD is not an extension of GameMode. It's maintained by the player's PlayerController.
into the Game Mode if i remember you have to specify which HUD to use
so you know that the HUD will be always call
try to play with some print screen into the HUD
and see how it s connected with the GM
this will defo be a single player can assure of that haha
so I want to create the widget on the HUD BP and save it's ref there
and if I then need to grab it for any reason down the line I can get the game mode and it's HUD and simply cast it i'm guessing ?
Yeah. But it's an ideology thing. You don't drink water from a plate. You can. But it really just complicates things and there's just much better options.
what would be a better option ?
sorry if you've said already
Realistically this widget shouldn't have a ref saved. If you were using CommonGame/CommonUI you'd just have the interaction push a widget to screen, and that widget could gather whatever it needs from global gameplay API. User, or gameplay state updates dismiss it when done.
But this is a whole different set of ideologies for UI engineering. Unless you're willing to put in the time to get used to it, just go with the ref in the HUD. 😄
fairs
Does your "missile" have physics simulation enabled ?
NormalImpulse will be filled in for physics-simulating bodies, but will be zero for swept-component blocking collisions.
i have proble, can someone help me?
That's the problem. Shit. I guess I can fake it by computing the relative velocities of it and the object it hits
what would be better I have a function on HUD to create the Question widget when needed and the actors calling it go through GameMode -> HudClass -> Cast -> Call the function.
Or
The Game Mode has a function which calls to the Hud Class which has a function which calls the function to create the widgert
I feel both are valid but on create a dependency through stuff that could cause stuff to break.
Whilst the other method isolates each bit you could say
i have proble, can someone help me??
If your "missile" does not have physics enabled then it's normal that your Normal Impulse is 0
Maybe you can multiply the velocity by the mass to get the "impact force" ?
Just ask
Boys, im desperate, i dun get it, it makes sense, but dun work, im going to bed, if anyone who is good at this has any idea, plz give ideas XD Brains cooked.
top code first then second

Does anyone know how I could derive a unique number from a world location?
I want to bind a seed number to the world location of a grid section but can't figure out how
Cuz when using x and y, you can get the same numbers twice
I did it by just adding the coords together and randomizing.
Hmm but I want the result to always be the same
You can make a random stream from that.
Try "Get Owner" ?
Might be the "Owning Player" in the second BP on the Create Widget Node
Very basic question - how should I implement a situation where the actor is only destroyed if the two objects are overlapping for more than 1 second (basically making the user confirm their choice by holding the beam over the star for 1 second)?
oh I figured it out
@untold fossil
Start a timer then cancel it if the overlap ends
yeah i tried that, just didnt hook it up, just wanted to show the goal of the blueprint. Like yeah, im stumped.
With the default TopDown setup we can 'press left mouse' to move directly at the target or 'hold left mouse' to move the character where we direct our cursor. I would like only the 'hold left mouse' and delete the 'press left mouse'. How to do this?
But doesnt x and y combined give the same result for -1, 1 and 1, -1 ?
Thats the problem im facing
Which timer function would I use? Set Timer by Event?
"Add Timeline"
Timer by event would work fine too
You could do some other stuff based on the negative sides. What range and type of value do you need?
My grid system is placed on coordinates like 10000, -10000
I basically want a player to be able to sapwn anywhere in the world, after which a grid section of size 10000 is created snapped to the world grid and then I want thay to give me unique number that I can use as seed for stuff spawned within this grid section.
Srry for typos on phone xD
Wait yeah thats it!
All good. 😄 I mean.. If you can give a guess as to max sizes. You could always do an add to offset the randomizer by checking which corner of the grid it's in. If it's plus X and Y, then add nothing. If it's Plux X negative Y, Add SomeAmount. If NegativeX, negativeY, add SomeAmount twice, if both negative, add SomeAmount three times. That would get you a good seed randomized offset by grid.
Is there a simple way to have an actor NOT call its construction script when spawned?
Thank you! This seems to work okay, any refinements?
It seems good
It seems to take way longer than that 0.5 for it to destroy and changing that number doesn't seem to affect the amount of time before it is destroyed though which makes me think it isn't working the way I think it is
Create a simple boolean
Please could anyone assist me.
I want to rotate camera with QE, per 1 click I want to rotate 60 angle.
This works perfectly, but the transition is very fast (almost instant).
How can I make it slower? I tried to use Timeline and Lerp, but when I connect it, it goes around like crazy 😄
Show the code with timeline and lerp
You mostly just need a tick function. Inputs set a desired yaw . Tick interpolates the camera's yaw there.
You have to set a variable to "save" the "start" value of your float
I want to avoid tick
Lol, okay. No timelines either then.
You need something to happen every frame, smoothly moving something from one place to another. That's what tick is. Don't avoid it, just don't abuse it.
Before the "timeline" set a float variable which contains your "delta rotation Z" value
Call it "Current Delta Rotation Z" for example. Then use it in your "Lerp"
Actually it's going crazy because your "Delta Rotation Z" is updating every time..
This still doesn't work, but not sure if it's how I should do it?
Timeline is too rigid for this. You're going to have a weirdly acing system with inconsistent movement speeds due to lerping instead of FInterpToConstnating. If you want a consistent rotation speed, it needs to just be done in a tick function.
Maybe he wants timeline to adjust the "Curve" as he wants ^^
Press the button twice before the first one finishes.
You presumably have a movement system that has a concept of velocity
with that, the missile mass (a thing you'd set), and the impact normal, you can compute the hit impulse
If you just want the impact speed just do a dot product between your velocity and impact normal
There's also nothing stopping you from a curve on tick either, you can sample a curve asset, or if you just want simple easing, theres the interpto nodes
don't use add here, set the rotation
So there is no way to make rotation without using any kind of tick? but i think timeline is better because it will only start ticking when i actually click button, and not 24/7?
Something smootly rotating implies that it updats EVERY FRAME, which implies something, somewhere, is ticking
Sure you can rotate without tick, just snap to the new rotation. Not very smooth but at least you're not using tick
A timeline is ticking 24/7.
Behind the scenes it adds a component, and uses it's tick event
I would use tick -> interpolate to -> set rotation
He could stop the current timer or wait when the timer finished to set it again. But I guess with tick it's better
when you press the button, you just change the interpolation target
Hell, if you really like you can disable the tick, and enable it on button press
overkill tho
The real question is, why are you so bent on avoiding tick?
because it's bad, someone said so
Or you can set a boolean to call or not your event on tick
I always love pointing out that the engine is constantly checking if you have multiple local players to decide if it should splitscreen your viewport. Even in a singleplayer game. Every frame. 😂
hell its probably faster to just go:
Tick -> interpolate
instead of
Tick -> branch -> interpolate
Like Authaer said do not avoid tick but do not abuse
Don't forget the minor speedups you can get from turning the tick event into a function :D
I don't know, i'm just trying to learn how to avoid these situations and if it's even possible, so it's more like I give myself challenge how to do it without tick. It's just camera change so it's similiar to pressing W to move forward (which doesn't check every 1sec if im pressing W, it reacts only when I press, right?)
If the code should change something smoothly over time (every frame), its driven by tick somewhere
In fact, I think it was you that posted that one wasn't it Adriel?
InputAxis events run every frame
BP probably changes things but in C++ it would certainly be faster to just interpolate every frame, even when not needed, than to check if you should and then interpolate only when rotating
They just report a scale of 0 if the button isn't held, so you don't move
I want click Q and interpolate by angle of 60 right or left. Do I need ticking?
Do you want it to interpolate smoothly over time?
if it happens over time, no matter your solution, it will be a tick behind the scenes in some form
yes I want to go from 0 to 60 angle smoothly
ok then something somewhere it ticking to drive that
You cannot do things over time if something isn't checking each frame if the certain time has passed
if i press again i go from 60 to 120 and then 180 etc
ok so do this, it's literally this simple
Button -> update TargetYaw (add/remove 60)
Tick -> interpolate ActualYaw towards TargetYaw -> set camera rotation
Gets more fun if you don't want to avoid the camera going the opposite direction if you press quick enough to pass 180. 😄 Have to keep a winding axis.
Nevermind I will leave it as this
I'm having optimization issues with a blueprint based endless runner project. Been following a couple tutorials to base the project off of, and they all work by spawning a specific number of platform actors, deleting each platform as the player pawn runs past it, and adding a new one at the end of the chain. This all runs around 70fps at the beginning of the game, but as the player pawn runs the fps steadily drops till its unbearable. I'm not sure where to even start looking to fix this problem, as the game is constantly deleting actors and should thereby be recovering recourses. Any thoughts?
#profiling I guess? Unreal Insights should give some.. insights.
Haha, thanks I'll check there
Also in this case I'd suggest double checking that everything that should be deleted does indeed get deleted, and that you only spawn what you need to spawn
I tried one more time. What is this setup missing to make it ''smooth'' ?
Action Value * Rotation Speed * World Delta Seconds should probably be sufficient. No need for the RinterpTo
current should be the actor local rotation ?
and it should be on tick
not on the EI action
set a variable like CurrentRotation when you rotate, and on tick interp from current rotation to CurrentRotation variable
Sorry all, what am I missing here? I would like the timeline to advance when this actor is overlapping the Beam actor and to reset to 0 when it stops overlapping; if the timeline gets to 0.5 seconds of overlap I would like to destroy the actor. I feel like I am not quite getting how to use the timeline properly, or rather, how to output a value from it as I am trying to do.
Doesn't help
This moves it by 1 angle per click
Do you want the beam to continually fire once the overlap has begun?
Increase your rotation speed
Its set as 30
The beam is already firing on mouse click so that's fine. I basically want to set a timer or count up as soon as the beam overlaps with this object, and it it overlaps for more than 0,5 seconds consecutively destroy this object. That's all! Basically make the person hold the beam on the object for 0,5 seconds to get it to actually break otherwise the timer resets if you move the beam off.
you want to interp on tick and just set the variable on rotate, which is probably current + the z
if you do this, whenever you set the target variable, it will blend to the destination
Start a timer by event, store the timer and if overlap ends clear and invalidate the timer.
So if you're fully rotating your mouse, you'd get an action value of 1. Delta Seconds is going to be something like 0.016. The output would then be 1 * 30 * 0.016 = 0.48
If you want more rotation, increase the rotation.
Yeah, but it's working exactly the same as without the delta time, just 'teleports' instantly to the rotation
The trigger fires every single frame.
You don't want to move 30 rotation in a single frame.
You get around that by multiplying by delta time.
If you want to rotate less, then decrease your rotation speed.
Yeah I get it, but I don't want to hold the click and move per second.
I want to click Q, and rotate by 30 in a smooth time.
and if I click E i rotate by 30 in the other direction
Ok so then you'd do what engage is saying
Set a value on the click. In tick, you'd do your interp.
Ok
From Current > Target
I need help, for some reason I cant hit my boss character even though I have collision on for both, any ideas why?
How/what are you setting into "Target" in your PlayerBullet?
I'd suggest maybe plugging in "Other Actor" into the "Boss_Enemy" cast and removing the branch before it. That way you don't need to worry about telling the bullet what to damage.
Any upgrades? It kind of works, but it's way faster than InterpSpeed that I set to 5.
ohh, i have to put lower than 1 to make it slower
I'd avoid using != with floats/rotators. Seeing as you may want both negative and positive values, using a nearly equal to is typically better
the branch is to make sure that it only happenms when it hits the boss and nothing else
The cast would equally do that.
like this? also still nothing, I have a pritn dtring in my enemu that will show that it got hit by bullet so I know if it gets hit or not
How about checking if your bullet actually hits something? Put a print string immediately on the OnComponent hit and check what its hitting
it was the main node
this will destroy the star after 1 second if there is ever any overlap, which is close, but I cannot figure out how to incorporate the endoverlap into resetting the timer.
"Clear timer"
Clear and Invalidate Timer by Handle got it thank you!!
Ok I made it the way i wanted.
turns out I dont like it, its limiting, but I might include it as a settings xD
can anyone help me debug why my health progress bar always starts at 0 at the beggeining? I have it here to show what my HP currently is for my boss at all times but for some reason it goes straight to 0 percent, works fine for my player but not my boss. I used string to check my current HP so I know what it currently is at all times
Why do you need to have the health value stored in the health component on the boss as well as within the boss itself? The health component should likely be the only place you need it.
Can you show the bind you have for your boss health bar as well?
oh the health component is meant to be used on multiple entities, from an old project
oh I typed up the boss character for variable type and picked object
Ok, so that's setting what type the variable can hold, but how do you tell it which instance of "Boss" goes into it?
its the one thats already in the stage I think
No, it contains nothing if you haven't set anything into it.
Effectively, after spawning the boss, you need some way to communicate to your widget to use that particular boss.
An example (but not the best) would be something like.
Boss Begin Play > Get Widget of Class (Whatever contains your Boss HP Bar) > Set Boss to Self
this is in my boss
is this a good way to set it for which one?
Well that at least gets you the right "set" that you need, but the cast isn't helping here.
Use a "Get Widget of Class" node
You should be able to select Player_UI in there.
The return value you should then be able to hook up to the "Target" pin of the set.
Ah sorry guess it only gives you an array - drag off from the array, do a "get" then connect the output from that to the "Target" pin
The best way to do it with health is to:
- Add widget to your Boss
- Set Widget on begin play.
- Have interface Get Health
- Bind your progress bar with health to the % of your Get Health / Max Healt.
well my boss bar and player bar share the same widget....was that a bad idea?
It's not necessarily a bad idea, but depending on the complexity of things it can start to get difficult to manage.
No, it's ok, just put that widget both on player and on boss. You have to add it into components and also put create widget node inside both blue prints.
How can I check in what places i'm calling that event if I'm calling it from other blue print?
the problem is that you are probably casting from the widget to the player already ? it's better if you created interface
is it possible to manage priority of overlapping?
If you overlapp 2 component at the same time. one that give you a buff and one giving you a debuff.
if you are into the buff you dont want that the debuff activate.
is there i kind of overlapping priority ?
Hey was wondering i have animations for aiming and im not sure how i should implement them should i use a montage or do smth in my anim graph
I wouldn't think so. I think this is more logic with your buff system, namely if you have the buff, don't apply the debuff.
probably would just need to place boolean somewhere
yeah montage is good solution usually
but if i stop overlaping the buff, i would not received the debuff because
actually I created the widget via game mode
what I can recommend for oyu is watch some ideas about health components, damage systems, and not creating dependencies (concept) to create health system, check Ali on youtube he has some good tutorials
hmm, maybe then adding some array that works as queue and executes things one by one?
and you can add unique items ''effects''
well I actually do know about damage aplication as i've had it work for my player, its my boss is the problem
what is the most unversal component to add as root that will hold other things ?
well it would be starting loaction box component
I mean yeah because i set it, but i want something that is more kind of empty?
like placeholder
right now it's box collision, will it work as place holder if i dont put anything there?
SceneComponent
thanks ❤️
Hi there! I'm currently using the Collab Viewer template to do a test on some VR and Desktop working together. Everything is working as it should but when I press the VR button it takes me to the player start but like way above where it is on the level (high in the air). I've tried teleporting the player pawn back down to the start location but cannot get it to work. Any solution you may have?
Hello, is using a weight table the best way to have weighted randomness?
I have an integer in range between 0 and 5 and a value is chosen at random but I need different percentages for each number.
Quick question, I am attempting to cast to an object in my game that spawns in some time after the game has launched. Does the cast to need to occur after the actor has spawned in the game?
Does anyone have any thoughts on how I could modify my blueprint here to specify a minimum distance in X,Y space between the spawn locations? Would I access the StarsandLocations array for each loop of the While statement and enforce that each component of my Make Vector is greater than some amount different from them? My goal is just to avoid stars spawning on top of eachother / near eachother.
Yes, casting is checking if a reference is of a type.
if you don't have a reference, you can't cast it
Any particular reason you're doing this in polar coordinates?
Hey! When the AI chases my character they sometimes block each other, I would like to add a force that pushes them back if they cross each other to avoid this. How to do? Do u have an example?
You can enforce a min distance but that can get very expensive depending on your star density
You can also break the area into some grid and put a star in a random position in random grid elements
Currently for simplicity they are spawning in a circle around a central point. In the future they will be spawning in 3 dimensions, with height as well. I was thinking about moving toward a grid based implementation to make this easier when I have a bunch of stars but I'm not sure how to get started with doing that.
I'd do it like this.
Say it was in 2d and you wanted 1000 stars in a 100 x 100 area
Do it all in integer coordinates
Make an array of the 10,000 coordinate pairs, 0,0 through 99,99
Shuffle that array
For the first 1000 entries, put a star somewhere randomly in that square
That should get you a nice random distribution
I would do a grid where they're x distance apart and then apply a smaller random offset. You could even generate more locations than you need, shuffle the array and just get the first x amount.
you can do some math on the "put a star somewhere randomly in that square" to enforce the minimum distance
Yeah might not be a bad idea to distribute them evenly them move them all randomly within x distance
Thank you both! I just started with Unreal last week so still pretty new to this. When you are talking about coordinate pairs, I would use the actual position coordinates that correspond to where in my game world those squares would exist, right?
I'd do it in integers and then convert to world coords by some GridSize value
like, 2,2 might mean 200.0, 200.0 or 60.0, 60.0
When working with grids its often a good idea to have the underlying grid representation in integer coordinates and convert to vectors or floats when going to/from the world
Okay, I will take a stab at it. Thank you!
Even distribution + random offsets will be the most performant. How many stars we talking here?
It won't be too many, I wouldn't imagine we would go much over 100 on the high end. The stars are an interactable entity that's part of the study design so it's not like I'm decorating all of space with this method.
yeah try them both, the grid coords -> shuffle -> random position within grid will distribute them more clumpily
Hi! So I've made a bow and it's system and all, and it went well, until the last phase. Somewhy the apply damage node isn't working. It always returns 0, and the target actor isn't getting "Any Damage" event.
The first image is in the bow. The linetrace gets the enemy actor, and it sets the actor as the damaged actor. And then in the second image, is the apply damage. The actor is 100% the same, cause I tested it with a destroy actor node, and it worked. The damage is not zero, but even if it was, it should fire the "Any Damage" event. I've searched for solutions, but I didn't find any, which has worked. Please, help me!
Put some breakpoints or print strings and see where its failing.
It is fully working until it's getting to the apply damage node. And that thing doesn't do anything.
Guys, any idea why When I use "OpenSource" Node from a Media Player (for a video), it sometimes takes a lot of time to load? is there any way to pre-load the video, then when it's ready I got notifies (by binding to an event) and I can finally play it?
😞
Ensure damage isn't 0. This interface does check that if the value is 0 it won't trigger.
Ensure you've implemented the Any Damage interface in the actor being hit.
Have you implemented received damage on the target? How do you know it's not working?
Okay in the process somehow the float got to be 0. Thanks for reminding me to recheck it!
where and how would I start seaching for this array that is broke?
The livestream today said they're releasing it in June.
I have 2 game modes and both are identical, and one is using CameraPawn, and the other one is not possesing one it's in like spectate mode that I can go freely, both levels have overriden settings
oh it was because of event Handle New Starting Player, nvm
Find somewhere where you know you'd have an array that might have 184 members
thats just it the largest array I know of is 100. And then it says something about control rig. And my control rig as far as I remember dose not have any thing to do with arrays.
Or should I just ignore the control rig stuff?
i have a transform and i want to modify it by a specific rotation (say 90 degrees yaw), but i want this rotation to be applied in the local coordinate system of this transform, not world (so 90deg in whatever is the local z of the transform, not around world z). how to achieve this in blueprints? i have tried the compose transforms node, which absolutely does not do that, i have tried transform rotator and then compose rotators, which also does not work. what am i missing here?
Can someone help with getting my menu to open (again)
What I want:
------ (Interact zone) On Interact (E) ---> create widget ONCE(menu blueprint)
------ when widget is deleted (menu blueprint) - You can repeat in the interact zone
I've got the "Do once" which works to stop widget duplication; but cant find the best way of allowing it to be made again,
EDIT: im trying to reference the menu for the 'reset' but cant seem to get it to work
Thanks in advance
for any UI element you use more then once you should create it at start then collapse it
then you just have a ref to it and have a toggle menu. Some thing like this
I think I see what you mean!
So in my game; im in a "Base" where i run around and theres a lot of menu's --- your saying to make all the menus on the viewport and then just simply show/hide visibility on them >??
yea
another example a bit more thought out then the others
here you see I make my main Hud and make a ref to it so I can adjust it later
This helps a lot; thanks a bundle! (:
Do you reckon it would be better to create the menu 'on start' on the object im creating or the "Base" map event graph ?
here I create my main widget and get a ref to it. (this should probly be made in my player controller but I was just learning at the time and have not got to moving things around)
a more readable pick
That can depend on what you are doing. If the UI is like a map you could make it in your level BP. But if you are wanting to keep it more persistent then the player controller is what some do. The thing is is that there is no right and wrong with a lot of this stuff you can make anything almost any where and as long as you know where its at and it works its good. The problem comes when you have some one ells join you and they can't find anything lol.
Haha I think I get it now, it's a menu that's tied to the "base" area so I'll create them all there, thanks for the help (:
Is it possible, to check for overlapping actors, without them having Generate Overlap Events enabled?
With a collision component you mean ?
Yes, but it doesn't really matter, the issue is, that I'm resizing the character, and it might get stuck in a wall/ceiling/... and I want to prevent this.
But to check that with a collision component, I would have to manually activate Genater Overlap events for each object in the level.
Do you think I should go down that route, and will this have performance issues?
Feel like im doing something silly
Accessed None always means that the variable you're using doesn't have a value set in it when you tried to use it.
yea you must not be calling the add to viewport function
What will be stuck in the wall/ceiling ? The collision component ?
you have to call Creat all menus and hide first
I guess if you want overlap events you don't really have the choice. Either you use collision component or a "Trace". But it depends on what you are trying to achieve
The character/player itself. So I'm scaling it up to 2x but I have no way to check if it would collide with something, except for having a capsule component that i scale up beforehand, but then everythin in the level needs to generate the overlap events, at least as far is i figured out.
could i do a trace without the events?
You just have to set the collision component as a child of your mesh component (for example) so when you scale your mesh the collision will be scaled with it automatically
I don't think so
Also you should really be adding your locker to some type of main UI canvases not just adding it to view port. Show when game starts creat a Main UI canvas open it up and add your locker UI to it then you can access it like so.
But I guess that you are scaling up your character at runtime right ?
Its probably very simple; i think im over-thinking this and getting confused
yes exactly, and currently I want to create another capsule component that i scale up beforehand and then check if there are any collisions, and if so deny the upscale, but to get the overlapping objects, as it appears, they need to have Generate Overlap Events enabled, which I then have to set for everything. I'm not sure about performance and maybe missing it for some but maybe it gives better control over that anyway.
If you want an example and have time to DL a big file https://github.com/LordMaddog/DarkSouls-Like_CombatSystem-UE5 is a fleshed out system you can look at
Its not perfect because I am still learning but you will see how I have the basics of a UI set up.
thanks!
If you have any questions feel free to ask If its complicated I may even make a video showing what you are asking about.
But do you think, enabling Generate Overlap Events for all the Actors/Meshes in the scene will impact performance poorly?
why do you want to do that?
Because I need to check if there are any overlapping objects
Honestly your helping so much; thanks!
Typically you can do that by other means
Currently I'm trying something like that, but then I only get actors, that generate the events
You can attach a Box or sphere collision and do this
But as far as I got that now, this will only give me all the Actors, that have Generate Overlapping Events enabled, so this means I have to enable it for all the Walls/Floors/Ceilings/... and everything.
there is also. If you are trying to get a static mesh though you should use a Trace on channle visability
But for the Overlapping Components, the mesh also does needs the Generate Overlapping Events enabled right?
https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/Tracing/Overview/
For tracing you mean this?
Overview of the Unreal Engine 4 tracing system.
will get every thing around an object
I think with Trace the Actor does not need generate overlap ticked
nop it don't
And I could use MultiCapuseTrace and match the capsule to the chracter collision capsule, then I could be certain that it wont be struck
Ok than using the trace might be way better, I guess, this way I also want generate hunderts of events for something else
I guess for your case you just need to fire the Trace Event once
Noo I will not, it's just a ability that is called, thats why even the overlap events felt like overkill
yea it sounded like a extreme that why I said something
Yea that really helped me, now it feels like a viable solution 🙂
Thank you guys very much, works like a charm!
Glad that you found a solution !
Anyone able to help solve this problem? Players should spawn facing each other, the client pawn turns 180 after possessing when in spawn point 2 (Right img 1)
hey there
is there is a way to lets say when i begin playing and i have a sphere collision on my player to know what is colliding with it or what is already inside it without using begin overlap and end overlap
sorry for my English 😅
here is a video to better show what i mean
You could use Multi Sphere Trace for Objects, I think? Set the start and end to the sphere's location, and just loop through whatever it hits to find the actors
In event begin play you mean?
It'd be better in event Tick, so it continuously checks
Unless you just want it to check once, then yeah, event BeginPlay will work fine
wouldn't that be so expensive? as my game is openworld multiplayer
would creating the collision spher after spawing work?
It's not expensive enough to cause issues if you're using it in Event BeginPlay
If you only want it to check for stuff when spawning, it should be fine
yeah i mean in event tick
i will try
Again, not expensive enough to cause issues, I think
If it does end up causing issues, it might be worth using Begin Overlap just to trigger Multi Sphere Trace
That'll reduce the overall cost
For some reason none of my events and nodes are visualizing their outputs when I run my game
Can anyone help me?
These are…words
What do you mean
You could try using a timer when beginoverlap and checking for overlapping actors and do trace and then invalidate timer on endoverlap
Does anybody have an idea to create a material like black-body (which absorbs all lights, i.e., black and unlit) ?
what's wrong with an black unlit material to ask this question in the first place?
Do you guys name local blueprint vars differently from global one similar to what you would do in code?
Like writing lower case for local vars while uppercase for global ones
Yes
Expensive for who? Depends what executing the code and what hardware they have
@vivid notch what global variable are you talking about tho
Do you mean just the variable in the class?
I suppose you don't mean global variable where any instance can read.
Afaik normally the prefix is g_ but i haven't really seen any because global variables are inheritetly evil
i see thanks ❤️ '
I worded it wrong. I meant public vs private members of a blueprint class.
Yes a class variable
Those are just access specifier, nothing to do with either global or local var
Public anyone can read
Private only that class can read and write. Not even derived can
There is also protected, but I don't know if it's a thing in bp. It should tho
Like these:
I was asking whether there is a naming convention to help distinguish between private and public variables.
Private and public are access specifier, don't get it mixed with local variable vs non local variable
For me, I use l_ for local variable
Local variables are those you define in a function body correct?
Ok got it
isn't BP messing with the displayed name anyways?
Hmm don't know about that. I just know that it seems normal for people to for example to name a private variable in lower case while having the first letter of a public variable uppercase.
In code that is
yea, makes kind of sense
somehow bites with epic naming of bools for example which are like bool bSomething;
i wish there was a nicer way to see in the context menu if something is local or global tho
too often i had the issue where i had to take guess of which is the local and which is the global var -_-
You meant local vs global not public or private access specifiers right?
Maybe I'm just overthinking it. Online tutorials in blueprint seem to do just whatever. But I guess many of them are designers not programmers
If even ^
Isn't there a complete article and guide lines for epic coding standard
In my case rider always remind me
They don't use _ afaik
Capitalise the letter instead
MyNumber
L_TempNumber
First ever scripting was in lua. So I tend to just name local function variables prefixed with local. But just like in code, it's still much easier to just check the definition. Cause on a larger project, without a solid style guide enforcement, which is even harder in BP with artists, people just don't follow a style guide much.
EnemyCharacter instead of Enemy_Character
in CPP there's an unreal writing convention and it is checked by both VS and rider, it's basically large cap at the start of every word, no underscores, small b in the start if it's a Boolean, not crazy.
I don't even know style guide exist till recently. It was always free style dumping nodes learnt from tutorial hell.
😄 Yeah
I am following some videos to learn new parts of the engine and my editor started something different from what I see in the videos. when I implement an existing event it is always adding the parent call, but iirc it never did that before in this same situations. am I missing a config somewhere that I might have changed?
Hard to tell without knowing what you watch
But what you need to understand here is what parent call is
Dw about the video you watched
ah I know what it does, I am just confused because my editor is adding the parent node but in the video it doesn't do the same, even following the exact same steps to add the event 🤔
this is all I am doing in a fresh blueprint file inherited from BTTask_BlueprintBase
here is another example in a blueprint inherited from User Widget, I click to add the Pre Construct event and it always adds the parent call
@spark steppe I made kinds of a traffic light, and this figure is part of the cyan light.
However, in this figure, some of the cyan is reflected on the black material even though the black material is set to unlit.
So, I do not want to have any reflected color there.
there's a material setting "fully rough"
that should avoid any reflections
how to use this blueprint node (seems like a bp interface node)? I want to create a project where I can selectively remove animation tracks from metahuman joints, for example, removing only eyebrow raise joints, or from chin up/down joint. if this is not the node to do it, is there any way? please help
my metahuman animation is inside sequencer, i play that sequencer via blueprints, i have buttons which i want to use to turn off metahuman bone track animations for selected joints.
Hello I'm back. (with my unique number from coordinate pairs problem) So I tried a whoooooole bunch of things. From Cantor functions to using split up seeds, to using distance from center combined with pairing functions. Nothing gets me a non-duplicate number results. 😦 I'm going out of ideas here but this is paramount to my game. I need to get this working somehow, because without it my entire game idea falls apart.
I desperately need help.
Can you guess a max grid size you'll have?
Theoretically endless. But in reality nobody will ever truly (probably) go beyond a certain point. My world is built from the origin. As players travel away from the origin, the game gets harder and harder.
Okay, but what are your grid sizes. You said a cell was like 10k?
yup, that's correct
The way it works is grid sections (like tiles on a chessboard) are spawned around players. Then inside those grid sections either a random island is spawned or nothing (open ocean). So what I want is being able to drop a player anywhere in the world after which the grid starts generating around said players and giving the exact same islands as when the player would have started from 0,0,0 and traveled to that location
Therefor afaik the only reliable thing to use is the x and y coordinates
of the spawned grid section
The Cantor function was the closest I came to a solution. It actually worked nicely except for one issue: negative numbers. It sadly can't handle that.
So. Math says you could make a grid side of 22,000 for each corner and still stay within the positive side of int32.
Do you mean 22000 grid sections to one corner of the map?
That would be 22,000 x 10,000 for size. Which is roughly 1,367 miles for one side of the map.
Yeah that sounds big enough
So you'd end up with a max of 2,734 miles of map if you ran from one side to the other. 😄
It takes around 10 mins to sail across a single grid section's length
7.333 hours to sail across the entire world lol
Pretty confident no players will ever go this length
😅
Either way, the point is that you have 2,147,483,647 values in an integer. Not including negatives. So you need a value that fits within 25% of that.
22,000 x 22,000 is 484,000,000
Ok 🤔
The idea btw is to somewhere far far away at a certain point stop generating islands, at that point players would enter an endless bare ocean. There should be more than enough islands to sail back to anyway. So there's no actual need for the world to be truly endless. Just very very big is enough.
+X, +Y
You add X and Y together. Add nothing else. This is a range of 0 to 484,000,000
+X, -Y
You add X and Y together, and then add 484,000,000 to this value. Now you have a range between 484,000,000 and 968,000,000
-X, +Y
You add X and Y together, and then add 968,000,000 to this value. Now you have a range between 968,000,000 and 1,452,000,000
-X, -Y
You add X and Y together, and then add 1,452,000,000 to this value. Now you have a range between 1,452,000,000 and 1,936,000,000
You can't end up with a same value for the same 10k by 10k grid cell.
Aha! Very interesting yeah. I'll try that
Will report back in a bit! Thanks already for the tremendous help though. REALLY appreciate it ❤️
hopefully easy question, how do i save variables between game sessions? im trying to save player sensitivity and audio settings between play sessions, and i found game instance but i do not think that helps me out. any pointers?
Do you use C++ at all?
nope, just blueprints unfortunately
Then pretty much everything should go in a SaveGame.
Normally there are two different ways to do things. Device related settings like graphic settings and sound settings are normally done in the GameUserSettings. This largely writes to an ini file. But it requires C++
Then user specific settings like color blind or personal preferences are saved in a SaveGame because the binary savegame is easier to transfer around with the player when they switch machines and such.
But you can kinda do both of these in a savegame if you're BP only. Chances are if you get far enough to care about the split, you're on consoles, and if you're on consoles, you're gonna need C++ anyhow. 😄
can you please help with this @maiden wadi
Apologies, I don't know much about metahuman stuff. But the tracks, are you turning them off for the editor only?
There are some editor utility things that allow you to edit sequencer stuff, but I've only vaguely messed with them.
during play, i want to simulate loss of muscle use while metahuman animation is playing. so that has to be done by turning off certain bone track animations.
currently i'm turning off sections of the animation tracks (entire animations) switching between them.
but i want far more granular control by switching on/off bone track animations for example head_joint
no worries
if you can even guide me on using this "remove all bone tracks" (message) node i can figure it out.
There was a thread. Wonder if it's still around.. sec.
there are quite a bit of (message) nodes in blueprints , if I can learn to use them it will be a good way to solve this issue, thanks!
Hmm I know in godot engine something like that would be called a bone filter. Unreal def should have something like that.
Hmm. I can't find like an enable or disable in here. But these were about where I left off. You can edit the sequencer tracks with these and other functions.
Idk what you call it but when you run the game the blueprint graph is supposed to visualize the firing of nodes and stuff right?
Also heres my cursed character blueprint
Yes. When you hit play, the event graph can show you the paths its currently executing. As there can be more than a single instance of any particular blueprint running, you also need to make sure to select the right instance of the object in this dropdown at runtime.
Oh I understand now. Datura gave you the answer.
Thanks both of you
i did get up to this point where I can see the individual tracks and their values using get channels,
possessables < tracks < sections < channels, but then one last thing left is to modify the channels which is where i am stuck at.
is there a more efficient way to do this ?
when i'm moving my character i'm locking the camera rotation, and when i'm not moving them i'm letting the camera orbit around them
but when i print string after setting the orientation and rotation, it prints a shit ton everytime i move, so it's also probably settings those values a bunch as well? is that bad practice? is there a more efficient way ?
Should I implement enhanced input system if I want to use Left Mouse button instead of using this event?
Why are you enabling and disabling orientate to movement and use controller desired rotation? It sounds like you would just have them disabled.
Blocking camera movement could be as simple as adding a branch at the start of the look input action that check the is moving bool.
yes, the old system is inferior and will no longer gets updated.
Thanks
Enhanced inputs is the current method for handling inputs. The old system is depreciated so it's not recommended using it unless you're working on an older project that's already using it.
Does it mean I can exchange ''Event Tick'' to the Hold trigger ?
Also If I want to just get button click, value type will be Digital (bool) ?
Sort of. Input actions have a triggered output that fires most ticks. The hold trigger is just how long the assigned key needs to be held before the started is triggered.
Hmm so equivalent of Pressed is Triggered and Released is Completed?
or should I make 3 Input actions if I want to have: Pressed, Held, Released ?
Assuming you have no modifier applied to the input action, pressed is started, released is complete, triggered is called most ticks.
On going and cancelled are more applicable if you're using modifiers.
Ok, so I don't have to put Triggers inside the Input Action actually?
You don't need to no, they're just modifiers you can apply if needed to change the default behavior.
Thanks for help, it works 😄
anyone have any idea why my game is crashing? i keep getting this error
Fatal error: [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Private\HAL\MallocBinned2.cpp] [Line: 1438]
FMallocBinned2 Attempt to realloc an unrecognized block 00000205423D0000 canary == 0x0 != 0xe3
When do you get the error?
If it's random, RIP.
The worst of all bugs.
The feeling when you just happen to have the right thing open at the right time to actually catch the cause of random bugs is glorious haha.
It has been completely random unfortunately
I havent been able to identify when or what is causing the issue, ive been standing still and had it pop before
it only pops up in a build like shipping or dev, not in editor as far as i can tell
I can post the debug build if someone wants to take a look, I dont know whether thats allowed or not
or i can also post the crash log
it's printing heaps because you haven't set a print key, so every frame it'll print a new line
you built unreal engine from source?
Im not sure what that means, ive just downloaded it from the launcher lol
will try that now, thanks
I have a UObject Class for a quest phase and I need to call a function from function library but it gives me error for missing world context, know a solution?
any idea why the delay breaks this? it destroys the actor immidiately when no delay, but with the delay the actor never gets destroyed.
just easier set lifetime on the spawned actor it destroys by himself after that time
ohhh, didnt know that existed, thank you, gonna make things so much easier
Im probably asking a lot here by doing this, but this is a build of my game with included crash logs, if anyone wants to take a look, i would greatly appreciate it:
https://drive.google.com/file/d/1KR1oBW8N6JZb6Hjn0Tlvvn4ez9K4IzWT/view?usp=sharing
You can't get world context in a uobject without doing c++.
Ok gotcha thanks
Hey folks
I somehow get an infinite loop error. I have tried manually looking through my BP's, but I can't seem to figure out what is triggering it.
I get the BP in question from the error log.
Is there an easy way to find the actual issue from that?
It seem to reference this "Is Valid" node as far as I can tell:
I'm checking if self is valid because I spawn the BP as child actor from another BP (and if the parent has been destroyed I guess "self" in the above screenshot could be invalid):
Time will tell, but I think that may have fixed my issue
a need to manage different actor into my actor list
is there a good way to do that?
or i have to do with lot of If condition
is there a Case node?
or i need to create a macro? with inside all different type of casting?
The is valid on self isn't necessary.
We need more information. What are the actors? What is the goal of the function?
Okay. I have a delay node. If the actor is destroyed in the mean time, would the rest of the code just not be excecuted?
(was afraid the command was qued up somewhere)
actors are different actor overlapping my collisions box
if for example it's a road : i need to say you are on a road, your speed is 100
if it's on a mudd: i need to say you are on a road but on a mud so your speed is 75
Yea if the actor is destroyed before the delay executes it won't do anything. Plus it can't destroy itself twice. 🙂
so i have different type of actor and i don't know which they are, but i need to know what type of actor i have into my list
and exept by casting all of them to find what i have. i don't know if i can know what i have into that list
Good point.
You think this "Is Valid" node could be causing the whole infite loop issue though?
like that i can redirect to the good code base on what i know i have
You should look at physics materials. They allow you to define physics on a surface and change the surface friction (and other things).
i will have a look to know if it can solve my problem
I won't be directly but you never know with UE. Lol. I had a cast node cause an infinite loop but only when casting to a specific class. (It was inconsistent about it as well)
Even if you don't use the settings, you can define the 'surface type'. This can be gotten pretty easily without having to cast to the specific actor type.
but how will you determine on which surface you are?
if the same surface could have 2 different role
quick question about casting, i know it increases ram consumption, as it keeps whatever you cast to loaded there, but if i cast to the same actor multiple times, both in the same blueprint, as well as in other blueprints, does each one of those castings cause an extra copy to be stored in ram, or will it only be stored once and used by all the blueprints its casting to? ill learn interfaces later, but for my first project this will determine how crazy i can go with casting.
where character turns into dust when moving lol
TAA
if you are into a fast road the mudd will slow down from 100 to 75
if you are into a slow road the same mudd will low down from 50 to 40
ty
so the same mudd will be the same surface but they need to play 2 roles according on what is under the mudd
and if the actor overlap at the same time the fast road and the slow road... we need to determine wich one will have the priority
and i need to do those check on onverlapping and end overlapping
otherwise i don't see how i will manage all those rules
You can have a short line trace from the players feet to the ground only needs to (1 or 2 cm would be sufficient) and if it hits something you can get the physics material from the hit, then you just get the surface type from the physics material.
Only the class is loaded into memory (and whatever the class references). Having multiple actors cast to the same actor will only have the class loaded into memory once.
So I want to make all lamps in my game to flicker randomly, should I use timers for this or is there a better way? (There will be hundreds of lights in a single scene, so that would be hundreds of timers running. Is that bad? Even if they only execute every minute or so?)
oh okay, thanks. in that case i can go crazy with casting without worrying
If they all need to start flickering at the same time, I would create a manager class that manages the lights you want to flicker. The manager would then have the timer that calls the function to make all the lights start flickering.
Don't go crazy. It can still be catastrophic in large projects.
Mainly, don't cast to a class that has assets loaded in it. Always have a base class that is code only
Sort of. You want to make sure you're using good hierarchy and casting to base classes that don't have heavy assets like static meshes, sounds ect in them. This can prevent assets from being loaded that aren't actually being used. Base classes would normally be loaded anyway.
Yeah, it's the default object that gets loaded, of which the engine loads of every C++ default object.
It only loads bp ones when needed, but if it's the one that has assets in, you can have a very very bad time.
It's one of those where you don't notice it until ("Why does my RPG need 12GB RAM?")
Sometimes I'll add a blank function to a base class even though it's only implemented by one child just so I don't have to cast to the child.
Need some help, crazy desperate to why this little code aint working, its been damn days and i cant not for the life of me work it out. It just wont add it to the scroll box.
I have tried so many iterations of it, but yeah not a damn clue
Does it print?
And in the widget you're creating here. Does it's Construct event run?
It should run during the AddChild function.
Did this, and no its not printing it
So the create widget is not creating the widget
Odd. You're sure the scrollbox is valid and added to the main menu hierarchy, and you're sure that you have the main menu widget that is displayed on screen?
Yeah quite sure, otherwise it would print an error cos it cant find the list in the MainMenu.
Thats the scroll box in question, mind you i have almost the exact same thing next to it that works and displays everything.
Thats why im here to ask questions for the first time, cos this one is over my head
Nothing about your code is wrong. Create, Set initial state, Add. You should 100% get a print in that widget's construct assuming that code line is running and the main menu and scrollbox are valid.
I remember the list view widget also having an issue with add child. I plugged in a vertical box and that worked fine in its place, but it's not the best replacement. Some things are just weird.
so how do you add content to a list view widget?
here is the working side, its mean to be simple XD When click button make new widget. Guess i was wrong lmao
Assuming you mean the actual ListView widget, you add object items for it to display and it internally creates only enough children to manage that. It's very different handling to manually creating widgets into a VBox or Scrollbox.
the timings need to be randomized
Does it impact gameplay (other than just being visual)
"I remember the list view widget also having an issue with add child."
I use the word also to refer to the list view widget alongside the current topic of scrollbox, so yes I am referring to listview. However, if add child is not how you use it, then it was all irrelevant. But am now 1 step into using it right if I want to try at it again, so all is well.
Can you F9 on the AddChild and check that the created widget is valid here?
I mean it has to be or you'd get errors for the FName set. :/
I could see display issues or something, but the Construct event not running is really confusing.
Yeah thats what is getting me too, i made it soooo simple so the core concept just works then once it works expand, but even then, simply creating the widget isnt working, Bruh moment
Makes me really happy I don't do a lot of manual widget creation anymore. 😄 List/Tile views for the win.
XD
Thats what i was trying to avoid, its all populated from a struct/datatable
But its poopy
Stinky

guys I made a Enemy AI,but I dont know how can I change his Chase Run Speed?
Eh, could still and should still use Listviews if all entries are the same. You get virtualization. Which means much less created widgets, so much less slate prepass.
You can just make a simple Object class with your RowName and create those from the list of names you have. Pass that array of objects to the listview and done.
yeah possible a rework might be in order
Create a variable or should be able to change it in the character movement?
character movement component > max walk speed. If you're using another actor type, you program it yourself? Plenty of ways to do it.
@maiden wadi Thanks for the help btw, Ill try a list view. See how that goes
when I set max speed,it's affecting normal walk speed too
All good. If you ever do have that again/solve it, I'd be curious to know. O.o That's quite the fucky bug.
Then change it back to normal walk speed when you're done running.
programming. State machining with blueprint and editing the value through the character movement component on your character actor.
Yeah i will, gona try a few final things and see how it goes, cos i like the flow of the code of the current way. But if not, re work time lmao
other blueprints has no "speed" thing
I think to change speed of a Character you need to change "Max Walk Speed" variable
I tried this. But this also affects normal walking speed
When i work out this damn UI stuff, ill be looking at making AIs so i should be able to help ya then xD
ooohh
That's normal you have to set "Max Walk Speed" to 1000 for example when you run and then when you wanna walk you set the same variable to 200 (for exemple)
I really cannot wait until GAS attributes are usable in BP. Gonna make helping people with issues like this a lot easier. :/
ok I made ity
Yes in the beginning of learning UE it's not very easy to understand which variable makes what exactly. You have to test it and see how it works 😅
ye lol
why in the first case i can search for a specific object but on the second case i can't?
get overlapping actors allows you to filter by class.
isee
why could this be happening?
in the bp its fine but in an actual level its flipped 180
try making a little script like..On BeginPlay have flip 180? Just rotate it by 180 and see if that works lol
i think my sails material is causing it to be curved backwards instead of front
You can't override on reo player state in blueprint ?
What is the type of object in NewParam?
object reference
This would be why. Assets are also objects. But assets can be globally referenced. ActorComponents are instanced at runtime. So you cannot pick a specific instance of an actor component.
put it outside the character bp
or manually update its transform in a world position i guess
i guess
i need to be able to move it via bp
then put it outside the character?
hm isuppose
maybe you can change the Mobility when you need it to move. but i don't see the purpose to attach it to the actor if you don't want to follow the actor
Use blueprint of the character to do what you need to do. If it's attached, use the detach function to detach it. And of course, you can add the component via blueprint instead of adding it in the editor. The mobility doesn't need to change value, because if you detach it, it will stop moving with the character, and from there the character's blueprint will still be able to manipulate it because it still owns the component.
and what will happend if you attach it again? will jump to its normal position?
depends on the mode. You can keep it relative to actor or relative to world.
Is there a way to view a uasset blueprint from my project without needing to open it?
Unsure what you mean?
yk theres https://blueprintue.com/
is there like a more advanced which can open uasset and show me basically the same as in the editor?