#blueprint
1 messages · Page 175 of 1
You can delete the old one, place a new one and build paths
But for #gameplay-ai it’s best to use visual logger to actually determine what went wrong
MoveTo failed to project destinationlocation to navmesh
I'm going to ask in here as it seems like it might be a more appropriate place. Does anyone know of any resources that can help with non-typical player control? For example, in my project, I have a robot that is controlled by the user pressing buttons which get added to queue and are executed in order. I have the system working, but I'm struggling with the physics side of things. I have it move using a timeline, but then it floats instead of falling through holes. I know a lot of this is given for free if you use a Character or Pawn, but as I don't want the user to possess the robot, I started from an actor base. I'm kind of looking for how to build something up with physics/collisions from scratch
Sounds like AI and behaviour trees might be the way to go and research. You could probably get away with the AI MoveTo node if all you want is movement (nothing complex), and physics should still work
(You will need a navmesh in your level for that to work though ^)
Start with figuring out how you want the thing to move
do you want it to use physics?
Is there an equivalent of AActor::PreInitializeComponents() in blueprints?
I need to setup some components before being play, but the Actor constructor doesn't seem the way to go. Is that right?
GameInstance Event Init gets carried out sooner I think if that's of any use
Or you could setup the actor, and only posses them after that's all complete?
That is an interesting take. But still, initializing it in the game instance is a "no go" for me.
Regardless, I just checked, and I was missing something something in my blueprint code. The initialization in the constructor is working now.
Thank you Donny for your time 
Only thing close to this is the Cosntruction Script, unfortunately. I would love a default exposed Pre and Post InitComponents hook.
It would be so awesome to have access to more C++ exclusive functions in Blueprints 
😄
Components added at Run Time aren't shown in the editor? Or I'm attaching it wrong?
guys do you know how I can draw semicircle with trace box ?
I know circle is via sphere
but semicircle is what I need
Nothing added at runtime will show in the editor, usually.
I think you would have to model a semi-sphere and use that as your collision mesh.
Oh, okay thank you.
Hi, I'm using the water plugin for the first time and I'm having a bit of trouble.
I'm trying to spawn a bunch of custom water bodies, spawning them manually works just fine, but when spawning them using Blueprints, they spawn, but but the water itself isn't appearing, and the splines look like this.
What are the splines even for anyway?
Having a small but annoying issue, not sure if blueprint or general UE5 but I can't seem to make my char to be at ground level without disabling snap to grid, one would think I could just set everything to z=0 and it should align if my char/pawn is at z=0..but no go
Check the character blueprint and see what the mesh looks like compared to the capsule component
The mesh tends to sit above the lowest point of the capsule for some reason
Yeah I've been playing with that
What's the difference between these functions?
z=-99
I think clear resets the value to zero as well
Just move the mesh down a little more, I think it's as simple as that. Unless it won't let you?...
Yeah, set both capsule half height to 100 and then mesh z=-100
that aligned it perfectly
and then pressing END when placing the char works well
I'm just testing, but I'm curious if casting inside binding is expensive? 😄
Thanks!
Know it could be many things but looking for some ideas - why my PCG forest could be so far from the ground?
PCG object itself is at z=0, landscape is z=0. It is hilly but even on the hil it's above the ground, so it's consistent
this is my transport points node:
no it isn't
It shouldn't be lol
If I bring z down, it temporarily goes down then snaps back up above ground with z being minus what I set (essentially ignoring the setting)
Generally speaking though, this probably shouldn't be a bind. A bind is an event tick essentially, it's called every frame. If the value updating isn't constant, or near constant, it shouldn't be in a bind
What is the best way to update something without bind?
do it manually, get the text block, call set text on it.
Make an event in your widget, do the same logic you're doing there, but with a set text node instead of the return value.
Then call that event when it needs updating.
Alternatively, and preferably, make a dispatcher in your character or whereever for when gold is collected. Whenever you collect gold fire the dispatcher.
In your widget, bind aforementioned event to the dispatcher
I have the amount of resource inside Player State and there is event that calls to increase it. I guess at the end of it I could put something like dispatcher?
Yep you can.
Tbh, you would probably be fine keeping the binding just to be transparent, but it's generally bad practice for infrequent updates.
Do with that info what you will
I know binding is lazy way, I wish I knew what to exactly do and understand how to make it better. I will try to understand dispatchers more and how to use them here.
Try to imagine as your UI as a layer on top of the game. The game functions perfectly fine without the UI.
To achieve that without binding everything, you can use dispatchers. You're basically broadcasting a message to anyone that cares saying "Hey I picked up some gold!"
Your widget can listen to this and go "ooh, I should update the counter now!"
I should have dispatcher for every different resource?
You could, or you could pass information through whenever a resource is collected that tells the widget what type of resource it was.
Up to you.
If a resource is likely to change often, a binding could be preferable there
Like if you're getting gold a few times a second, might as well bind
PCG question: I can't seem to find a setting that allows to me set minimum distance between meshes spawned, I now have buildings (almost) overlapping. They're not, technically because of collisions maybe but it's too narrow. I'd like to set a min offset of sorts. There is an min and max "offset" setting in "transform points" node but they shift them all together in one way or another, not really between themselves...
Damn, do you think this makes sense? this is inside Widget. And it's called here and there are functions for each resource
Makes sense to me. Most importantly, does it make sense to you?
More than before I did it. I need to clean it up nicely for sure, just wanted to see how it looks in practice when it's done. I will see in what other places I will need it and maybe 1 dispatcher per resource will be better as, or I will just make similiar dispatcher for other thing.
Does it usually mean that if I want like 4 things to happen when 1 things changes, I will have to call first 4 dispatchers in 1 place for example? and these 4 things will listen for it, so I will bind each of them.
You can probably get away with a single dispatcher with a single integer and your enumerator.
Ohh, just by calling the same dispatcher?
No more expensive than binding itself is really. But that get player controller 0 is sus
then before I have to call it like this?
Wonder if that bit could be simplified.
Increment X amount doesn't sound like it's doing much more than ++'ing a value.
this is what is inside function
it can be different numbers, not always +1
or do you mean just take it out from the function?
If you're seeing that you're doing something over and over again after branching or using a switch, it's likely that you could use a select to do it better without repeating yourself.
The only thing with this, is that the OnRep doesn't fire for the host.
So I have a blueprint character, and whenever I crouch and bump his mesh his BP character sort of "jumps". How can I prevent this?
This is basically widget that every player owns for themselves, so if I call from PlayerController(0) to the PlayerState, it will call for each player locally and will get their own numbers, or i'm thinking wrong?
In a bit of a bind im trying to make an overshield for the player but im not really sure how i can set it to check the shields value before health. Like if the shield is 50 and damage taken is higher it subtracts from shield then health but has to check shields value. Heres what i got so far. Not really a programmer but this is how far ive gotten with videos and such.
yup ;D
maybe i could do a branch with checking shield value but im not sure
when u take damage, apply to shields. and the remainder to health.
So Get shields minus damage, set the remainder damage, apply the remainder to health.
Maybe on false add the negative value to shield
shield damage and health damage are seperate variables so would i need to have another minus for health damage?
Untested.
If it's below zero it's a negative so add that to your shield
can the player have overshield and less than 100 health, or must you always have 100 health to have overshield
shield value is determined by a pickup the player gets wiith a max value of 50
heh, not 51?
well i felt in an arcade shooter where the player gets power ups all the time 50 was fair for an overshield for now until programming is done at least
50 seems normal. 51 seems... not good
the only thing is shield and health have seperate damage would it work if i just used shield damage on both?
I see your 51 and raise you 51.25682
this should be the only reference area for it
this is why i love the gaming industry sometimes
well it doesnt see the health value unless the player has the shield already. Maybe the player should just start with an over shield?
some crutches
or was i not supposed to unhook the original health?
So when your shield gets hit it suppose to take from health ?
if it has excess damage yes
like the shield in halo
but u know indie
and i still care about my characters
should i put the pictures up again for reference?
yea, actually start them with terrible crutches spoon feed the player with super obvious controls
well its a survival game so the players gonna be chased 24/7 shield just help them refresh gameplay and adds a little forgiveness incase of lag
I see would doing health, you should probably do shield first
so do what was made above and add the previous health system to it?
Your doing the health in the code you posted, you want to start with shield and see if it's above zero, you want to combine we then on the same event ?
yes all should be on event 'take damage'
so this
somehow goes to this
so on that first branch in the first piture i then plug in the second picture if false?
wait no that is close but not quite
I would check if the shield is greater than zero first and then on false just do health stuff
Hi all
dang the shield doesnt take damage
I have a "Sphere" that scales over time. Do you think that I can spawn "decals" inside it as the Sphere scales ?
Don't need this part in the first image. From the second image, you can check if health > 0 and if false, they're dead.
like all in first image or setting the value to 1?
You're also using way too many variables this way. You need to encapsulate this into a function and use some local variables.
videos that are useful for the way it was done previously to now confuse me
I don't know much about select but you can do this with maths
After you check for greater than zero on true is where you need the maths
Subtract the damage amount from shield if it's greater than zero add the result to your health checking for zero and death you can make another event or two to clean it up maybe like suggested make it a function
hmm ill give it a try. Ill probably return tomorrow if i find no more solutions to this. THANK YOU EVERYONE!
Hi, I'm facing a strange behavior, I was trying to conditionally detect a drag from the user, but it always detect the drag if I use Unhandled as return
In the actor blueprint, two spheres under the skleton mesh are applied to both hands to detect line traces. Why can't recognize the skleton mesh itself?
Do you want the traces to hit the skeletal mesh?
yes
The trace is looking for anything that blocks the visibility channel here, you just need to make sure your skeletal mesh: (a) has collision enabled, query only should be fine, and (b) has the visibility channel set to blocked. You can do this e.g. by setting the collision type to custom and manually adjusting each channel.
like this?
That should work 👍
Side note: you can change "Collision Enabled" to query only, if all you care about is the trace (and not collisions), and disable "Generate Overlap Events". Less impact on performance, and the traces will still work.
Unfortunately, my line trace doesn't detect the mesh
Does the mesh have a physics asset assigned to it?
Is there any best way to put skleton mesh in blue print and detect skleton mesh using line trace from both hands?
yap
hmm, click on one of the purple bodies there and see what its collision settings are in the details panel
what's your goal btw? what are you trying to do with the traces?
My goal is to wear line traces on both hands of the character to detect and avoid collisions that allow both hands of the character to penetrate the body
left : original animation right:Avoid collision
So you just want to prevent the hands from clipping into the body? Maybe "physical animation component" is what you want
has anyone ever had a BPI event be an event in 1 actor implementing the interface and a function in another actor?
Yes, I want to make it an animation without piercing my own body. The person who realized that picture said that he used line trace to avoid collision
@graceful sage @plush ridge Thank you for your help
Did it work?
yes
Awesome
oh whoops, nice catch
Now, I'm going to start a terrible job of creating an evasive vector once the vector value is calculated for the collision. Have a nice day
I've got a problem now, also:
I'm trying to set the position of object A based on the distance between object A and object B.
It works, but the distance value starts to fluctuate wildly when the two objects get within like 5-10 cm of each other. Any ideas?
this is a cache issue, adding new event in BPI and recompiling fixes it
Just looking for some general ideas about an issue I'm seeing. I have my hobby game playing in PIE correctly and variables I want to track are persistent in the game instance, but when I make a Shipping build of the game, the variables in the game aren't coming out correctly. Any one have any creative insight possibly? I'm searching for straws atm. 😄
convert it to a set/get function and log callstack every time set occurs?
and the value before, and the value being set
@steel star Thanks! I'll try and do what you said
Set how? What's the math
probably a divide by near-zero
Either that or just moving speed x delta time towards target, when closer than that.
that sounds entirely plausible
I'm trying to map something to an enhanced action event (the first screenshot is what I want), but I have this one subclass of a player character which for some reason doesn't show any enhanced action events at all, and I can't figure out how the class got into that state.
Something must have gotten disabled within its settings that prevents those events from being suggested in the bp, second screenshot. Any advice on what that could be?
I get world location of both components, get the distance (vector), and then map that to an alpha value using a curve. The alpha value is used to set the relative location of one of those 2 components, just lerping between 2 preset locations
This is the gist of it, but the relative location/rotation set is on an object involved in the distance check
What would cause my subsystem to become invalid to blueprints every time I restart the editor?
What type of subsystem are you making?
A world subsystem
Ask in cpp?
Ok
Does it show if you check context sensitive
Nope, I tried 😦
Hey Dismiss! I got it narrowed down to this. Using the increment node works in PIE, but not in the Shipping build. When I converted the increment node to the old get and set method, it doesn't work in PIE anymore, and acts just like it does in the Shipping build. So somehow, this increment node is being converted strangely in the final build. Any thoughts? I'm using UE 5.3.2
someone can help me?
I need to get the closest vector
but this thing doesn't work
always chooses Spline1
Can someone look at it and advise?
someone?
or maybe another idea, I just need to get the closest point to the player in the actor
im doing a raycast and i would like to get a variable from the actor the raycast hits. how can i do this?
Can you please try to debug it a bit first. Put print strings into the ForEachLoop where you print the current Index, Element, the calculated Distance and the Compare Distance, as well as when it updates.
This is a very simple function that you should be able to debug yourself. If the result of your debug shows something that you don't understand (as in, it shouldn't happen) you can gladly post your findings.
Two to Three options:
- If you are only looking for one specific Actor Class, and only ever will look for that one specific Actor Class, then Cast HitActor to the BP of it and access the Variable.
- If you are looking for a "set" of Actors, that share a common Parent Class which can hold the Variable, have the Variable in that Parent Class and cast to that BP and access the Variable.
- If you are looking for a set of Actors that isn't sharing a common Parent Class, but have a common "context" (like they are all meant to be "Interactable Actors"), use an Interface for that Context (E.g. BPI_Interaction) and make a function that returns the Variable in said Interface. Implement the Interface on the BPs that should return something for that function (the variable I guess), implement the Function to do what you want on the BP and call the Interface Function on the HitActor.
But also who the heck made that function and why not just use a line trace, which is what a “ray cast” is in UE
i use a raycast it just holds the math
i find it more organized that way
Thank you so much! it's the second one. i am gonna try figuring it out
It's totally fine to wrap LineTrace/RayCast logic into a function if it slims down the graph from repeated 5-10 nodes to one. Don't worry.
Only thing that might be a tad better is to simply return the HitResult. You may only need the 4 variables you exposed now, but maybe later you need, idk, a normal. Or someone else needs more.
fair enough
Hello guys, I have an issue with Capsule Component collission, I guess... When I run with my character on mannequin laying on floor with turned on physics (ragdoll) colliding with a mannequin causes my character to be thrown into the air. So, I guess physics bodies of mannequin in a collision throw my capsule component up. Can someone tell me please how can I turn it off?
Hello, I just want to make sure I'm not doing something stupid: I have the option button in my main menu. I want to send to the option menu the class of the sender menu so that I can go back to it afterward so I can reuse the option menu for the pause menu as well. What's the clean way to go from Self (WB_Mainmenu) to the class WB_Menu?
noob question how to get parent events ? I want to get my parent of the event below but it wont show at list . .
Right click and click call to parent function
You can expose a variable on spawn on the option menu and pass it into create widget node
Hey all, need a bit of advice. I'm working on a game that has player dialogue/action choices, like Mass Effect or something. I want the choices to be boolean variables that can be called up in other blueprints/sequences, such as "DidTheThing= true" and saved into the player's save files. What would be the most efficient/recommended way of accomplishing this? I know using the gameinstance is definitely not the best way to do it.
I would like to be able to call it up in dialogue trees, level blueprints etc
My gut says to do it with a big data table that contains all the choices and plot variables, but I'd like second or third opinions on what the best method is
I figured that out, what I mostly want to know is how to turn Self into a widget class. Can I just cast it?
I have a widget placed in the world. It is meant for the user to click on it. I have the mouse cursor enabled in my game to allow the user to move the mouse. But the ActorOnClicked event is not working for the BP with the widget in it? Any hints?
This doesn't make much sense
just get class right away?
why do you need to cast self
self already know what type it is
Accessed none.
Don't say anything... I figured it out. Brain was not going right.
I forgot to link the "Set" node. So of curse nothing was passing.
You shouldn't need to cast it's already that type
Nvm
It was the wrong type. Rather than promoting the sender screen to a variable, I had created it myself. It wasn't the exact right variable type so it wasn't going smoothly. I figured it out after fiddling a bit. Thanks for the help 😉
Anyone know why adding a spline component dynamically works fine in construction script but doesn't work in a Call In Editor function?
You need a system that can initialize with savegame data early on. Initialize it and pull out the data you need to read and then anything can access it. You will be reinitializing it a lot because the world is torn down and everything deleted every time you change maps. It's normal to use these transition zones as autosaves, if you keep the SaveGame object around somewhere like GameInstance, you don't need to load it from disk again but your gameplay classes will still need to reinitialize from it.
As for the system, instead of a bunch of booleans, I'd recommend something more dynamic like a GameplayTagContainer. Which will let you separate stuff nicely into a hierarchy of zones and things to do and then you can also use it outside of conversations as well as just a general "player did this"
EG
GameplayProgress.SomeMainArea.Conversation.TalkedToTheVIP
GameplayProgress.SomeMainArea.Action.HackedTheDoorToSomething
GameplayProgress.General.Action.BecameFamous
etc etc etc. Throw anything that comes to mind that you'd need to affect a dialog in there. Add it at gameplay or conversation when it happens and then any dialog can search this single container for anything it might need.
So essentially I need to load all the info from a save at the beginning of each stage, and save it again before the end of any stage
Hi all, I'm currently setting up my pause menu and I think i need some help here.
I have a simple toggle which creates the widget and adds it to the parent and then im checking validity to see if the widget already exists and then removing it from the viewport.
however it doesn't seem like removing the widget from the parent considers it invalid?
Pretty much. Are you C++ familiar or BP only?
Mostly BP only, I know a little bit of C++ but not enough to do anything of real value
Set the variable empty/null after you remove it
Right when i do that the older copies still exist and trigger events from the subscriptions
Removing from parent doesn't invalidate or dereference the object
Infact it's just taking the widget out from the viewport. It can be added back anytime.
Is there a specific way to destroy the widget?
Mostly asking because there are some early hooks you can use in classes like GameMode. EG InitGameState, which serve as great places to initialize savegame stuff. I mostly keep a single savegame loaded in a GameInstance subsystem. Can do the same thing in the game instance itself. So that you don't have a bunch of loose properties and don't have to actualy load it from disk a lot too. And if you get more familiar with C++, you can use the Serialize function which will make SaveGame stuff infinitely easier. Less loose properties to manage.
Set the pointer that reference the widget to null
You could do is visible instead of is valid
The object will be garbage collected
Ahhh that's actually pretty smart. I saw some youtube tutorials that say to load every variable into the gameinstance but I was like "nah that's a bad idea"
But just loading the save file itself into gameinstance shouldn't hurt anything
that seems to stil lleave the previous items in memory,
I'm using enhanced input events inside the widget and those still exist.
then whenever I modify one of the variables I can just save it to the save file that is loaded into the gameinstance
So when i open up the menu a second time, all previous references are still triggering these input action events
Have you tried doing what's suggested?
Also triggered runs every frame, you want to do it on started
What's that collect garbage. Don't need that
I have that input action set to trigger on pressed
I do need that
Otherwise the past references still stay
U don't need that
Alright ill remove it
but those previous references still seem to be in memory for a good 30seconds to a minute
Ill also change the input actions to use started
Pull is valid with the question mark symbol when you drag from pause menu
@maiden wadi thank you for the tips. I'm pretty decent with blueprints overall, but game saving etc is something I've never dived too deep into
Not sure if that's the issue but worth a try
I'll use a GameplayTagContainer system instead of boolean variables, and I'll experiment with using the current save file in the gameinstance
Is this method heavy on performance? Would it hitch every time I checked one of the variables? Or now that I'm thinking of it, it probably wouldn't considering it's all getting loaded just on map load
Then I can just use frequent autosaves and checkpoints to make sure data isn't lost
Looks fine
The symptoms of this, are each time i open and close the menu, it like adds another sub to this Input action. (even when its set to triggered.)
I open and close the menu 5 times, opening once more (6th time)
and then I press the tab button on my controller, this printstring is output 6 times.
Likewise when i first open the menu from a new editor start, it only prints once.
After 30 seconds or so any "copies" of the menu will go away (I assume this is garbage collection)
which is why I wondered if theres a way to destroy the widget explicitly, or if collect garbage was a way to go to solve this issue
my issue seems to mirror this...
https://forums.unrealengine.com/t/umg-remove-from-parent-still-valid/435585/3
After more intensive Googling, I’ve found the info that’s needed. Here: link text So “Remove from Parent” and then “Collect Garbage” should fix both of our issues. (Providing you move your “Create Widget” into a function). Testing now… hmm, my first attempt doesn’t work. Let me know if you have more luck!
I feel this might be mostly cause by input action delegates here..
the whole thing smells kinda funky though 🤔
Access None trying to read property error Multiplayer
Collect Garbage does seem to fix the problem but I feel like thats cleaning up the water instead of fixing the pipe here.
seems like maybe this problem has been around and removing and explicitly calling garbage collect is accepted (?)
https://www.reddit.com/r/unrealengine/comments/b4xasz/how_do_i_delete_or_destroy_a_widget/
The reason 'Remove from Parent' doesn't destroy a widget is because you might want to readd the widget to another panel somewhere else in the UI. Widgets are destroyed when they have no parent (not in the viewport or widget) and nothing references it. If you're handling widgets correctly, you shouldn't ever need to manually call GC.
are you referencing it in more than one bp?
no.
weird
I guess i might be handling them wrong?
the widgets have input actions on them to control UI behavior, this is primarily the issue is that these are still triggered when the ui is intended to be removed .
you dont normally do inputactions in widgets i dont believe
I think an alternative solution might be to, in front of every input action trigger, check "is enabled" and then use that from my hud class and mark these widgets as 'disabled'
Happy to hear other options :c
Enhanced inputs and widgets are a little wierd to be honest as they don't honor the focus system meaning the IA's will trigger on all the widgets that have the IA on even if the widget isn't in focus.
This is something I've noticed just today actually.
maybe since the inputaction is on the widget it cant gc it?
This is probably in large part why I have this issue is not honoring focus, removing from parent would remove focus
I normally use this in a few places where I want to use IA in widgets.
Thats not whats happening
🙇♂️ This is more what i was thinking. every solution feels like a hack at this point. the Input Action stuff bit me a bit when I was trying to do ListView navigation, which comes out of the box and IA's were breaking it.
The issue is the input system for UMG hasn't really changed since it was added but since then we've been given a new shiney input system. lol. I'm hoping as they continue to develop CommonUI and CommonInput, handling inputs in UMG will get better but we'll see.
I saw this and wasn't sure if it was worth the rabbit hole, Manually garbage collecting OR putting that focused descendants in the IA's both seem to get the job done. The latter probably being more preferred and performant
ohh you're using commonui
regardless, Thank you very much @dark drum 🙂 gave me some more definitive answers and explainations
No I'm not
From my understanding, that's more for when you buttons that you can link to an IA so when it's pressed it triggers the button.
But was wondering if it was worth to revamp stuff
I use it it makes things better but not at the same time lol
I see, wouldn't have helped. Haven't dabbled in any of this. normally this isn't an issue but only in this project do I try to add IA's to widget / ui controls
Sometimes, i'll override the 'OnKeyDown' and use this function to see if the pressed key was from the denoted input action. It's not perfect but it works when input mode is UI only and still allows you to configure using the Enhanced Input system.
x.x at this point im slowly becoming okay with "not perfect but works" and i dont know if thats good or bad for my game dev career
Whatever gets the game made i guess.
Game dev is all about if it works lol. Granted you should aim for perfect but you'll have to settle at some point.
Thanks again for all the advice fam 🙂 Appreciate it a lot
are you actually pausing the game or are you just adding widgets?
The issue is that just removing widgets from parent doesn't destroy them (which is intended behavior) meaning the input actions on the non visible/non parented widgets still trigger until garbage collection destroys them. (assuming they are still no longer referenced)
Yea exactly 💯
have you tried doing the IA in the controller instead and see if that makes a difference?
🤔 I'm not sure I understand what you mean. Are you asking me to do an IA in the playercontroller, then hold onto a reference to the hud or look up the widget by class and then send the controller input to the widget itself in order for the widget to do the function? and in the case of nested widgets, continue to send the input down the chain of nested widgets via functions on each nested widget?
I'm not sure how you have it setup or exactly where you have your IA currently but you create the widget with inputaction on controller and a seperate one for doing the action by getting the ref and doing the event from there
I can't tell byscreenshot exactly where the bps are
or the full context
I guess being charitable here, that would solve the issue largely by removing it altogether. But would make for a really tightly coupled system and seems like it could get out of hand fast.
the issue is solved though pattym had it right exactly
🙂
With what I shared earlier, this might also help for handling IA in widgets. The first image checks the supplied input actions and checks if the key pressed is on one of them. If it finds one, it returns the input action. In the second image, is how I'm using it where I have map where the keys are the input action and then the value is a gameplay tag. If it returns an input action, I can then find the gameplay tag and use it on the switch on gameplay tag.
Is there a reason to do either of those over this one? this feels pretty simple?
Switcing on a gameplay tag using the input actions is kinda smart tho. I could see the use in that.
Input Actions don't fire if the input mode is UI only. This method allows you to still sort of use the input actions to denote the inputs and have stuff happen. It is limited but it honors input actions assigned in Input Context Mappings so if they don't have an ICM with the input action, it'll fail.
Oh I get it. Damn you are saving me so much time lmao
Admittedly I dont set my inputmode to UI only, I just leave it on game, I'll have to look into what that specifically does. (I leave it on GAME and UI i think.. and use input mapping contexts to make sure game layer is more or less overlayed.)
UI only is useful when you don't want input to bubble down to the game, particularly if you have UI menus that fills the screen. It can prevent other things from accidently being triggered that shouldn't.
Yea that makes sense, my current solution like i said is to just add a mapping context that largely consumes the inputs in UI instead of in the game. ie) my menu select button overlays the jump button so menu consumes input first.
The actual inputs are fairly simple for the game, so this is managable
Yea it's not to bad when you're inputs are fairly straight forward. It's why I like using ICM's as you can remove an entire input set with ease to stop conflicts. Just annoying IA's don't trigger when in UI only mode lol.
My setup above only really works for simple IA that would use the bool for the action value but its still better than nothing haha.
GameplayTags are Names, mostly. Which compare as integers and save as strings.. Technically everything saves as a string, but still. GameplayTag compare is essentially nearly as fast as an integer compare. They're super quick.
using this as my tv in main level all working fine however trying to also use video within a widget basically when you open the widget by pressing p in game once you navigate to the video it is playing i tryed the same code as above using the other media but it is just frozen any tips would be good
also i use begin play in main level bp for this but within the widget im using event construct?
Do you pause the game when you open the widget?
no its part of a phone hand held in game
I want to ask if someone has a finished MP Shooter game with weapon attachments. Im not sure about the best practices where to actually handle the attachment, if each attachment should be its own BP, or if i should have a BP Attachment_Manager which just swaps the mesh inside, or just do all the logic inside the First Person Character BP and swap it there, but change the firing logic. Im asking because i want a good modularity but also the best performance at runtime.
Awesome, cheers man. If I have any questions with this in the future is it alright if I ping you?
Good afternoon all! I've just joined the discord club! I'm hoping someone could help me as there doesn't seem to be much content I could fine regarding this - I've made a blueprint which automates rendering objects in different materials based off of an excel list. I've got it all to work however oddly I can only play the level once and I get an error on the second time. Only a engine close / re-open will solve it.
The error is - "LogScript: Error: Script Msg: AllocateJob cannot be called while rendering!
LogScript: Error: Script call stack:
/Game/CORE/BP_ImageManager.BP_ImageManager_C.Render&Save <---
/Game/CORE/BP_ImageManager.BP_ImageManager_C.ExecuteUbergraph_BP_ImageManager
LogScript: Warning: Accessed None trying to read property CallFunc_AllocateJob_ReturnValue"
the Customevent that runs the final steps of the BP is in the screenshot, I copied it exactly like the UE5 docs say, plus a little extra to name the output the way I wanted. I thought prehaps the allocate / render job nodes arn't clearing but apprently both clear before starting again.. Any ideas? -
Go for it. 😄 I'll usually always answer pings, I tend to ignore PMs by default.
I must be stupid, but I don't understand... This is so simple and yet not logical?
In the Player Controller when the player is spawned (on Begin Play) I cast to Get Player State and set RTS Player State so I can use it later, right?
Then inside Player Controller I have logic that handles Producing Unit. This get's called from the widget, after clickin on button.
And when I use Interface it works? It takes all the money needed, produces unit etc...? And If I use Reference and get events straight, it doesn't work? What I'm missing? How can the logic work when it's interface and not work when it's casted ad send? Does anything change durin gameplay that the own playercontroller cannot get the same reference to his own Player State?
this is button if it changes anything
AllocateJob cannot be called while rendering!
This seems to imply that something is still trying to render in the pipeline. Are there any calls for stopping it that you could put at the start of this?
I read through a bit more. There is a...
GetActiveExecutor() that is BP callable. If you get that I think you can call CancelAllJobs?
I can't speak for why it would become invalid. That's rare since a playerstate and playercontroller's lifetime are usually pretty similar. Honestly, reference saving like this is a bad habit unless you need to iterate a big list and don't want to IsValid it 100,000 times. You should just GetPlayerState and cast it when you need it. Or make a getter that does that. Reference caching is.. eh.
Hey Authaer, thankyou for the reply, I tried this and I still get the error, could it be a bug?
Honestly I'm not sure. New area for me. I'm unsure if cancelling these would be blocking. So I'm not sure if there might be a wait time between cancel and when it's available. But the general reasoning of the error is because the previous job is still "rendering".
Okay, this is the advice I needed. I didn't know it wasn't perfect idea to store references after casting (maybe at least in case of PC and PS). After casting straight to it, it works so it's a big relief for me... . I also get that Player Controller is beeing spawned almost together with Player State so I wonder what is the best way to avoid problems. Thank you.
I found out that this GET PLAYER STATE on Begin Play works only on the hosting server, and then it doesn't actually fires for other clients lol. That's even more weird. If I can get away trough it by using interface or just casting then it doesn't matter. I was worried that since sending event on saved reference didnt work, and then I'm using ''hack''(interface) to work around it, it's randomly working in a correct way. But I hope it seems like it will keep the proper logic so this logic comunicates to the Player State of The Player Controller (0) that the local client is firing.
Good afternoon, can you help me why the node returns local coordinates to me?
The reference caching started for the same reason as the casting is bad stuff. People hear "casting is performance heavy". So they cache a variable after casting it. Which to someone who understands casting is downright hilarious because runtime cost of casting is dirt cheap. Casting performance issues that people blame it for don't actually have anything to do with casting itself, but linkers.
On top of this, caching pointers causes issues and a lot of upkeep. EG UI Engineer here. I use a cached pointer to do some stuff in a widget. Gameplay programmer comes along and sets a cached playerstate in a pawn. Along comes gameplay and the pawn is unpossessed. But the UI is still telling the player they own that pawn, cause the unpossess never flushed that cache. And sure you can make more engineering to manage this stuff. But then it's just one more thing to maintain. Meanwhile the real state is already maintained for you via the underlying gameplay code and a simple cast is all it takes to access the real data. So caching a lot of stuff you'd cast to is usually just piling on a lot more work.
Unsure, but there is also a GetLocationAtSplinePoint
That's really good to know. I'm slowly letting myself throw casting here and here. I'f im literally not loading a boss from 54lvl in 1 tutorial level, seems like casting ito trigger event somewhere is almost the same as using the interface to trigger event. Thank you so much!
i got x and y floats, how do i convert them to vector pin?
Make Vector
thanks!
Just found this little gem of a comment lol. 'This is not the property you're looking for.'
Its on the common button base for creating a persistant binding. (for those that want to know)
Ita begging to be used.
Lol, yeah. Don't. When it says persistent, it means it. I had to use that in the 4.27 version on our game, and maintaining it is 🤮 Newer versions don't require it at all, really.
I probably asked about this but when you use structure files inside Unreal, and break them - is it possible to also "Set the values"?
or Structure values are strictly set inside the blueprint themselves and cannot be modified during runtime?
Make struct.
You can use 'Set Member'.
Wouldn't it be better to split this struct into 2 categories so you don't have so much every time you try to acces 1 -3 values in common?
how would I do that?
also I was wondering if it was possible to somehow avoid converting the Hit Actor to specific actor by casting.. what are some alternatives for this? like, I want to get a specific enemy parent class but I also dont want to do casting
is there some native node which does it for you? loops and casting/interfaces are something I think would be heavy for doing every second or millisecond. correct me if im wrong
You're wrong
The cast is basically free
What do you want to do to Hit Actor?
Create 2 structs inside 1 struct 😄
As long as the parent class you're referring to doesn't have heavy assets such as skeletal meshs, materials sounds etc... you'll be fine.
Unless you'd defining the structures in C++ I would advise against it. Nested BP structures is recipe for disaster.
Or as long as it'll be loaded in memory anyway
Is there a built-in function for a random 2D unit vector?
you could just make two random numbers and then make the 2d vector?
For a melee system that can accommodate multiple weapons, does it generally make more sense to run sphere traces for collision from the player BP or the weapon actor BP? For the weapon actor I would just start and end the traces based on montage notifies and then feed those attack events as interface messages
I have all my montages working and I have a damage system working I am just wondering how to bridge the two at this point
Is it possible to set the curve variables in a timeline programmatically?
or am I not using timelines correctly if I need to do this
I am trying to move my camera from A -> B as my world changes, but I figure I need to be able to feed the timeline the current position as well as the ending position in order to do so, but can't seem to see a way to do that
Personally I would handle it in the weapon. This would allow you more flexibility for each weapon.
I did basically exactly this for a university project. The player handled all the animation, the actual damage dealing was setup in a weapon class (overlaps, actor checks, apply damage etc), and all I had to do was change meshes and damage values for children
Thanks... that was what I was thinking. Each possible attack has a corresponding interface message (ie; LightComboAttack1, JumpAttack, etc) and then that gets passed to the sword itself which runs a trace for the duration of the notify, thus the size of the traces and the damage info (type, amount, etc) can all be done weapon-side. Just making sure this is a reasonable solution?
I didn't bother with interfaces to be honest. On BeginPlay, I saved a reference to the owning actor as a variable.
Then used BeginOverlap to check if it hit an actor that wasn't the owner, and if the owner was attacking. Doing all the damage calculations if true.
I think I used DoOnce as well to ensure each actor only got damaged once per attack, and then reset once the montage ended
What were the interfaces implemented on for the possible attacks?
On the player and the weapon. So during the notify on the player's animation montage I was going to make an interface message for the appropriate attack, then have an event on the sword blueprint that starts a trace, damage, etc when that message is received
But I'm open if there is a better way to do it!
Assuming you're using a weapon base class, you shouldn't need to use interfaces if you have a ref to the weapon. You could just have a single function on the base class and pass a gameplay tag to denote the type of attach the weapon is being used for.
That sounds much cleaner, I'll look into that. Thanks!
You want to look at physics handles.
Anyone knows why trying to project an actor location to screen space gives (0.0, 0.0) coordinates?
The actor shown in the video is almost in the middle of the screen, however, it gives me the top left screen position.
I chained Set Alignment in Viewport and Set Position in Viewport so that both results show up.
Ok found it I am stupid
Hi all! I'm trying to get a plane to follow infront of the players view (camera). I'm getting the camera manager, and it's loc+rot. It seems almost accurate but slightly delayed (camera lag?).
I switch cameras quite a lot so camera manager was my go-to. Anyone run in to something similar? On 5.3 atm
Guys how can i "force" a blueprint to "reload"? I have a bp child of a cpp class, i modified the class but the blueprint seems not affected. To test if something was wrong i made another bp child and it works, so i was wondering, is there anything im missing about cpp/bp hineritance?
What kind of adjustments did you make to the cpp class? Redirections might have not been setup properly. Is the parent class of original BP still your C++ class, unreal might have swapped.
My cpp class was just character, did not add a single line, then immediately create the bp, where i added skeletal + anim bp + simple movement logic. Then i implemented fw/bw movement and the bp does not detect it. As i said, i created another child bp to test it and it does work, so i assume its a bug. I also searched online and a lotta of people had the same issue so i assume its a very generic and common bug. For now, i have no need, ill just make a new bp who cares. I was just wondering tho, is there any "official" or "best chance" way of fixing this? Cause i tried a lot of suggestions none helped. Regardless, thanks for the help mate 👍
Sorry trying to make my widget show up in the editor what do I add for world context I cant seem to find the answer ?
It sucks when the issue is an unreal “mannerism”.
Did you hot-reload when doing these changes?
Or did you properly close the editor, compile your code, and start the editor again?
Just a follow-up question, since tags are new to me and not used in my project at this point. I did some reading on them and see them as a way to set states such as stunned, etc for actors. How would I bridge the attack montages on my character BP to the damage traces on my weapon actor BP using tags? Like I mentioned previously the plan was just to use interface messages for each type of attack, but that makes for a bit of a cluttered set of interface functions (15 or 20 for all the attacks), so I'm open to learning new systems if there is an advantage to tags
Guys, Is there any way to make and object in unreal to be rendered on a foreground? Like in shooters no matter how close you are to the wall the weapon will always be rendered on the top layer.
UE doesn't have a layer in between.
There might be some solutions on the net, but there is no magical "render this between the HUD and the world" layer/button.
damn, thats sad
I have a platformer here. But my character has bad intersections with the platforms. I want it to be ALWAYS on top of the platforms and pickups should be always on top of the character
I mean, that's something where you can just change the X or Y value (whatever your depth axis is).
hmm... I thought it may be possible to solve it with custom stencil in post process material. It makes masks but i cant make it to bring one object in front of another one
If you want it always on top of the platform, just change the depth axis value for your player
In 2D it shouldn't need much more
is there a way to functionally disable and hide all the children of an actor?
Does anyone have any idea why this timer doesn't actually call the function? It gets to the set timer so i'm a little stumped. (it doesn't get retriggered either)
Hm, is whatever this is in maybe not ticking or something like that?
Define "all children of an actor"
It's in a widget. 🤔
Does the Widget have a Tick node in it
Just wondering, don't even know if this was an issue
Im not using tick no.
All though it does seem that breakpoints have now broken. 😭 Time for an editor restart i think.
The only thing I very vaguely remember is that there was something with Widgets not ticking if they don't have a Tick event in them, even if not used.
I'm not entirely sure if that would affect timers
Cause the TimerManager sits on something else
Looping checkbox maybe?
I'm not sure, I ended up doing what I wanted a different way now anyways.
Hello all
I'm prototyping to decide if I will make my game with UE and I hit an issue that prevents me to go forward
Is this the rigth place to ask (it might be C++ related but I suspect it's a blueprint thing)?
or just #ue5-general
ok I'll ask there then thanks!
Apparently my is valid check is failing because the actor is not valid???
when i had similiar, it turned out i was in fact still using the invalid actor as input to a pin
Nothing should come after Destroy Actor
Show your code
Does anyone know if I send variable in Spawn Actor, will it be avaliable in construction script already?
Not sure about construction script, begin play, yes.
Thank you !
When you c lick on the link that says branch what does it show ?
Unless this NPCShooterMannequin thing is an element inside the SpawnedEffects array -for some reason, that is not at all the right code screenshot
Are you able to show where you have "TargetActor" plugged into an IsValid? node.
That validated get looks a bit off to me, what is it getting?
Either way there’s no branch in this screenshot 😀
a for loop in a timeline -> 
There’s nothing wrong with that ?
The branch being referenced is within the IsValid macro itself. You're right in that the code they've shown isn't related to the error being thrown as there's no reference to TargetActor going into an IsValid which contains the branch that is throwing the error.
Accessed None always means that the variable you are using doesn't have a value set in it when you're trying to use it.
I've been using switch statements for some of my key presses, like 1-9 and having it on a single enhance input map or whatever. but I assume thats not good to do because then remapping your keys would not be possible?
Is there a way to add an actor to an array that isn't spawned in? I'm trying to just send a reference of a weapon class to an array but it will only add them if those weapons are currently in the world using get actor of class. My variable with the reference of the weapon down below both of the get actors of class keep returning nothing.
Object variables are something that exists in the world
You could use class instead I suppose depending on wyd
i did
this is the type of thing i would personally do in a c++ function
its a reference to a main actor, I thought you could store then in an array if they aren't currently spawn in. when the actor of class is used it works, when the variable is used is does not
well good thing im in the blueprints forum
yea.
Oh interesting. But then I wonder if it’s the validated get that’s doing it, since there’s a target actor coming out of it?
It would kind of defeat the purpose of the validated get but yeah 😅
No the validated get should be stopping any execution beyond itself.
It's likely going invalid later on down the line or in some other place but they're still accessing it in some way.
Wait are you guys still talking about the guy with an error about invalid actor from like 9am this morning, 15hrs ago?
The main actor shown, BP_Container, is spawned in the world with its variable Pistol set to Replicated Weapon Pistol. Is something just bugged, can I not just add an unspawned bp actor reference to an array?
Where/when you set pistol var?
not show, its set to the same thing as get actor of class, so technically Replicated Weapon Pistol
oh i see my problem I think... can I use spawnactor and then just use that for my array but not have the actual object spawn?
Well spawn actor would spawn it
No, this person posted just a few hours ago.
No. In order to store a reference to an actor, that actor must be spawned.
As funkyspunky pointed out, if you wanted to have a reference to something that doesn't exist yet in the world, you'd need to use an asset reference of some kind, like the class, or a data asset reference, or even an ID like an FName or GameplayTag that you can then use to determine what the actual thing is that value is representing.
got it thank you
Does SetFocus not work when the controlled object is a pawn
Is there a command that checks if a component been hit by a line trace?
Like on the receiver side
Im kinda new so i could be wrong but you could set up an event dispatcher, and use the hit actor to reference the specific target thats been hit, its not really on the receiver side but it informs the reciever to start an event in that scenario. Hopefully that helps
There isn't the possibility to do that directly, but it's easy accomplish.
A common way to approach this problem is to create an interface (something like TraceReceiverInterface), with a function "OnTraceHit(Sender)". The actor that wants to detect the hit implements the interface, and put whatever code you want to execute when it gets hit into the implementation of the OnTraceHit function. The actor that performes the actual line trace then has to make sure that it executes that OnTraceHit function on the actor that is hit by the line trace, using the "message" node provided by the interface.
Of course, the names I suggested are very generic. You could give them better names with the knowledge of what your trace actually does.
So for context, I am trying to make a damage indicator like half life
As in you want to detect the direction of the trace?
Correct
Just send the ray origin along with the OnTraceHit function in that case, I'd say.
Hi,
Does anyone here have experience with AnimNotifies not beeing reliable on low framerates/ when you get a lag spike?
It seems like they sometimes dont trigger at all, even when set to branching point.
Im programming a hitbox system at the moment and im not sure if notifies are actually the way to go or if the hitboxes should be animation independent.
Some insight would be great 😄
I guess theoretically you could send the entire hit result along, although that might be a waste.
So I'm not at my PC rn, but can I just call "OnTracehit" in a blueprint?
Yes, if you've declared it in an interface, a blueprint "message" node will be provided automatically.
It would looks something like this.
But I was also thinking like cant I just have 4 box collisions around the player, and when they get hit with a trace, set "front damage true"
Sure, but a bit of vector math will give you the same result without the need for that.
That's what I was also thinking
That's what I was doing originally but could not quite get it
Just figure out the direction of the ray by doing (ActorLocation - RayOrigin) and convert it to screenspace coordinates... somehow, haha -- there are a lot of helper functions for stuff like that I believe.
You can probably get help with that part in #game-math
So Ray origin is what I should look at?
Haven't messed with those
This will be good
Yeah, you'll figure it out!
Yeah it's been bugging me for a solid week LMAO
It seems like a pretty good exercise to get some insight in vector maths, too :)
Stuff like this comes in handy all the time
Yeah I can think of a few uses actually
Feel like that could be useful for first person platforming
no doubt
Gotta finish this one first.
Hey yall, having interesting collission problems. imported a few meshes. First building interaction works fine, path finding/navmeshes work. Second building acts weird.
What's more interesting I manually added collission box to the second one because before it just went through it (kind of makes sense because no collission) but what I don't get is why the first building works out of the box with no collission set. Interestingly, they're from the same set
In the editor press 'P' to show the nav mesh. You should get a green overlay.
Yep I know
Show how it looks. 🙂
first building seems to have something fancy
Is the nav mesh dynamic? if not, have you rebuilt navigation?
new being the second one?
second building?
Normally I see nav mesh rebuilding whenever it needs to automatically
You have to manually set the nav mesh to dynamic so if you're not sure, try to rebuild navigation.
is it possible to set a varaible for a bool holder?
I'm not sure what you mean.
like for instance this setboolhere
i want a child component to set "that bool" to another bool
like this i want my "Can ast firebll" to replace the "SetboolHere"
and im not after updating it each frame
Use a getter function that returns a bool and then have the child override the function. They can then return their own bool if needed.
@dark drumah ty that worked
Thanks, it worked. Second question. You see the stairs have carved out nav mesh path but the pawn refuses to go there still.
I remember once it did but I must have messed something up
maybe added manual collission in the mesh then removed it
If there's a slopped bit of collision for the stairs it'll most likely be the max walkable slope setting on the nav mesh.
The slope angle is 0, I would imagine this would need to be between 30-45.
Yeah, can't make it work. I deleted and reimported meshes again from scratch as they came from the store. They have no collissions set on the mesh, yet the nav meshes show this:
Where does that come from?
Actually, that's a lie.
They might be set to use complex collision (per poly) as simple.
I do see "Remove Collission" button not disabled. So means something is there but I can't visually tell
You have to show collision in the mesh editor to see it.
Yep, something is there
but where does that slope nav mesh come in? how is it encoded?
didn't work btw
Hey friends 🖐️ I have a very strange bug : I added some Sci-Fi Interior Modular Pack in my project, and when I add more than 5 meshes to my project, Unreal doesn't load my BP_ThirdPersonCharacter, it is like the pawn is not charged at all ?! Is it a problem of memory ? How can I fix this ? The demo scene in the pack, with a lot of meshes works perfectly on my computer. I don't understand what happen and I can't find info on that online
Thanks 🙏
I mean it's good to know but that's not the reason why I'm obssessed understanding this lol. I need to know this because at some point I want my pawn to be able to come right up to the door and "enter" the building
Just make sure you're not using "Use Complex as Simple".
It's very very heavy on performance.
Have you checked the game mode override settings in whichever level is having the issue?
Or does everything work absolutely fine until you place the sixth mesh?
The Game Mode is good, and everything work absolutely fine until I place the sixth mesh, it works with 5 but not 6
it is on by default. What do I choose insteaD?
Project default usually
completely messed then though. Can't access the stairs
Yes, the green outline in the mesh viewer shows your simple collision mesh.
That's very weird. So what happens with the sixth? Does the player character revert to the plain floaty camera view?
The blueish white one shows the complex mesh, which shouldn't be used.
Don't even feel tempted to use it as a stopgap in this case -- you'll lose several milliseconds if you place a couple of those buildings.
yeah it is like the character pawn is not charged at all and a strange camera view underground
Okay
But did you make a custom collision mesh in your 3D utility?
Have you tried it in a fresh level/ project?
So my question is, how do I configure the collission/nav mesh for my pawn to be able to go upstairs, don't think I can manually draw the collission to allow for it?
Those meshes are from store
Is it common to collapse even 1 node to macro to make it look clean?
You could add your own simple collision boxes in the Unreal editor. Big cube for the building, one more rotated for the stairs
Oh, well...
Yeah, it's possible to define your own shapes using Collision -> Add Box Collision, and copy it around a bunch...
I'm happy to do that
Yeah sure but
Or there's the auto-convex tool where you can play around with settings to get a balance of accuracy and geometry
Does anyone know the process of creating a grid based city builder? Youtube doesnt have much on that...
It's not very flexible, or are you saying draw that box collission to the foundations and add mini planks on the side of the stairs to make them accessible or something
Personal preference in that instance
Yeah it will suck to do it that way.
You can select the cube outline and move/scale/rotate it like any mesh
You have to alter the settings (usually a window in the bottom right)
Auto convex will probably not hack it.
It's more for generating tight bounds around semi-convex shapes like boulders.
But you can try I suppose.
You're probably right but it's always worth a shot
It's generating something but when I click build paths after saving it, the nav mesh remains unchanged
Personally I'd just use the simple collision shapes, a bit tedious to put together but very low collision geometry and it likely won't have to be perfect anyway
still like this
That is what I'm leaning towards to anyway
Just trying to understand or learn how to add a second box which you can move around etc
Make sure you click Collision > remove collision to get rid of any existing collision geo that Unreal auto-created on import. Then you can just go Collision > Add [whichever shape you like]
There should be
If you click the green outline, it should turn a brighter green and get the normal gizmos. Try pressing W/E/R keys
Hey guys how can I Set Active the Widget using Blueprint? Because I don't find it 🙈
Everyone starts somewhere 
I don't think you can in Blueprints. Why not hide it?
It's super strange it even works when I put my BP_ThirdPersonCharacter directly in the maps of the Pack which is loaded by meshes and polygons
But when I tried on fresh level, I had the same problem
That's... odd? I know it's a pain but checking in a fresh project is probably worth a shot too
I want to control the set active of the widget UI, so yes I want it disappear
You could just use Set Visibility instead
@cerulean igloo by holding Alt and dragging a collision primitive you can duplicate it in that axis
It saves a lot of time
Ok thanks✨
Can press Ctrl+D as well but that usually offsets it a little, holding Alt is smother
Not sure if you've fixed. I haven't read too far down. But try moving your player start somewhere else.
It is not fixed, I moved it didn't change
I doubt it is a memory problem as I can put it in the example maps of the pack. Or maybe it is a parameter they checked at World/level details?
The view you described is as if your pawn was not spawned. And adding a mesh can mess with collisions of spawning.
Literally copied the set up and dragged it to the other side but after rebuilding paths, left box just doesn't get incorporated into the nav mesh
Try putting the collision shapes through the "ground" a little
It doesn't have collisions.
There is no green box around the stairs. So they cannot generate navigation on top of it.
You'll also need to add a box for the stairs slope
do the greenboxes have to touch
No
Yep, that's job number 2
I generally overlap mine a little just to make sure nothing slips through but there's no requirement to have them touch
Weeeird
Try making them a little T H I C C E R
Odd that it only works for one though
Something is up
I just removed the not working one and moved the working one (right) to the left
Oh in fact, try raising the building then hit the End key to snap to the ground again. That might rebuild the nav
this remained unchanged
Where is the collision for the stairs?
bingo
that's job number 2
I'm still on job number 1
The guy still refuses to go on stairs though..
It might be the lip of the box on the bottom stair, try extending it so the ramp would go through the ground
Aren't collisions fun? 🥲
Check your character's CharacterMovement component for this value
Make sure it's somewhere around 45
Try bumping it up to like 80 and see if it works
The stairs angle might be steeper than 45
Also, so annoying, it's not precise it's like the guy is afraid walking next to the building. the blue (p) nav mesh plane does nto correspond to where he can walk..
very inaccurate
Ah! Looks like the collision boxes are blocking your trace for where the character should move. Like if you were clicking on a solid cube
my trace channel is a special one though, not "visibility" so I'm not surprised..
Hm, guys... I turned off collision and set all collision responce channels on Capsule Component to ignore, but still for some reason "Sphere Trace By Channel" register a hit when it go through this Capsule Component. Can someone tell me please why this happens? Is there some hidden channel which used by Capsule Component collision?
Visibility would get the correct location in this instance though I think because the collision boxes wouldn't block that channel. Sounds like you may need to look into adapting your point selection code
Have you done the same for the Skeletal Mesh?
Any meshes will have their own collision properties as well
Looks ok?
Yeah, so your collision boxes will be blocking the cursor trace, and the character can't move into middair so they won't move... I think. The railing boxes are what I'm concerned about
Yes, on mesh I turned it off too.
Wait, maybe I just turn it on manually when game start. Going to check.
And what's the code for your sphere trace?
In theory my sphere trace just use Visibility channel. I gues it should.
Try adding a DebugSphere node to the code that finds the move location to visualise what might be happening
There is nothing wrong with my event graph for this mannequin. Maybe there is some Map settings which may force Capsule component channels always be turned ON no matter what I set in blueprint? This sounds crazy, but I have no idea what else it could be.
Hey I find a solution, super strange but I just needed to move the meshes a bit up. I think there was a spawning problem that causes to not spawn the player pawn properly
Glad you got it fixed!
Okay, so it's just invalid if you click the stairs at all...
Is the whole building mesh setup to allow the cursor clicks?
Type "collision" in the search bar and it'll be under "Collision Presets". Expand that and you can see the trace responses
Looks about right. And no spheres appear if you click anywhere on the building? Which means that something in your code's checks for if it's a valid location needs looking at I presume
Try printing the hit result actor or component
like this yeah
clicking on building on stairs, doesn't print
I think it's because of PCG component. I had trouble with it before
with visibility
I generate buildings with PCG
But with blockall, it gets in the way and I can't even select my char/pawn then
What about just blocking the cursor?
(I don't really know the PCG system so help is going to be limited there 😬 )
I think it just acts as any other "layer" that is placed on the nav mesh
it does intervene with clicks and visibility and such
on the PCG collissions?
If I do that I'm unable to select my char then
If the character is behind a building or even if it's in the open?
even if it's in the open
the pcg plane because almost on top of it. I had a big issue before it where I couldn't understand why I couldn't select it
turns out my mouse was hitting the PCG component as a hit actor
all the time
so I had to adjust those settings
Could you add a custom collision response for PCG so you can ignore it elsewhere in your code?
I think it's ignored already with those current settings
as you can see here my clicks end up on Landscape
so maybe that PCG isn't the problem
ah, no
I adjust adjusted the print out statement to do a bit earlier
PCG is the problem..
🥲
Wait, so it is registering the building there?
FOUND IT!!! My Health Bar Widget is the reason of why Sphere Trace still registered hits 😂
It is registereting PCG component upon which many buildings are generated
Ah okay, but not that particular instance...
@cerulean igloo What happens if you plug in Hit Component instead of Actor?
Hopefully that'll return the instance
Okay, nice, that's a start
Just wanted to make sure, but if I set member in struct, and I read variable from the same ''node'' of struct, will it read already updated variable or should I break struct and take the variable again ?
Would you mind popping in the whole section where you're tracing and drawing the debug spheres?
Looks like it should be reading the updated data
Thanks ❤️
Oh wait, wouldn't you want it to read from the output of the subtraction node?
What object type is the PCG layer? (World Dynamic/ Static etc)
Yeah, so it doesn't look like the sphere overlap will pickup anything that's in the PCG. Hopefully just adding that to the array will fix it?
That is what I'm wondering, if the ''base'' struct will be also changed, like it will be in other places for sure, but not sure if it will read the old amount if it's from the same node that Im changing. I will test it, but I think it should still read new amount.
If you're wanting to read the updated value, you would have to read the same value you're setting from (i.e. the subtraction node), or break the struct again after it's been updated
Oh nice. Weird but nice 😅
gorg!
Hey guys, is there a way to utilise a second uv channel on a mesh for a material? IE I use UVW ID 1 for a brick texture, but I want to use uvw id 2 for a stone texture, the reason for this is because when I use brick, it has a solider course also, with stone, it does not so I would like stone to replace both materials. ideally this will prevent me from having to have two meshes.
Stone applied when using uv's set up for brick -
And when I add a second UVW for stone -
Sorry if I'm not quite following, but why not have two different materials that you can swap between?
The Mesh effectivly has three Material IDS, one for Brick, one for brick mortar (for around solider courses) and one for solider course. this is the three I want to ideally replace with a stone material, however in the first example the UV'S are set up for a brick texture not stone. when I blanket apply a stone material to these 3 elements it won't map properly.
Sounds like you'd need to re-UV the object or create a texture specifically for that asset that uses tri-planar projection instead of UV projection
I had set a UVW in 3dsmax on channel 2 for stone, I was hoping I could utilise this in unreal? UVW Channel 1 is for brick, if I could just tell unreal to change the uv chanel to use the texture would ppear correct
It'll be the new amount. Pure nodes (nodes without execution pins) don't cache their results and are re-executed when they're called upon again. So it's functionally the same as breaking the struct and grabbing the variable again
Thank you
Thanks bro!
I also PCGed a bunch of trees but what I don't understand is what they go up and down so weirdly. it's almost as if some sway effect is going wrong
Is there a grass effect in their materials?
It'll be attached to WorldPositionOffset
Don't see such an object in Outliner
This is one of the mesh's settings
It will be in the material attached to the mesh
Yep, now open each of the two materials
same in the other one
i was being a plonker just needed to change the coordinate index, terminology issues 😄
Now open up the parent
It'll be in the actual material node
Okay, so if you unplug that from the WorldPositionOffset pin for the material attribute, it should stop the weirdness
Yeah it stopped
I liked the animation wind slight movement etc. but it was going crazy
Not sure why it was going so crazy but there's probably some variables in that parent material you can play with if you really want
Is there any bug with assigning tags at runtime from data assets? My ''Workers'' are getting ''Fighter'' tag that is in other Data Asset xD
I have a seed that increments every x server seconds, and when it does it sets any random streams that use that seed. i'm thinking how is best to structure that, like where to store it etc.
Okay I moved settings tags from Construction Script to Begin Play and it works, lel.
probably using an event dispatcher in the game state?
i dont like having to cast to game state for it though
the game state should probably be spawning the thing that needs it anyway rather than just having it in the level hmm
hey i have this big map based on the backrooms, and i wanna have it to where the lights turn off when not in view of the camera to help with performance, the lights are a blueprint with a plane that has an emissive texture, a rect light, and a spotlight. how would i do that with blueprints?
Game State is already loaded in the game so if you cast to it, it doesn't change anything and it's free.
Play with these settings for your lights
Also make sure your texture's emissive isn't doing any real lighting, that's very expensive
yeah just me wanting everything to be neat
Question on finding doors of a building. If I tell a pawn to move to a particular building. How do I mark the door so it would stop there and not at some closest corner of the mesh?
how do i find that out?
is the door not a separate mesh
Probably create a parent blueprint for your buildings. Add a static mesh component for the base mesh, and a scene component that you can place where the door is.
Then when you're using the AI Move To, if it's something that is a child of the "Building Class BP" you can get the door scene location as the target
Just play around with the distances under "Performance". I think 0 means never culled, so any value will have an impact
i made the draw distance .5 and they all went invisable
what is a good draw distance?
i assume youd want to stop next to the door so youd want door location + forward vector * amount (assuming forward vector is pointing the right way) or * -amount
Yeah because you would have to be within 0.5 units to see them. Bump it up to about 5,000 to start and you should notice how it's working
This sounds exactly what I need. Atm, I have 3 different building meshes for testing but in the future, I was looking up PCG for individual building generation. Watched some videos, they're incredible, generating walls if you scale the building up or down, etc. This also means, that potentially the door could be spawned undeterministically though.
Max Draw Distance is the distance the camera has to be within for the light to be drawn. If the camera is beyond that distance, the light won't be shown
that also made them all just go away so a bigger number?
I guess so. Try setting it to a number and then moving the camera towards the light
If the door was able to be placed randomly as well, I presume it would be it's own mesh at that point, so you could grab the door mesh directly instead of a scene component
Good point.
i think my lights are just maybe too much? bc i have it up to 20000 and theyr having issues still im getting like 8 fps
Try it in a new scene with a standard light, just to get an idea for how it works. I'm trying it myself and these values work pretty reasonably for me with a basic point light
It's possibly something to do with them being in a blueprint for some reason
Rect lights are also very expensive. It may be worth experimenting with other types light spot lights
what would be a better way to make office lights then?
removing all the rect lights and leaving just the spotlights im now getting 26 fps
Your system and scalability options are also considerations
if its an office building, couldnt you more aggressively cull lights behind walls and only have 2-6 visible at a time?
yea i just havent gotten to the walls layouts yet
If you remove all the lights and leave just the emissive texture for lighting, how well lit is the scene?
i would suggest doing the wall layouts with that in mind
only the spots where the emissive texture is are lit
with that many lights that close you might as well use a single even lighting source for the whole room?
Okay, that looks like it could be turned down a little, just because it looks like it's doing some environment lighting as well (left side)
i was just trying to test how many i could get in a scene and to get theyr draw distance figured out
oooh that makes sense
You might be able to get away with a single directional light pointed straight down, and have your ceiling as a one-sided plane so the light still comes through
i think the way i did that once was to have a skylight and then make the ceiling mesh work on channel 1 rather than channel 0 lighting so it doesnt interact with the skylight
yea but i wanna be able to have some rooms with the lights turning on once the character enters a trigger, would i be able to do that still?
trying to get the performance up mainly bc im gonna be adding alot of plants to some of it and i didnt want it to completely freak out
You could have a blocking cube above those rooms, that disappears when the player enters
Maybe, I'm just spitballing
that makes sense lemme see what that looks like
the directional light is already showing through the ceiling
SO I created a BP_Building class, then I instantiated a child class from there called it BP_House or whatever and added static mesh of the specific building there. I'm thinking of adding some sort of a component X to the BP_Building (parent class) that the child class would have to position on the door mesh, is that the right thinking? If so, what is that component X type?
Scene, it's essentially a socket that has a transform
Yup, that should do it
Obviously, if some of your buildings have more doors, you'd need more scene components
Yep
So after creating a BP child class
I'm trying to use it in my PCG where before I just have a pool of meshes (houses) that PCG picks from to generate the map
I'm trying to replace that mesh with BP class but it looks like it just takes a static mesh
Component also no go:
Ah okay, so maybe that's a limitation of the system
Allows to select jsut one BP class though. So I'll try to get more nodes but also maybe it's possible to code something up in class where you load all static meshes and it picks one at random upon instatiation idk
Can you add the Out pin to an array or something?
Spawn actor node doesn't work unforch. It spawns at the same spot, doesn't randomize
if I connect 2
But I have an idea
PCG needs this class type:
Hm, okay another way 🙂 blueprint Q: how do I randomly execute one or the other "spawn actor" node here:
50/50
or randomly select rather, because there could be more
PCG blueprint doesn't have those nodes
which is why you should probably ask in #pcg-framework
Thanks Donny. With the help of pcg guys, figured it out. But I have a question about what you said here. If there are two doors. and you do add two scene components. How do you use them later?
Off the top of my head (so probably a bit of a scrappy method) , I would add three or four scenes for doors to the parent, all at 0,0,-1000 by default just so unused ones won't be nearby.
When checking for the AI move, get all scene component of the target, then a for each loop to get the nearest scene to where you clicked. See here: [#blueprint message]
I think that makes sense.
Any questions just give me a shout
I'll come back when I start implementing that path finding logic
well, the loop really.
sometimes these simple things really get frustrating. I can't move the door 2 for some reason.. Door1 scene was fine..
Strange. Tried closing and re-opening the blueprint?
Worked.. But concerning that essentially "turning it off and on" again fixes it..
Yeah, it seems to be happening a lot more often with newer versions of UE for some reason. I get a lot of times where I can't move, delete, or copy/paste nodes until I reopen the blueprint
I have a weird bug, my progress bar fill down to zero if I put some shear in the overlay parameter, I don't have any code which change the progress bar trigger (I check it), if the shear is at 0 I have no problem, what is happening ?
Does anyone know why the values are different if they came from the same object?
The first is probably the class default value, the second is likely what is returned from that particular actor
Actually it seems the Debugger is bugged idk, on the C++ side it's coming correctly
Got a question. I made it where when the crouch input action is triggered, it is plugged into a timeline that lowers your camera halfway down, and then when it's completed, it reverses, but since that is not altering the capsule, how do I hide under tables?
Or would it be better to have hiding places with their own cameras that when you press e, it switches to the hiding place camera and disables the player?
Are you using the crouch function that comes as standard in the character?
You could try switching on/off lag in the boom arm component when you un/crouch
huh
and I try that with the default crouch function right?
Also this is first person so there is no boom arm
I already tried that, however when I walk up to my enemy, it bounces him
Got a slightly annoying opacity going on with my decal. whenever pawn is moving it becomes more transparent and flickers.
I think it's to do with this but I'm not sure how to fix
is there an event for when you open a widget? is it OnFocus? contruct is not a solution for me since its called a bit too early
Alright, so after spending too much time doing C#, I feel myself suffering from .NET withdrawal. Is there a way to handle Arrays like lists in Unreal? Like, I'm making a volume for each rooms in a building. Issue is, some room are not cubes. So I have to use multiple cubes. I then take a list of all Smart objects within those cubes. Is there an easy solution to merge these arrays together? Potentially to look within them to find something of a particular type in one of these arrays?
i dont think there is a "merge" built in
your gonna have to "add" all the items from one array to another
but i am not 100% sure
I'm not going to lie, I'm 99% on team unreal engine. The only thing I miss is my sweet C#. Guess I'll have re-learn how to properly handle arrays I guess.
TArray::Append
To be honest I'm in blueprint. I was wondering if there were manipulation similar to .Net functions in blueprint. I probably poorly worded my question to begin with.
No matter, I'll figure it out. I believe I should eventually switch to a tag based search rather than area based one. Mark the areas that are part of a shop with the shop's tag and search for all areas with it. Then iterate over them. I was just making sure there wasn't something similar to these function simply cause I don't know what I don't know.
I apologize for the confusion
Completely missed the channel not going to lie. Yeah you'll have to loop through then
LE Blueprint Extended may add the functionality though
If you're familiar with C#, you should dip your toes into Unreal C++. The horrors of C++ are largely hidden from day to day use in Unreal's API
A lot of it is also modelled after .NET, so you'll feel fairly at home (stuff like treating structs as value types, and classes as reference types, or in this case, pointers.)
TArrays, for instance, in C++ land, are nearly identical to Lists, just without LINQ 🥲
I would also tell you about UnrealSharp, but you're already there :P
pointers... I'm getting flashbacks from schooldays.
Yep :p
but so far I am still in my learning phase, so I try to stay away from C++ or Unreal sharp until I truly find the limits of what the blueprint system can do. I will be honest, as far as high level programming language goes, this is absolutely amazing.
Despite my complaint about it, this is truly a marvel.
Your limits will be complexity and multiplayer. It's amazing for gameplay scripting, but a lot fo multiplayer things aren't exposed, and things like complex functions and maths, as well as heavy iterations (anything over 1k really), it will quickly slow down, and/or fill multiple monitors worth of screenspace :P
Blueprint is an amazing tool, but it's also designed to be used with C++, so I definitely reccomend approaching it at some point 🙂
Much like everything else, each have their pros and cons :P
A common usecase for C++ is just to expose things to editor.
For example, with some intermediate experience, you could make a node that appends two arrays together for use in blueprints :D
I think, for me at least, BP is the first visual scripting language I've seen that doesn't feel pointlessly dumbed down or childish.
Where in the lifecycle does the animation blueprint update? I have a value that is properly changed, but the visual state doesn't update. When revisiting the object, it properly animates, so it looks like right now that upon initial setting the ABP doesn't see it.
I already have. I completely remade the detection system for my current project. Instead of looking for the root of a character, I search for a particular nodes of the mesh. It also include checking if the onlooker is in front, behind or on the side (with angles defined. For each node)
So I could make it so a character is unrecognizable without seeing his face from the front with that system. Or that you could either recognize his face from the front, or a logo on his coat from the back. Or neither. And also change it at run time.
For a game with disguises and stuff I wanna make, I'm pretty happy with it.
Sounds awesome!
You might have a better time asking in #animation 🙂
Thanks
okay so im not 100% sure if this is blueprint related but i need help. So i copied my project from work to work on it at home a bit during the weekend and i opened it just now. And all of my blueprint procedural mesh actors just fall through the ground whenever i press play. Whats going on
that was not the case at work. No idea what suddenly changed
check your collision settings
was just checking that. Collisions were fine but for some reason on the cube blueprint the physics were disabled and made the object fall through the floor
very weird
back to the seamless portal blueprint i go then xD
Invalid Simulate Options: Body (NewBlueprint3.Cube Cube) is set to simulate physics but Collision Enabled is incompatible
turns out its now giving me this a couple of times
Your logic seem pretty flawed
Well im just assuming since you're not showing everything
Im lacking info
InDeltaTime, whats updating that?
event tick, its plugged into the delta time pin.
its the only way i could find to get the delta time
Can someone tell me if this is a dumb way to retrieve and set animation montages for my weapons? Is there a more efficient way to retrieve them per attack or is this OK? I have a data table with a few weapons that it retrieves the montages for on the equip event, so it's not checking too much stuff too often, just feels like a lot of variables to set. But I want each attack to be able to have its own trace timing and size, as well as damage and stagger power, etc, so each potential hit *should *be its own little event
Obviously all the nodes aren't connected yet but this is the gist of it
how often is get exhaustion bar percent firing?
It's a binding
So I believe every tick
so how often does it fire?
check that you have access to a delta time in widgets somehow
also where does that display exhaustion variable live?
is it a function variable or a widget one?
It's a local variable to the function
thats the problem
it gets nuked every time the function returns
it does not carry over
@broken badge 🙂
Finally got clicking working?
Ok, I switched it to be a variable on the widget instead of the function and it works.
Hello, how would I do the highlighted thing?
Right click empty space to start adding node, press B
yea I got the branch
these are the only ones I can get from pulling from SlotIndex
Hell yeah!
Looks like it needs the array or list as well
slotIndex being an integer,
they probably mean to validate the slotIndex in relation to the .. thing you're working with
inventory ? Stat?
so if it were an inventory, you'd want to grab the inventory array, and do the "IsValidIndex" node
this checks that the slot actually exist in the array
Hey Devs ! I've created a Blueprint Interface to send a message
Then I'm calling this interface from a Widget which looks like in the screenshot
Then I created a Interface event to receive that function call in another widget blueprint which is in the second screenshot.
However the function is called form second screen shot but it never gets called in the 3rd screenshot.
What is wrong ? Why the interface function is not getting called ?
I think the more important question here, is why do you need an interface? You're calling it on self. Just make a custom event.
That said. Breakpoint the nodes. Make sure the Branch is running true, etc.
In order to execute an interface on something, you need a reference to that thing to ask it to execute it. Calling an interface with "self" means you're trying to execute the interface on this object.
Situation is I want ot communicatedbetween 2 widgets without taking their references.
In screenshot 2 I want to call that interace from widget 1
In screenshot 3 I want to implement that interface as event to receive the information in widget 2
You can't communicate between two widgets without referencing them somehow.
How shall I call that interface function from widget 1 ?
Even with an interface, you still need to reference them, just not with a casted pointer.
You need a reference to widget 2 in widget 1 to call the interface on widget 2.
What is the relation of Widget2 to Widget1?
Because chances are you're probably looking for a delegate.
maybe use the HUD
widget 1 and 2 have no relation , but they need to share 1 information to other,
so instead of taking references and calling their functions, I wanted to solve this using Blueprint Interfaces,
I've added the interface in both the widgets and tried calling it from one and implementing in other to receive information , its not working ,
I'm kinda stuck
Interfaces can be very useful.
GetAllWidgetsWithInterface makes things easy
https://dev.epicgames.com/documentation/en-us/unreal-engine/BlueprintAPI/Widget/GetAllWidgetswithInterface?application_version=5.3
Get All Widgets with Interface
An interface is the last tool you should ever consider using to communicate. It should be the last resort when every other option is exhausted.
In many cases Interface has the advantage of decoupling things
are these made with hash maps?
It does not fix casting linkers.
okay
An interface has one singular purpose. To fix issues where you need to call a similar event on multiple classes which cannot share a base class or composition.
How would you recommend it ( messaging or calling functions ) be done, while maintaining decoupling - ( The two assets should not see each other in Reference Viewer )
I want to send information between 2 widgets without their references, here interfaces can be useful
Clean asset free parent classes with defined or composition if using classes like Actor in most cases. That said if you just want to throw data to the wind and let things catch it you should consider plugins like the GameplayMessageRouter from Lyra.
It's basically a global event dispatcher in a way. Anything can broadcast on a tag, anything can listen on a tag. Easy to send messages with data around.
Is it feasible to do that retroactively though, imagine I have some massive BP and suddenly I need some relevant linkup - is it possible even to make a parent for that after it has already been built up?
Good to know
You can slot a parent in anywhere. May require rework. But most cases you know where your class hierarchies are. And a lot of gameplay systems should prefer composition.
This is how I have been using them a bit now, if they are pretty much unrelated widgets needing some line of attack.
I don't really see the downside. Maybe it's a bit clunky with GetAll and generally assuming you have just one thing that wants that, so get 0
um new to unreal here and hopefully i am in the right chat, but i am having some trouble, i have an enemy character and a player character, below is the event graph i have for the enemy character, i want to make it that when the player character enters the sphere of the enemy character the enemy proceeds to move towards the players current location but it isn't working.