#blueprint
1 messages · Page 395 of 1
Is there any way to use the system console from a blueprint?
I'm nowhere near good enough to debug the information that the shipping build debugger can give you access to. I need a way to print out information from my code that isn't limited to the frame rate.
Are you wanting to run commands, or print out info?
Just to make sure which you want. 😛
Cuz, for printing info, theres a build config to enable print strings in shipping.
Or, you just don't build as a full shipping.
Can't build as anything other than shipping.
I was thinking "echo <thing I want>" but if I can get print strings in shipping, I'll take that. Where do I do that.
Oh.
Your not an engine build. (since you can only build shipping)
I don't think you get that luxury then?
See if you have a Source folder in your project root, with a .target.cs file.
I wanna say you won't cuz BP only?
Oh, then yeah.
You can change the .target.cs file you should have?
and, add bUseLoggingInShipping = true;
Also, when I say "can't build as anything other than shipping" I mean that it can but they don't work, not that Unreal will not allow me to do it.
Tried that, causes build errors.
Well, both of those things are odd.
But, thats all I got then.
If you have C++, then you can just make a new function that writes to the log.
More specifically, it tells me I need to add this BuildEnvironment = TargetBuildEnvironment.Unique;. And then when I add that, it tells me that I can't do that with an installed engine.
Oh, so yeah.
Non-source build getting you there
This is driving me insane.
Using a sample I found on Github, this is what I've managed to make. Now I'm just not really sure how to connect them?
But, since you have C++.
Just make a new static function to write to the log.
What log.
The games log.
It just barely ever uses it.
But, still has it.
Where would this be? I'm familiar with C++ but not terribly great with Unreal C++.
Where would what be?
The log.
It'd be in your saved folder.
But, given your shipping, like 99% of all logging is disabled so it likely to not even exist.
But, with a quick UE_LOG printing function you should be able to write to it.
then, you can view it in real-time, with -log in your games startup params
Hold up. Startup params. Where do I do those.
If your game exists on steam, then just in your games properties.
Else, you gotta make a .bat file, that runs your game's .exe file, then just add the startup params as normal text.
Get used to that feeling, it pretty much never goes away. 😂
You mean how to connect the main strike/spare logic from 1st image to the small logic bit right below it?
I made a C++ function that writes to a separate file and I've spent the last few hours waltzing around release builds trying to figure out where it's dying. Every guess I had ended up being wrong.
Guessing suck.
Or impossible sometime.
I figured mine by attaching debugger, dont think theres another alternative.
90% of my shipping bugs, I tend to find just following the crash line and the callstack that can call it.
Are you still crashing on that async loading thing?
Tried that, couldn't get anywhere with it.
Can you elaborate?
I don't speak assembly.
Neither do i
If you attach debugger with pdb , it will stop at the problematic code.
Is it still the same crash and have you tried a full rebuild if it is?
And also a call stack will be valuable informarion.
Then you probably didnt include pdb cuz it shouldnt be in one.
@maiden wadi is source build a must for attaching debugger or downloading symbol and including pdb suffice?
I don't think so. Not sure how well engine source will work with launcher engines with symbols. I've never tried it.
It's a full rebuild every time. The async thing was a barrier to solving the actual problem, not what I actually needed solved. It still happens, but I abandoned that route in favor of C++ print statements. I've found what I think is the exact node causing the problem at this point, but it's strangely not the node that it crashes at.
I was able to attach the debugger.
It stopped in a bunch of assembly.
And the whole stack was also assembly.
Again it only happend if you didnt follow all the step.
You need to download and include debug symbols.
One of the steps was probably one of the target settings.
I don't know what this means.
The build target setting
.Latest
I don't know. Which means probably not.
Yeah then impossible to dechiper hence you get assembly code
You can download it from the launcher.
Go to your engine thing here. Since yourse is installed it'll have a Modify
It'll open up an install settings, scroll down slightly and there should be an Editor Symbols thing or similar. Quite a few gigs of data.
I guess source one have already included it? I only use source build and can debug shipping succesfuly.
Can't do that today since I don't have admin on this computer, but I will definitely look into that.
Source builds them locally when you compile the engine.
Imo you dont have a lot of option. Just get it to work when you can.
Its one of the essential things.
The power of janky C++ logs has shown me that the thing causing the crash is that Stop Clock node, but that's NOT where it actually crashes. It crashes the tick after.
I look forward to never using this approach again, but it got me this far.
With debugger you will now what actually went wrong / invalid.
Assembly variant tells me it's a memory access violation. Can't wait to find out how the heck this could possibly cause a memory access violation.
Does unhooking that Stop function stop the crashing?
I checked every single array in this file before I got here because I didn't imagine this could possibly cause that.
Yup.
Can you show the code for that?
Builtin from the Harmonix plugin.
Yes
Wouldn't it be enough to just connect that to the flow after you decide that it's a strike/spare (both can have extra toss, right?)
Yeah they do, but I'm still not sold on my calculation. My main problem is calculating a score based on rolls that haven't happened yet and then totaling that score. How am I supposed to predict what the following rolls could be.
You don't need to calculate points in the future. I don't knwo bowling, but form a quick read I assume you are talking about the part where you get bonus points on the next throw after a strike.
Well, you add points that you get now. And mark a variable somewhere, that strike happened.
Each time you calculate points for a throw you look at the strike variable, and if it is true (which mean strike happend previously) you add more points and set the variable to false.
Or just keep track of every round and loop backwards through the previous rounds when you update the points after a strike etc
Previously I stored everything in a single structured array, it stores Rolls 1-3, if there's a third roll on frame 10, and the score at that frame. My only problem is it getting messy and difficult to track.
It should be an array of a struct (let's say a Frame struct). The struct would have: int Score, bStrike, bSpare, int array Rolls (representing a number of pins knocked with each roll). Let's say the array name is GameStats, I don't know how it is called in bowling lol.
When a frame starts, you create a new Frame struct in your CurrentFrame variable. After a roll you add a number to the Rolls array in the CurrentFrame. You add points or mark a strike etc.
Then you have a loop from last index of the GameStats. You check variables there against the CurrentFrame data and add points if necessary based on some comparisons.
At the end of the frame you add the CurrentFrame to the end of GameStats.
Hmmm... It is kinda hard to put it in words lol. Bowling scores are weird
Something like this?
If I destroy an actor does any timer handles set up on it get destroyed as well?
Is there a way to schedule a function to execute next tick in such a way that if it's called from multiple places, it only executes once?
SetTimerForNextTick node
That's what I'm using. It ain't doing that.
they try clear timer before setting it
How?
By name worked, thank you.
When you say multiple places, are these different actors/instances?
Yes.
I'd also love to know how to get actors to not spawn in the dang floor in a packaged build.
Yes, they are set to adjust position when they spawn.
Are the floors a plane?
No. They're a big ol' mesh.
Well, a detailed one at least.
It's not that large in terms of scale.
Works in-editor, spawns in floor when packaged.
What's the collision like on it? Sometimes it can adjust in the wrong direction so spawning a little higher can help.
I have the gravity disabled so I can see it's not pushing it enough to not be colliding.
The collision seems to just be a bunch of boxes on the floor.
This graph has 130+ nodes. Instead of tracing wires, the tool reconstructs the execution flow into clear logic so you can quickly understand Blueprints you didn’t write.
It also gives you structured output you can use for debugging, documentation, or even feeding into AI tools to analyze behavior faster.
What's the purpose of the tool? As in what problem does it solve?
It turns messy Blueprint graphs into clear, readable logic so that you can instantly understand and debug what’s going on without tracing wires and save debugging headaches and hours as the graph complexity increases.
I don't think that'll be the case but someone might find it useful once in a blue moon.
It’s mainly useful on larger graphs where tracing execution manually gets slow this just makes the flow easier to see quickly
I could see that being useful for people who find reading code easier than reading graphs. That is not me though. Plus, I wouldn't let a graph get that big and unreadable. There are lots of tools you can use to make your graphs easier to read. Functions, macros, collapsed graphs, comments, reroutes
Yea I'm the same. Although, it does make me wonder if it could be useful when querying AI. 🤔 Getting sudo flow they can paste in could be nice for some people.
Yes. Short, modular code definitely helps, you’re right. This tool is more for quickly debugging messy Blueprints and understanding the execution flow.
I wouldn't employ anyone that produces BP's like. 😅
Haha yeah😅 ideally you never get there, this is more for inherited or complex graphs where you don’t control the structure
You also need a better test case for the tool. That blueprint isn't unreadable. Find something that wraps back around on itself a few dozen times, and and makes excessive use of reroutes.
99% of that blueprint can be fixed with a Shift+W or whatever that hotkey is.
Curious what kind of Blueprint tooling would actually be useful in real workflows, anything you feel is missing right now? Do you have any suggestions? 🤔🤓
Good point, I’ll test it on more tangled or recursive graphs. Still a work in progress, noted that, the focus is understanding execution flow under complexity and making it more robust, clean and understandable.
For me I'd say a way of moving a function to c++ if it has a c++ parent.
Sometimes I'll make something in BP first and then make a C++ base class. The current workflow involves creating a new c++ function, overriding in BP and then copy the BP logic over and update any use cases to the new function.
That’s actually a really good point, moving BP logic into C++ cleanly is still pretty clunky right now. Definitely something worth exploring.
Just to clarify, I don't want to move the logic itself but just create the same function in c++ and have the BP version override the new function. (Logic intacted)
Gotcha! 😁👍
@maiden wadi from your experience, at what point do Blueprints or C++ workflows start needing extra tools, and where do things get painful?
A one click tool could simplify this workflow quite a bit, curious how many people actually run into this flowblocker regularly..🤔
Asking from a tools dev perspective, at what point does a Blueprint stop being manageable for you and start slowing you down?
I tend to not go more tgan 20 nodes.
Deff dont want to do core system in bp. It become spaghetti real quick.
Not saying you cant just i wouldnt do it my self.
There's actually a dev talk on this from...
NaughtyDog?
I think it was them. They have a dev thing that won't let them commit BPs that are too complicated.
Like, you actively have to break down your graphs into functions, clean your stuff up, etc and not use too many nodes or reroutes to be able to commit the BP to source.
Oh that’s interesting! Sounds like a graph complexity check or validation system before commit.
Feels like there could be value in analyzing execution flow and flagging when graphs start getting too dense, maybe suggesting how to break them into smaller pieces.
Pretty much, yeah. They had some neat scoring system for it. Trying to find it.
I think it has to do something with execution complexity like branching, nesting depth, loops, same logic across cases.
Also, I think node count alone probably isn't that meaningful unless it directly affects the flow complexity.
Aha! I found it. It was Hanger 13
It's well known that Blueprint visual scripting in Unreal Engine can get out of hand as a project evolves. The software industry has battled the same difficulties since the 80s so there are a couple of established scientific ways to measure and deal with code complexity.
Join Valentin Galea of Hangar 13 Games for a session that explores how Blu...
You know what's the best way to not make spaghetti? Just don't cook it up to begin with.
Sup everyone, could someone give me a guide or a pointer on why my notes don't close, and goes to un-pause when i press back or even a better way of setting it up would be great?
Does anyone know how to to get the correct Item Index when clicking an item in a CommonTileView? I can see the item in the array, but when its double clicked it uses the default value every time when using Get Index for Item
That's a detailed answer I don't think I can properly address. However, it is possible. In some coding languages it's straight forward, for Unreal Blue prints it can be done, but seems a little more complex.
Before I even start trying, does anyone have a simple way to rotate an image based on the players mouse (in ui)
I wanna rotate a dial based on the mouse
i made a simple radar for my space game in niagara. i am trying to set the alpha of the lines that connect the objects to the plane, but no matter what i do, they are rendered at 100% alpha. any ideas what might be going on here?
i can set color just fine, but alpha has no effect.
It would help if Unreal would add sharp-angled reroutes to the base capabilities of BPs.
I dont like those.
Just realized an annoying downside to Gameplay tags
Since its 1 whole var, it doesn't handle inheritance/ child edits like I thought.
Just don't use reroutes
reroutes are a smell IMO
I can't stand the offset of the sine waves connections. It irks me.
Not entirely sure wym. And what would be the equivalent data type that work for what you want to do?
I need help for a workaround for the delay node. At the start of the level, I want something to take place 0.2 seconds after it starts. Obviously, it caused issues using the delay node. But I need a work around for this, I just need something to take place very shortly after the level starts, but not exactly when it starts.
Use "Set Timer by Event", set it to 0.2s and not to loop
Then in the custom event that you pull off of it fire your thing
Whats the diff with just using delay at that point?
Not like you have a case there where you need to intefere and cancel the timer handle.
Perhaps desc what you want to actually do objectively.
There might be another point you can hook into.
Is the reference valid when closing?
For some stupid reason, I spawn a SpecCam_BP at the start of the map (which is exactly what you think it is) and then possess it. If I do it without waiting a couple of milliseconds, it does not work.
Thanks
It’s the fact that specifically the container, in the defaults tab.
If a child adds an entry, then the parent can never add a new entry via the inheritance chain, since the child is considered modified.
I had thought that because of how a container worked, it would keep the chain of gameplay tags working through inheritance.
Compared to something such as 40 bool vars.
Hook what ever you want to do on the OnPossess event.
Hey guys, I started a new top down project (5.6) and I am trying to switch that simple move to node for a node with a pin for the finished moving event.
I’m trying using “AI move to” using the player pawn, but it is not moving!
AI Move To requires an AI controller and wont work if a pawn is controlled with a player controller.
Any idea how I can check when the player pawn stop moving?
The simple move to doesn’t contain the pin
do you have navmesh setup?
for player it's probably Simple Move To or something like that.
You can spawn a blank actor, add a sphere collision (its radius would be like the acceptance radius), set its collision to only overlap the pawn and bind to the collisions overlap event. When this is triggered, check that what was overlapped is the player its for. if it is do your thing.
- mind explosion noises *
Worked like a charm!
Thanks for helping
Any tips on sorting by integer?
Depends what you want to sort. FOr a simple array of integers there is a built in function I think
currently, my camera rotates around 1) which is a single point. This is done via the controller input
how would I get my camera to rotate around 2), which is a full circle around the object?
this is the code as it exists
Can you explain this more? Because conceptually there's no difference between 1 and 2. They're both circles.
the first one isn't really a circle, it's a point
so it rotates around a point
but I basically want to maintain everything, but have the camera rotate aroudn the circle almost like a crane effect
Do you mean you want the camera to not focus on the player, but on his side? Like if you go to the left, camera is moved slightly to the left and not centered on the player?
Because I too struggle to see the point
The problem with the camera/spring arm rotating around a small point is it's kind of interfering with the object. So at 180 degrees, it's basically going through the front of the car
if it rotates around a wider circle, that problem should be eliminated
does that help?
Ah. I think it is handled mostly by doing collision checks and extending the arm when it is too close to the mesh
oh that would is disastarous
collision checks will make the camera jaggey and janky
a pre-defined circle of operation would be smoother
its a good suggestion though
I mean, it doesn't have to physically collide, I meant it more generally
ah i think i know what you mean
i guess i could try map range clamped in relation to how close the camera is to the center of the car
but ideally i'd love to know how the math behind just getting a larger circle rotation
You can try setting up a spline around your car and with camera horizontal movement you move the camera along the spline in +/- distance
good idea
https://www.youtube.com/watch?v=EM_HYqQdToE Is this tutorial still valid? I tried creating Blueprint Interface using this inside 4.27.2, but the door or static mesh doesn't seem to move at all.
Announce Post: https://forums.unrealengine.com/showthread.php?101051
This Training Stream takes a look at Blueprint Communication. We find that Unreal Developers of all levels can sometimes struggle through the concepts behind moving data between objects. So in this video we'll take a look at the different ways to make Blueprints talk to one an...
Yeah that tutorial is very much valid still. Try going through the interface part again slowly, you likely missed something, interfaces are tricky
Mind be against self-promo rules but your ad looks nice
im also against it, but just shared cool tool in my opinion 😉
Thanks for the affirmation man! I thought I was going insane lol.
I’ve seen interfaces fail when you have them both in the sender and the receiver, as opposed to just in the sender. But it’s been a hot minute since I’ve touched those.
You sure that wasn't just the sender trying to talk to itself (you have self as target instead of OtherThing)?
Pretty sure, but like I said, it’s been a minute, I can’t rmbr how stupid I was at times lol
this is not the correct place
What might prevent this completed pin from firing.
Ok, I'll make sure of that.
I'm be home in sometime, then I'll check again.
will this automaticaly replicate to the client or do I also need to call it on client
Its a state, should never ever use RPC.
Other ways for Replication are so-called “RPC”s. Short form for “Remote Procedure Call”.
Also multicast is server telling clients to run a function. So if server is the one calling the MC then every conmected client will run the function.
But this also mean that you dont want to use RPC tp change movement mode because anything that need to be in sync shouldnt be done in RPC.
Any player that have yet to connect or the one that get disconnected will be desync since the function isnt called on their end.
Use OnRep instead.
Rpc is for events.
Replicated variable for state.
ok that helps
Server rpc = client telling server to run a function
Client rpc = server telling the client that own the actor to run a function.
Mc rpc = server telling every client to run a function.
In nut shell server rpc is foe client to communicate to server.
Client rpc should be called by server and player that own the actor will execute the func.
Mc rpc should be called by server as replication work from server to client, not vice versa.
thanks
this should be a repnotify with a boolean like bEnteredStation
as replicated properties == stateful
rpcs == non stateful
a multicast is like "hey everyone this just happened and only you players here now should see it"
ie it could be a notification, or a instant particle effect
players late joining or not relevent will not get that.
simple way i like to describe these is
Imagine having a chest, opening the chest is a state (bChestOpen = true), everyone should know the chest was opened.
Particles that play when the chests open for the first time? Multicast (all players relvent sees the particles of the chest being opened).
Late joiners/irrelvent players will see the chest open, but will not see the opening particles (because its an old opened chest)
From my understanding, the completed pin won't fire if the montage is stopped/interrupted.
I don't think it ever is. The animation plays in full.
Theres some ignore actor function, to make the collision ignore said actor.
(I think the full name is like ignore actor while moving?)
Hey! Is the ce/ke command line trick for blueprint events still a thing in 5.X?
https://dev.epicgames.com/documentation/unreal-engine/custom-events?application_version=4.27
I can't get it to work 🤔 thanks
It still works. I use it in 5.7
ke ObjectName FunctionName PossibleArgument
So for a non argument function on all instances
ke * MyCoolFunction
And a function with an integer input.
ke * MyCoolFunction 32
I would like it to smoothly change the rotation for "Controller Rotation" from 355 to 8, but I don't want it to go back from 355, but to go forward 356, 357, 358, etc. up to 8 and I don't know how to do it 🙂
Someone can help?
Use RInterpTo, plug in your control rotation and target rotation, delta time and rotation speed - then use output to set rotation
it doesn't work in shipping tho
Okay?
Roger that. I'll try again, thanks 🙂
Is it safe for me to do this or should I just set it in a local variable first?
Is it possible for the array item to be read somewhere else and used in between setting the variable here and setting the element? (This is in a function called on the server, no latent stuff)
in UE 5.5+ right click the get node and click "show exec pins"
then the value is cached (as long as you use get a copy, because currently it's get a reference, i'm not sure how these behave in your case)
If anyone is familiar with contextual animations, would they mind messaging me please! I am struggling with getting the warp points to work - thank you in advanced 🙂
stop cross posting Jay
To be clear, I don't want the value to be used anywhere else. Once I'm setting "HeldItem" here I don't want anything else to use the array item before it's set to nothing
then your code should work as expected
Thanks!
In general - no, it is not possible. If the way you get the element is static (so by index, not by a random number) it will be safe.
It wouldn't be safe if you did something like get -> remove element -> try to get the same value from the previous pure node - because it would have a different number of elements. Since pure nodes don't cache their result, they execute again for each execution pin node that uses them.
I’m sorry to have impacted your day in a negative manner
nah you aren't, as both (or more) posts are still there
I’m not sorry for my actions, I’m sorry it impacted you
nevermind, it was waaaaaay easier via control rig 😆
You're not sorry for your actions of violating server rules?
don't be weird mate - I obviously posted it to the relevant channels
- No spam
This includes phishing, scams, unsolicited Discord invites, unsolicited direct messages asking for help, cross-posting in multiple channels, and use of excessive mentions, emoji, or repeated messages.
It doesn't say "only post in the relevant channels. It says, "cross-posting in multiple channels"
That means posting the same thing in multiple channels.
Let me answer your question most simply to end this conversation
correct
I'd take it as them planning to do it again. 🤷
Hi! im trying to figure out how to add items to an inventory component and im a little stumped. in the tutorial im watching the teacher sets up a keyboard event to trace to an object, then casts to the hit actor. Im trying to be a good egg and completely remove casting from my brain from the start. I have an interface between my character, my item master bp, and my inventory component. Im currently confused on how I can get the structure info from my item bp and send it to the inventory component using the trace from my character as the middle man. Feel free to DM me if youd like. im also avalible to jump into a VC if anyone wants as well
Remove the notion of removing cast. This is bad advice often circulated.
The item should handle the interaction. In this case, get the inventory component from the thing interacting and adding its data to it before destroying itself.
So when I trace to an Item I should go to the item and pass the inventory component through there and then back to my character?
Character: InteractInput -> Trace -> Call OnInteracted on the target (can be an interface, a function after cast, a component - depends what you prefer) passing the character as Interactor.
In the item: OnInteracted -> GetInventoryComponent from the Interactor actor -> try to add to the inventory, if successful, destroy itself
What Varael said. The item should be able to do it all.
Gotcha. Ill start giving this a shot
Something like this. This is from my inventory system series where I use uobjects but I'd imagine yours would still have an add item type function.
and this is in your item BP?
Yes, specifically a world item that is an actor that displays the item data in the world and can be interacted with.
Does the cast to pawn cast back to the player/whatever instigated the interaction?
also is the interaction instigator an input or an output?
Yes, the pawn cast is just to block it to pawns. You can omit it if needed and connect the instigator straight to the target on the get component by class.
The instigator (actor type) is an input on the interface function.
hey, does anyone knows why this happen when i try to set up a control rig?
This is just a crude mock up but is this headed in the right direction? Pic 1 is the Item BP and pic 2 is the inventory componenet
Yea that looks like the right direction.
Thank you so much for all of your help so far its starting to click
So Ive currently also added a keyboard event as a debug to print the name of whatever is in my first inventory array slot and it only works if I use set aray elem instead of add. is there any reason why the add node doesnt do anything? the array by default has no indexes for now
If you have something there already, even a blank entry, add will just add it to a later index. So you reading index 0 won't change anything. Setting index zero on the other hand would show you a change because you're modifying that data directly.
So if theres nothing in the array it should just go to index 0 right?
this is my little debug event too for reference
Add a second print to that that shows Item's number of entries.
Bumpin this down for ya because I yapped over it
Hi all ! Anyone knows how to get a proper "Up Vector" of a socket even if the "bone" is badly rotated from 3D software ?
I mean the "blue" arrow should be pointing upward in the SKM Asset but mine is the "green" arrow pointing upward
I did some testing to see what the problem is, apparently nothing is working inside my interactive door actor blueprint, I copied the door animation trigger nodes from the interactive door actor blueprint to the third person template blueprint and the trigger animations works fine there, is there something I need to be sure of or enable before I start creating blueprints inside a new actor graph?
Ive taken this a bit further and added limits so I cant overcollect but now im totally lost on how to get the item info and what index it was added at over to a widget so I can update a hot bar. all im trying to do right now is make a simple three item hotbar but im totally stumped at how to get the images to change to what I set the array to
Would I want to add the function to my inventory component, my item, or my character?
Deffinitly not your character, you want to keep the system self contained.
For add item, use the inventory component.
Depends on what the nodes are, maybe post screenshots here
post bp
im transfering units (unit cards), from one army to the other.
So when i load the army widget, that has all the cards, i loop through all the units, and bind the click on the card, to transfer the unit to the other army
but doing it this way it doesnt really send the current index in the iteration...
it sends always the last index... because it is iterating and the loop will then have the last index...
i could swear this worked well in the past, and would send the right index... but now its broken
what should i do? How can i make sure the right index is sent...?
Well no, it will never work like this
YOu are using loop index outside of the loop. You should never cross execution chains like this
You should save an identifying data on the Card ui element. Then sent is via a dispatcher parameter
So when the card gets clicked, it calls the dispatcher with it's ID, or name, or whatever you need
You already have the unit data on the dispatcher so I'm not sure why you would use the Index from the loop
There are so many weird things in this bp that are confusing the hell out of me lmfao
yeah but pros do it using index
and structs are weird in blueprints
okay but will try that
I can guarantee you pros dont do it like that XD
or using FGUID
okay will do this
thanks 🫡 🫡 🫡 🫡
I mean, maybe, but definitely not like this. It is hard to tell exactly where you went wrong without looking through the relations between everything int he project
Will mixing a event dispatcher into a loop not cause synch issues ?
What do you mean "mixing"?
If im not wrong the loop runs on one tick
But the event doesnt
So if you add a dispatcher to a loop super weird things will happen
Everything runs on one tick unless it is marked with the time icon.
But the event itself doesn't run in this execution chain. It is only a binding connecting the delegate with the event
Not really, I think it is perfectly fine to do
I wouldn't say weird things but why would you need to call an event dispatcher in a loop?
The event dispatcher is evaluated in the same tick so when its called can be important when trying to ensure the correct execution chain.
Oh, I assumed he was asking about binding - since yeah, calling a dispatcher in a loop seems pointless
A bind is just adding the object and function name to an array. When you call the event dispatcher, it loops through the array and calls the relevant function on the object. So if you create a binding and call the event dispatcher straight after it will call in the same tick.
i need to call this function 8 times with different parameters
so i have to replace all the blue and yellow links with the function parameters to make a giant spider web
man this code is so unmaintainable and difficult to comprehend
i stopped working on it and trying to decide if i should finish it in blueprint or switch to C++
i think this is the complexity limit for blueprints and i should use C++ instead
i want to put all the code in GameMode anyways because i dont want the clients fucking with it
you can do
get parametername to get the parameter as node
ohhh thats so much more neat
wallahi
thanks
had a feeling i was going regarded
Hi, I am working on a project on Unreal 4.27 with friends. It's UMG Widgets only imagine a visual novel, I am working on a gameplay feature when every button got assigned with a different texture out of 2 at start of each given level. However, it is not working as planned in exe but works in editor. I am using set style nodes and in my primary assets I have some parameters which can tell the game which buttons are which and I am firing it off “event construct”, I can't share much as game is work-in-progress. Thank you in advance
writing code ❌
docking my yellow and blue spaceships ✅
look at all these yellow ships
Looks like something I would consider redesigning
this is peak
its doing an insane amount of heavy lifting for how small of a block it is tbh
W blueprints
is there a way to instantiate a temporary variable in a blueprint function
like a primitive data type that i dont want to register as a variable
like a temporary int whose scope is only within that function
local variable
ahh found it
thanks
i could clean up the code by taking out a few ADD and using temp variables
gonna put that one down under "stretch goals"
cuz at that point might as well C it all
if we're going for turbo optimization
maybe next time ill use proper coding standards
can't comment without being able to see the nodes at all.
from far away there seems to be a lot of repetition.
yeah i could make 2 more functions and break it all up and refactor it
but with less effort i could write it all in C++ even more optimized
speed wise probably don't matter.
most of the time if you are not copying too much and not doing large loops, it's probably fine in bp.
im planning on making it more different so ill probably copy and paste the whole thing and then edit little bits
I would never do core system in bp though.
its just lerping stuff around, for me that goes in the GameMode
i make the client a controller with buttons only, 0 trust architecture
as a former MMO exploiter i know what my players are capable of
what are you lerping?
objects that do game logic when the player BeginOverlaps them
need more context to comment.
its all good
for this project im trying to do only blueprint, since normally i do only C++ (even widgets)
tbh it doesn't sound like what Game Mode is suppose to do.
sounds like it should be handled by the object that gets overlapped.
well GameMode is server side only and authoritative
as a security nerd that makes me happy
What difference does it make if you do it on the object?
just Switch->HasAuthority.
player can move it and do what they want with it
they can only move it in their own instance.
which they can do it either way, even without the code.
but it won't matter, as they only move it in their own computer.
in other computers, people won't see the same change.
is OnBeginOverlap executing on server and client in replicated actors?
im just thinking if it runs server side only they cant mess with it
The overlap event will execute when the overlap event happend.
everyone is running their own instance.
yeah
Picture a trigger volume,
In 0.5 second of the game time, Player 3 character overlap with the trigger volume.
Player 3 computer execute the Overlap Event.
0.8 second of the game time, in player 2 Computer, Player 3 character overlap with the trigger volume.
Player 2 computer execute the Overlap Event.
if you want the event to just execute on the server instance, then just do OnOverlap->SwitchHasAuthority.
if im awarding points i want to do it all server side so that the client cant say "hey i just scored 10 million points"
Client make request and server validate.
Client Request to buy X item.
Server check if the player has enough money (on it's computer), it doesn't give a f how much the client money on their computer (hell the server don't even need to know it).
yeah so do it all in GameMode
no
Just make client request and server validate.
don't design the game such as,
Hey I am client, and I just bought this item because I have enough money.
Instead
Client request to server with server rpc, passing the item data it wants to buy.
Server check if the client have enough money by checking the money value on it's end.
If client have enough money then server can add item to client inventory which eventually get replicated.
Client can hack their instance and change the money to 10 millions and it wouldn't matter.
what if its like client just harvested rare item
what if they just like spam to my server
client harvested rare item
client harvested rare item
client harvested rare item
client harvested rare item
don't trust the client for anything you can't predict.
that includes haversting and obtaining an item.
Client press E to grab a rare item -> Tells the server that it WANTS to grab the rare item.
Server Check if the client is within range -> Server check if the item exist -> Add item if all good.
no
Adding item should be written in the inventory component
what's game mode got to do with it.
Change
"client haversted rare item"
to
"Client: Hey server can I grab this item?"
yeah so do it in gamemode
i do it all the time. what i do is call an RPC within my PlayerController, and my server side playercontroller calls functions in the GameMode
but you do you, I tried saying my piece.
Model View Controller
Im not new to this
i just dont have experience doing blueprints. ive always done everything in C++
if you think doing things server side in GameMode is horrible coding practices, you should see the widgets i write in C++
there's no different in regard to this concept, bp or cpp.
yeah doing something server side instead of client side whenever possible is best practices for multiplayer networked games
game mode is responsible for Game Mode related, not adding item and such.
not just for security reasons, performance too
doing something server side doesn't mean doing it on game mode.
it just mean, doing it on server instance.
game mode Tick() is my main game thread
thanks for the local variable tip
was going crazy looking for it
i think i make less coding mistakes with blueprint, its got that "it just works" aura
in C++ i have to dig through the source code and headers to find the function im looking for, try to call it, crash to desktop, read my crash error messages
AI built into the IDE makes it less of a headache to look for something you don't know about. As long as you don't trust it and double check when it is something you didn't use before.
Also I'm not sure if crashes are that much of a problem. These days IDEs are pretty good at catching most mistakes and even have suggestions for good practices.
But yeah, BPs are specifically made to be safer than C++
heres a nice port full of blue boats
be a shame if something blew them all up 😈 🇺🇸🦅
the humble yellow underseabooten
visual aesthetics matter over performance. aesthetics maxxing
sure im the only one who will ever see it, but i am god
Whilst I don't know what this is specifically, I feel like this could be handled more cleanly with a for loop.
quick question, is there a node to check how many times that this said piece of code has been executed in your game? take for example voice lines, once it's been said once or twice, it won't work anymore and will instead say something else
I don't think so but you can like route every usage to a function and just do a log / count there.
okay. how would i make it work for multiplayer though. so it's not just one variable that counts for everyone
you can just track it on each individual machine without caring about networking.
everyone is running their own instance, whenever the function is executed on their end just increment the count.
how do i do that if i'm doing all this inside a character blueprint
Just make a custom event called, PlayVoiceLine and a variable called VoiceLineCount.
PlayVoiceLine->PlaySound->VoiceLineCount + 1
has nothing to do with networking.
okay. thank you.
@modern horizon if the sound have significant gameplay consequence, then you have to make the server as the authority.
Meaning, only the count in the server matters. Infact if that's the case, only count on server then replicate that count to everyone.
otherwise, there's nothing to network.
I'm trying to make drums that animate in response to a MIDI file, I have models and everything but I'm having a hard time understanding how to set up the input. Can somebody lend me a hand? I'm basically a beginner with this.
Hey guys, I am having a problem with pcg or actor... or maybe something else I cant tell. there are not supposed to be magical floating trees above the ground. I cant tell what is causing it. I even turned off the instancing for a little bit in the pcg. I have rebooted my pc, I have tried a lot. if someone could help me I would be so happy
whats the blueprint equivalent of TArray<AActor*>
i want to store a bunch of AActor subclasses using a TArray of AActor in blueprint, is this even possible? or should i switch to C++
ahhh sneaky sneaky
thank you very much
thats exactly what i was searching for
is this the best way to do a random chance mechanic in Blueprint
generate random number and do a bunch of Branch
You're generating four random numbers here.
yeah just 4 outcomes equal chance for this example
No. I mean that you're generating once. Checking if that is ==0. Then generating a new one and checking if that is ==1, etc.
i dont know what else i would do tbh
Pure nodes run once per connection to an executed node.
cache the number
is it generating 4 separate random numbes? lmao
If you want to generate just one specific number, right click the random int node and show exec pins and hook it up.
that works too
Just convert it to an executed node.
how do i do that
If you don't want wires going everywhere then a local variable works, else just adding execution pins via the right click menu is the way to go
It's worth noting that was added in a somewhat recent engine version, so if you're using an older engine version you might not have that
dang im on 5.6
i think im missing exec pins
might as well upgrade to 5.7 then i guess
if im missing new tech
which version are you on?
i think 5.6
That should have it I believe
5.6.1
Make sure you're right clicking on the node and not one of it's pins
Do you see the screen shoot? right click the green pin
Actually it might not matter if you click the pins
do i have a plugin missing
oh i made the project using the C++ template dunno if that matters
doesn't matter
It was added in 5.5, so your engine version is older than that
thats crazy
Go to Help -> About Unreal Editor and it'll tell you the engine version
5.6.1
idk then, you should have it
is there a shortcut button for breaking a Vector3 into components to grab the X,Y,Z
make/break Vector... found it
can also right click the pin and split it without a separate node
there's almost no overhead with casting
the memory overhead comes from a hard reference (that blue pin) to a blueprint asset.
so the casting part doesn't matter.
Anyway that thing should return the generic object class.
you will have to cast to make it useful.
i have an actor that does LookAt at PlayerController 0
in a networked game will that be executing on the server or the client
because on the client it would be the local player controller, and on the server it wont be
Uh. It depends how you call it. Is it via an RPC or just normal code?
And yes, GetPlayerController(index) and similar nodes can't be used reliably in networked game
i want it to execute on the client only and get their local controller
should i tick -> RPC(client) and use that to make sure its client side only
or would that be calling over the network every tick lmao
Depends if the behavior has to be server authoritative or if it is only for visual stuff
visual / cosmetic only
should be part of the client/controller
never server side
not sure how to make that happen
So no RPCs needed. And index 0 in getplayercontroller on the client should be the client
its to make a world space widget face the player
by calling LookAt Playercontroller0's location
not sure if it will Just Work or if i need to change the way its written
i just tested it and it works fine
i was just overthinking
Too Easy
@peak trail
GameInstance->GetFirstLocalPlayerController()
To get the local player controller
my bad i actually did get pawn
so on the server it doesnt matter that the output disagrees with the client
You could also just pass the controller as Owner when spawning the widget, then access it with GetOwner
Well widgets shouldn't exist on the server in the first place
its code in an actor
listen server render widget too.
the widgetcomponent is attached to the actor
widget is local, they are not replicated.
anyway you don't really want to use the getter with index in mp context.
I would just make a blueprint function library to get the controller
not sure how else to do it
there's an article that says it's not always the case for server.
yeah thats why i was wondering what the behavior would be
e.g client load faster than server during server travel, causing the index to differ. But i never get that far my self to confirm if that's true.
look at GameInstance->GetFirstLocalPlayerController
that will give yoou the local controller regardless who called it.
i dont use the server's playercontroller for anything anyways
then you can just do this.
its a blueprint function library I made my self based on GameInstance->GetFirstLocalPlayerController
made my own because i want exposure to BP + I want it to return my controller type.
He made a C++ function exposed to blueprints, since some C++ functions are not blueprint accessible by default
lazy programmer here
this is the whole code
AAGController* UAGLibrary::GetLocalAGController(const UObject* UWorld)
{
auto World = GEngine->GetWorldFromContextObject(UWorld, EGetWorldErrorMode::LogAndReturnNull);
if (auto GameInstance = World->GetGameInstance())
{
if (auto AGController = Cast<AAGController>(GameInstance->GetFirstLocalPlayerController()))
{
return AGController;
}
}
return nullptr;
}
didnt you said you are more accustomed too cpp than bp.
getting local controller is something you need very often.
it's gonna save you time making a blueprint pure node rather tahn copy pasting 4 - 5 nodes just to get the controller.
i like how UE has changing directions mid air (surfing) built in to their player movement. thought i was gonna have to add it
newton can hit the orange justice
im trying to send some data into a widget that gets put inside a ListView component, but the data is not getting trough for some reason, both the variable "C" and "Player Net User ID" are invalid in the widget they get passed to but not in the widget shown in the picture.
You're using Listview incorrectly. You don't send a widget into a listview. You populate a simpler Object and pass it to the AddItem. The listview internally creates whatever widget class you told it to.
okay, so is there another component that would be more suitable for my purpous, wich is creating a list of the connected players in my server
Listview is fine. But you're just not using it correctly. If you want to do what you're doing now, I'd recommend a DynamicEntryBox. Otherwise you need to have the UserObjectSomething interface on your list view entry widget, and it needs to override the object set function to populate the widget from the data. Then make a simple object class with your net ID and name.
Also on a side note to this, I wouldn't use the PlayerController here. You can gather a list of all players from the GameState's PlayerArray which is an array of PlayerStates. Which has the player's name and their UniqueNetID.
is there a built in player array inside the game state?
by default
Yeah
do i still create widgets and add them to the dynamicEntryBox or how does that work?
You call... Uhh.. I think it's CreateEntryOfClass?
It'll create it and pass it back as a UserWidget, cast it back to your intended class and then call a function to pass your variables to. You can use the same function to set up the widget.
so like this?
i assume this will work if a player leaves the game aswell, then ill just call the UpdatePlayerList function again
or do i need to remove entries or something like that
You'll need to remove the delay. And before the ForLoop call...
I think it's Reset? On the DynamicEntryBox
Then yeah it'll just refresh if you call it again when a player leaves.
it seems like everything works now, thank you so much for the support @maiden wadi
😃
Does anyone know how I can limit the structs that can be added to an instanced struct so that custom structs created via the editor can also be included?
I know I can use the BaseStruct meta tag which I can use if I define a base struct (no properties) in C++ but I'm not aware of any way of creating a child of this via the editor.
A quick and easy way, I don't think you have any options here. Cause BP structs have no inheritance. You'd need your own StructViewerFilter, and to choose how you filter those. By like naming convention, metdata, etc.
Do you know any good sources for creating a StructViewerFilter?
Any idea on how to use an image/material to hide objects in an 8x8 grid?
Not fully following on this, can you elaborate a bit?
Sure! Using a sine wave image, the wave designate a path through objects on a 8x8 grid. However, I’m not sure how to transpose the texture coordinates to clarify what is “on” and what is “off” to generate the path
Still not fully following. You're asking how to know which boxes the sine line is passing through?
Does anyone know why construction script doesn't actually update my item description variable on my inspectable component as I'd expect it to? It simply does nothing. It's just a simple FText
The parent class of this blueprint is a native c++ class, is that the reason?
I’ve attached some pictures to help illustrate. Let’s assume we have have 1 row with 5 cubes in it. We also have 1 yellow wave. The wave is a 2D Texture and I want to use it to delete objects that it would touch.
Currently the cubes are in an array [cube1, cube2, cube3, cube4, cube5]
I’m not sure if it’s possible to transpose the texture on top and use its coordinates in a similar array to tell if it would overlay with the cubes.
I.E.
[no hit, hit, hit, hit, no hit]
Which would give us
[cube1, no cube, no cube, no cube, cube5]
it Should be updating, but not always, (only in some conditions)
Try this to force it update
Delete the actor from the level.
Press Ctrl + Z (Undo)
Ah, okay so it works on instances. Does construction script not run on CDO at all?
The whole goal is to be able to procedurally generate paths using sine waves
actually it will updates on CD0/before begin play/game start if you press compile not only on instances
Hey, because I cant have multiple nodes of the same event in the graph, how do I trigger multiple places in one graph? I want to reset multiple "DoOnce" nodes without creating unique event for each one of them, they are all in the same graph.
Sequence
That's a smell
What are these do onces meant to represent, what do they gate?
Yeah I've changed it. It was made to make sure my game phases in game mode are not triggered a second time by mistake untill reset phase, but I deleted it and I'm making sure that when something triggers these phase changes, all checks are made beforehand. It was only "to make sure"
Sounds like a state machine
Or at least move the bools which represent your state (which are currently living in DoOnce nodes) into your class so it's explicit and you can reset them and query them anywhere
Anyone knows how to use "Landscape Blueprint Brush" but with a "heightmap" ?
I have an enum for current phase, and all I need is to check before triggering a new phase if it’s not currently equal to itself.
Yeah if you have an enum that can represent the state
Hi guys I found an interaction tutorial using interface without casting, and the logic is stored inside a component. I'm a bit confused and also a bit skeptical about the no need casting part, any thoughts?
Wondering how is this going to work with multiple actors without hard references, it's because of the use of the component?
the trace used is from camera manager so there's no cast to the character
Not sure about this implementation but in general it works with different actors and classes because you can add an interface or the component to any actor, regardless of class.
And you don't need to know it's class, because ImplementsInterface or FindComponent can be used with the simplest classes - like the Actor.
Thanks @crimson briar dumb question, is the component needed for every actor or this is just a "regular" interface setup where you just use the Actor
From the naming I assume the component is only for the actor that starts the interaction - so like your player character or something
It is a good way of separating the behavior. Otherwise your character class could get unwieldy with everything written directly into it
So all the others actors just have a reference to the component not the character?
Well it depends. They don't need the reference to the component. Since you use the interface for the interaction - they should only need to implement the interface. Unless you send them the interacting component via the interface function.
But it would still be better than referencing an actor class, since components like this are lightweight and usually don't have heavy assets like textures.
Being worried about not creating hard references is fine - but you need to remember what is the reason they are "bad". It is not strictly about the reference itself, but what it entails.
- If you bind behavior via a cast, it is hard to expand it. When you add another class that needs to interact, you would need to add another cast.
- When casting (or having a variable of this type) in the BP, you include the whole classs with this BP. It can create chains of references that can lead to loading huge assets when they are not needed.
thanks I kinda get the point, still confused on what I should do to optimize the chains I have inside my BP's but eventually things going to click in 🙂 The tutorial just use a simple open door logic, the fun begins when you need to access others actors variables
tempting to use GMS but seems overkill to use for a single game with simple logic
Yeah, it is something you need to learn by doing and seeing what happens. Another good way of avoiding asset chains is creating a base class in C++ - only with the skeleton of what the actor is, like params, functions etc but no assets.
Then casting to this C++ class is completely safe.
yes I heard about that!
Another thing though - don't worry about casting to things that are always relevant. Like the game instance etc. SInce they are always in the game it doesn't matter if you cast.
Same with the character and it's controller. If they are both tied together anyway, casting doesn't change anything
Interface is used when you need to communication on objects that doesn't derive from the same base class.
yeah I only have like 4 actors with their own logic and they need to communicate between each others, perhaps I can move all the logic inside a game instance
casting is a type check, interface isn't a replacement.
avoiding casting is fatal, your game will be unmaintainable.
Ugh, not sure if it is a good idea. Tbh i rarely use game instance outside of some loading/saving
Casting is harmless, your issue with memory overhead is a hard reference too BLUEPRINT ASSET.
which casting to a blueprint asset prooduce a hard reference to said blueprint asset.
so even if you don't cast, and you use interface which return a reference to another blueprint asset, it create depedency all the same.
thanks @frosty heron I'm just being worried about the size map of the actors that being growing up loading everything
yes that's because you have a hard reference to Blueprint Asset.
your solution is to create a native class.
casting and using a hard ref to native class is fine.
where having a hard ref too a blueprint asset will load that blueprint object and everything inside it.
so I need to use the interface to specify the Actor and trying to use Actor to communicate instead of specific class
for serious project, I would assume they adhere to strickly no reference to blueprint asset policy.
unless the class is always loaded then it doesn't matter.
Nah, debugging and code become unmaintainable .
imo learn a bit of C++ just enough to declare class, variables and function.
then you can do the rest in bp.
Blueprint only project isn;t scaleable.
tldr casting to CPP class is fine,
casting to bp asset is not. It will create dependency.
thanks very tempting to dig into that, and thanks for the pic very informative, I'll stick on my desktop 🙂
and many times people use interface, just to return a pointer and snap, they still get the memory overhead all the same.
@livid flare https://dev.epicgames.com/community/learning/tutorials/l3E0/myth-busting-best-practices-in-unreal-engine
a must read, if you have 5 mins.
that's a bit frustrating when you try to use interfaces and dispatchers and at the end you still have many hard references, the only system that seems to make it possible using BP is with GMS, but I'm gonna study a little C++ as you suggested
going to watch this thanks!
you don't have to watch, just read the article. The video is 49 mins long and discuss other stuff like nanite.
the article demystify youtube bs like avoid casting / don't use tick.
tutorials are useful but at same time very confusing, and sometime you can't even trust big yt channels 🙂
they can be a starting point but a lot of yt tutorials are not made in practical way.
either they lack the skill or just put something together quickly for views.
Lots of tutorial covering inventory for example, didn't even bother with Soft references.
so anyone following the guide will end up loading all the items in the game when not all of them are needed.
well sometime you just gotta be a victim and learn the hard way, at least that's what happend to me.
loading the main menu in my old game = loading the entire game.
Hard ref to bp asset everywhere and hard reference in data table.
Yep looks like the UI part is what made a few developers start using GMS not sure how it is handled in C++
I got so annoyed when trying to make my first inventory system that I started making a game with the goal of using as little UI as possible lol
Gameplay message subsystem used inside Lyra template
ohh
It's worth to give a look 🙂
UI job is just to read. Never do a function in the widget.
Normal workflow, UI Constructed -> Listen to the owner -> Respond / construct visual.
e.g UI Constructed -> Bind to health component delegates
OnHpUpdated -> Set Hp Text.
Hi I'm making a pinball game does anyone know how I could let a single pointlight jump to any of my hitted bumper actors, I am relatively new to unreal so any help is welcome!
As far as i'm aware it still creates a dependency to C++ classes too, the only difference is its not as easy to define an asset type reference in C++. Certainly not by accident as you have to manually load the asset. Its just epic had designed their base classes to not have dependencies on specific assets like static meshes, sound etc...
If you created your own C++ that loaded and used a specific static mesh, casting to it from BP would still cause said asset to remain loaded. The only difference is it wouldn't show in the size map as it only looks at BP based classes.
I will test after gym, should be able to see it with obj list class.
@dark drum but cpp doesnt contain asset though
Unless you hard code the path which is a big no no. That will load the asset as soon as the module is loaded.
I'm referring to having a property where you define a static mesh and then use the ConstructorHelpers::FObjectFinder to set its default value to a specific mesh.
People shouldn't do that, doesn't mean they don't lol. I just get images of memory management hell will someone new and they've just moved all their hard refs to a C++ class, no longer seeing them in the size map and thinking all is golden. 😅
You can set the location of the point light. However, it might be easier to have each bumper have its own light component that you enable and then disable (a second later) when the bumper is hit.
yeah I already figured that out right now 🙂 I also like to make a randomizer changing the color on each actor child I already use a struct that has properties like the color, intensity, and others
for the light component
C++ classes are loaded in memory always
Random question: Is there any event graph in the game that runs before any objects' construction scripts do? Something in GameInstance maybe?
What are you wanting to achieve? As in the end goal.
Basically I want to load assets at runtime. I have at least one BP node that must run, to set things up before any objects try to fetch their XML/models/etc. This is actually fine for deployment because I can just do that in a main menu before a player ever gets into a map, but for testing I'd like to be able to just jump into a test map, which means I need to run the setup functions before any construction scripts. (I guess I could put it all in BeginPlay instead, this is a very new project and I'm still working out lots of the details)
just wondering if there's a neat solution like a particular event in GameInstance or similar, where I can put my setup calls and it Just Works(TM)
Can the objects not load the data as and when it needs it?
I mean "when it needs it" for certain assets will be immediately as soon as the map starts :D The only asset I have this system working for rn is a skybox, and obviously that has to be present from map start, again I could have it load stuff in BeginPlay instead but 1) I like seeing it in the editor as well and 2) idk if there will be issues down the line with that approach.
You can have the objects attempt to fetch the data on begin play. If its not loaded, load it and then attempt to fetch again when loaded.
There's reasons I'm not sure that would work. For one the "setup" is not just loading of stuff, it's data that I have to give to the plugin from the editor - for example I want mods to be able to customize material instances from XML. That's working rn, but it need to know about the base materials, so I have to send those in first. I could still do lazy loading where an asset just waits asynchronously if the setup isn't done, but that could lead to weird jitter on map start which I'd rather avoid. (And if I'm using BeginPlay for loading, as I said I can just but the setup itself in a construction script and be done with it)
Imma sleep on this and probably just end up using BeginPlay, I was just wondering if there was an obvious solution I wasn't aware of
to my knowledge there are no pre begin play calls other than the Init event on the game instance, you can load assets async on begin play?
Async loading for most cases tends to the be solution. I'm not sure why having to give data to a plugin would affect that.
Either way, you can always create an actor component you place on the game state if you need a more central place to manage it.
The game mode will create the game state once its loaded before it creates the player controllers.
I'll look into game state, thx :)
It is possible to make this line trace to point forward? It's for first person character and I'm trying to make it works for a third person character
with this setup it's pointing in the opposite direction
Hello everyone, I'm designing a dodge roll and have all the directional animations for it. Is it better to implement it with a blendspace or using logic to calculate direction?
That would point forward from the camera. Are you wanting it to point forward from the controlled pawn instead?
can anyone help me to merge https://www.fab.com/listings/24b6fe9d-4e27-4703-8452-b993980c57bc this project with gasp or als?
Resident Horror V1 Horror Template System (Unreal Engine)🎮 Example Level map includedComplete modular horror system focused on immersion and gameplay flexibility.NEW UPDATE V1.5Ai ZombieSave And Load SystemMusic Ambient/Combat SystemNew Level Blockout Map--------------------------------------------------------------------------🎬 Showcase...
To be fair I'm not sure how the trace is working using the player camera manager.. but with this setup is pointing backward and is working fine if for ex the character have the mesh rotated 180 deg on the Z
Are you using your own character mesh or manny?
I'm using a metahuman compatible with manny sk
anyone know much about flipbooks jumping on the Yaxis ? Thanks in advance!
I have no input, but that is... an unfortunate texture for the torso and arms. It looked like something different at first glance lol
(my usefulness in life)
its just one of many colour schemes 😛
blueprint ❌
Kismet2 ✅
In a different timeline we still have UnrealScript and Kismet
And I'm not sure if it's the better or the worse timeline
Yo. So about the "stop all montages" toggle. That wouldn't happen to affect instances of the montage running in another actor, would it?
You can do some tricks if you want to blend different things in the same material. If you have a mask/value for each type.
Does anyone know why this wont update the hot bar image? the item is added to my inventory but the hotbar image refuses to update even though the event finishes out and deletes the item.
The first obvious thing - you create the widget each time you want to update it. Which means you make a new one each update. And on top of it you don't add it to the viewport or another widget, so it is not visible on the screen.
Also set brush is not connected
oop I had deleted it and tried something else and forgot to hook it back up. whats the best way to get an updatable widget reference? should I just readd it to my viewport? sorry if this seems like a really basic question
Readding the widget to the viewport after it updated did work though thank you for catching that for me
yea only in that Actor->Skeletal mesh
hmm my NPC´s using cmc is destroying my FPS, im on quite a heavy computer and with 25-30 npc im below 40 fps
any advice :/ ?
Scale tick rate by view-distance, you can check out SignificanceManager
A lot of people use event dispatchers for this sort of thing
In this case, my inventory manager calls OnInventoryChanged whenever a player picks up an item, which will then get a list of child widgets in a container and update their values with the new data.
Doing it this way does require a hard reference to your inventory component though. It should be fine in that case, but other use-cases where you may not have a component loaded may not work.
Another thing you could try is Send Gameplay Event To Actor but this is probably way too convoluted just to avoid hard refs.
On that note, I should definitely rename that CreateEvent function to something else so I don't mix up the two.
Okay perfect. I started doing some research and taking notes on interfaces and event dispatchers so I’ll keep on this when I can work again
Thank you so much for the example
You're welcome!
Any idea on why a negative value isn't returned when using get?
Show code, how the value is set, and how it's gotten
i have a spotlight attached to my pawn. it projects light forward as expected, but it also projects back into the cockpit for some reason. anyone have any ideas?
nevermind, i had a rogue extra one attached that was buried
Anyone know how do i get the controller class used by the project / level?
As in the player controller?
no the controller class
If you're referring to the player controller class, it will be the one set in the game mode. If one isn't specified, it'll use the default player controller class.
Beyond that I don't know what you're referring too.
ok thanks. i guess i get the gamemode first, then the controller class from that?
I believe so. I've never gotten it myself so I'm not sure if it's accessible via BP.
Hello all,
Im looking for some direction on how I should approach dynamically adjusting my mesh during runtime. Apologies if my terminology is incorrect but I want to be able to rotate the head and spine bones based on my movement direction and also adjust the Z of my pelvis down based on how hard my player lands and have it interp back to normal. For example, If I open my control rig and adjust the body ctrl Z down, my player crouches and the feet stay on ground. I can rotate and all that like the control rig is supposed to do, but I want to be able to adjust this dynamically when I'm playing. I'm not really asking how to do all this, I'm looking for which method/system to use so I can focus on learning it.
Is this something I'd do in my control rig, Animation bp, physics control component, transform (modify) bone, procedural animation, physics animation component, my player bp, etc.. I'm just a little overwhelmed and not sure where this should be done. I feel like its a control rig thing but looking for some clarification. Thank you!
Yes you can use a control rig for this.
One question though is how much of a difference is it going to make? 2 landing anims (soft/medium landing) with a 3rd for a hard land into a roll would be easier to setup.
Is there a way to get an arbitrary asset via name using a string?
Asset registry
If its a valid soft ref, you can then resolve/load as needed.
For reference, I'm trying to get an audio file asset path and name and then use that to get an associated lipsync file which already has an automatically-generated suffix
Is it in the same location as the audio?
Yes
This is where I'm at currently but the cast doesn't work, so something's gone wrong
The path and name output seem to be correct
As a guess I would say the asset isn't loaded. You can convert the asset path to a soft ref and then do a 'LoadAssetBlocking' before the cast.
If that works, it might be worth converting to an async load if needed.
That doesn't seem to be working, unfortunately
Add a break point to the cast and check the object is valid thats being passed in.
Okay, yeah, doesn't look like it's actually valid
What is the string that gets made?
/Game/StoryFlow/Audio/voiceaudio_estella_estella_valeriaconvo_1_1_LipSyncSequence
Below is the structure of a soft ref. (from one of my projects)
/Game/Blueprints/Compounds/Active/001_PrimeMatter/C_BerylliumCarbide.C_BerylliumCarbide
From this, I would assume your path would need to be:
/Game/StoryFlow/Audio/C_voiceaudio_estella_estella_valeriaconvo_1_1_LipSyncSequence.C_voiceaudio_estella_estella_valeriaconvo_1_1_LipSyncSequence
The asset name is normally prefixed with C_ then at the end it normally repeats the name (with prefix) after a . (dot) If you find the asset in the content browser, right click and hover over the 'Copy Object Path' to see the format its looking for.
Okay, from looking at the copied object path, the format I actually needed to use for the string was "{Path}/{Name}_LipSyncSequence.{Name}_LipSyncSequence"
Which seems to work!
Thanks!
No probs, glad you got it working.
How would I use an event dispatcher from an inventory component on a widget if I cant add a component to a widget? I tried making a variable of the inventory component on the widgets creation in my player but cant bind the event.
Components belong on actors. Your widget would need to have a reference to the actor that has the component or the component itself to then bind to the event dispatcher that the component contains.
hi i need help on NPC with CMC how to optimize, even now with 10-20 npc im getting big fps drops :/
I though I was doing this right but I cant bind it in the hud
InventoryComponent is the wrong type by the looks of it.
Do I not store it as an object? If so what variable type does it need to be in my HUD widget?
InventoryComponent
woulda ya look at that
I didnt know you could store components as variables thank you
It's still owned by the actor. You didn't give it to the widget or anything. The widget just has it's phone number to contact it essentially.
I would start with some Insights traces
Can usually see CMC stuff early in the frame.
Im making my first inventory and i got so stumped I went back to taking notes on how everything works lol
yeah welll im struggeling with insight since i cant tell what going on with it :/
https://gyazo.com/57bfb370133b781a6e72b608863f8ad3
Look at the fps drop even when theyre just standing sitll
sure some anims at work but they aint doing nothing :/
Yeah. But it's a wild guess without an insights frame or two to see what's taking time.
Might not even be CMC. Might be the animations, might be some random tick function you didn't even realize to check. 🤷♂️
Zoom in on one of these.
Hmm. Can you upload that trace?
record another ?
So I can download and look at it I mean.
What would be the most appropriate way to attach an actor with multiple parts (meshes) and own logic to my already existing vehicle?
Child actor seems like exactly something I'd need but they are apparently not recommended anywhere I look
If not child actor then what are my options when I need my vehicle to have swappable "components" made up of multiple meshes contained within them?
That middle block where it's WaitForTasks is some other threads finishing a ton of cloth sims. The first red block is mostly anim updates directly, and the last red block is some post tick skeletal mesh component updates.
Usually just runtime spawn an actor and attach it.
Oh lol
That's something I haven't considered 😅
It's the same thing that CAC does. But it won't get you serialization issues cause it's all runtime. CAC has problems where when you have a CAC on an actor and you save that actor into the map, like placing the vehicle on the map. The CAC can bug out.
Just a little extra handling on your end.
when my npcs have assets (skeletal meshes) im using anim mode "use custom mode" on each asset could that cause some issues ?
Not fully sure. But looking at this, SK_Orc_03_Cloth is one of your heaviest hitting things.
Ahh, thank you! 
You have 14 other threads all running this at the same time.
Orc body is causing a ton of overlap updates from movement.
hmm
tips on how to locate :/ or where to look ?
No idea. 😄 I'm not an animation person. It's one of my weak spots still. But what I do know is that for numbers like this, you usually don't use modular styled things like this. And you tend to do more optimized texture based animations and whatnot.
ha gotcha, but meaning what xD
i mean based on that you could atleast confirm something is "wrong" rather then just costly right ?
Okay so I think im pretty close to getting my dispatcher to work but Im almost positive im not calling it right and im stumped on how to do it.
My guess would be that the issue you're having is that you're trying to use clothing simulation on hundreds of actors at once and those actors have multiple meshes. It's not that something is wrong, nor is it specifically costly, but doing something like this and wanting it to perform adequately with hundreds of actors may be too much.
Is my inventory component trying to call to itself? Do I need to set a reference to the HUD in my inventory?
You want to keep your widgets separate from your game code. The widget can know about the inventory component, but the inventory component shouldn't be communicating directly to the widget.
The event dispatcher should exist in the inventory component. The widget when given a reference to the inventory component can bind to its event dispatcher to then update itself when things change on the component.
so change goes through on the inventory component, on the inventory component you call your dispatcher.
In your widget's on construct, it can read the current values from the inventory component, and bind to the event dispatcher.
So I shouldnt be trying to send those inputs through the dispatcher?
Nothing wrong with sending inputs if you want
But, you don't necessarily need to send all the data like you are either.... If you're giving the index of the inventory that changed, that should be enough that the widget can read the array as it needs to.
Also, having your inventory contain static data about the items is usually not a great idea as you're just using up memory for no reason, and making it much harder to actually manipulate the contents of your inventory.
All that should be required is some means of identifying what specific item is in the inventory, the quantity if you want a stack, and then looking up the data about that item as needed (like its mesh, name, type, etc.) as that information is unlikely to change at all during the course of gameplay.
Using a data table for example, would allow you to reference an item by a Name, simplifying what your inventory structure contains, namely a Name variable and a quantity. You would use the name to look up teh data about the item in the data table. An alternative would be to use data assets that allow you to define your items as assets which also allows you to use hierarchy (ie. not all items may need a "damage" field, but "Weapon" type items would) and then your inventory structure becomes an "item" reference and an integer for the quantity stored in that slot.
This is how Ive got it set up now and its still not updating the sprite and returning an error on close now. "Blueprint Runtime Error: "Accessed None trying to read (real) property InventoryComponent in PlayerHUD_C". Node: Bind Event to Update Hotbar HUD Graph: EventGraph Function: Execute Ubergraph Player HUD Blueprint: PlayerHUD"
How are you getting the reference to the inventory component inside the player HUD?
Make the InventoryComponent in the Widget an ExposeOnSpawn and InstanceEditable. Then come back up here where I tagged and refresh the CreateWidget, it'll have the InventoryComponent input on it. Pass it in there isntead of setting it after AddToViewport.
Dude thank you so much
Oh I see, on the player's begin play it looks like
Yall have been such good help w everything im starting to understand all of this a lot better now
hopin I get good enough at this to start answering questions and pay it back
a little ways to go tho lol
Hey, is it possible to skip unpinned parameters in a function? I want to create a setter function and wanted to use "categories" instead of setting each variable separately, just for convenience, but I wish I could override only the variables that are wired in the function input, instead of getting the main settings and then overriding only the one I want to set
Maybe if you set the default values of the input pins to something you'd never set them to. Then you could do a sequence with branches where it checks if the input equals the default and only sets it if not
behold
literal naval blockade of my blueprint
look at all those blue boats
the yellow ones are mines
It looks like there's a lot of repetition there. What's the bulk of it?
I think people explained it to him before. He just wants to make bad blueprints I guess
The last function i worked on...
its calling a function with a bunch of different inputs
what do you want me to put them all in an array so theres less blueprints?
some of them have different parameters the function has floats as inputs so i can tune each stage
stay in your lane noobs
Dunno, show a closer screenshot and we might be able to offer some professional advice. 😉
im a C programmer i normally dont use blueprints at all
its alright ive already been judged as making bad blueprints i have nothing to prove to discord people
its sick though it works great. just had 1 bug where i forgot to plug in a float
honestly enjoy not hitting nullptr crashes and having to wait for rebuild/reload of UE editor
I wish I still had some of the stuff I made when i first started using UE. (around 15 years ago) We all start in the same place, its from getting advice and accepting help we improve. 🙂
Yea, nullptrs can be a pain. 😅 It's nice the engine handles it for you in BP lol.
i have my code from late 2000s its funny how back then i thought it was so epic and now reading it im like i was a script kiddie
blueprint corruptions are the worst bugs ive ever experienced i dont wish it upon anyone and i think the design having hot reload enabled by default without explaining how wrong its going to go is bad product design
"give the user enough rope to hang themself" hot reload is like juggling short barrel shotguns
its sick how smooth this animation and gameplay is. if i asked 100 people to write the same thing they would all come up with different solutions. but i think mine is top tier
I think that's just the nature of trying to rebuild classes that are being used and having to recreate the objects.
If stuff gets messed up after a hot reload, don't save anything and just restart the editor and you're normally good.
C++ is not a hot reload language
theres so many circumstances where hot reaload will corrupt the shit out of your blueprints and it doesnt warn you, theres no forwarning at all, and when it happens its so hard to figure out whats wrong and why
its just there for marketing purposes
otherwise Unity would be all like "look we have hot reload and they dont"
C++ and blueprints hot reload is designed to make you get frustrated and quit
All the people i work with are non coders and cant work with people who use C so im transitioning
honestly blueprints are so effing easy having done the API from the command line
Are you talking about the literal Hot Reload, or about Live Coding as well? Because those are different things in UE
Live Coding is what i meant
hot reload 2 electric bogaloo
twice the headache
disable Live Coding and boom youve got Hot Reload
So I strongly disagree. Live coding works great as long as you follow some basic rules
how much revenue have you made from publishing
Like restarting after header changes
I don't care to argue, it is just what my experience is
Livecoding without reinstancing turned on works just fine for any virtual additions, or changing the body of a function in a .cpp file.
to talk down to me and call me a bad coder you have to be above me
fyi
dollars and cents is what matters at the end of the day, no matter how you build it
No one was talking down to you. O.o
earlier
I said the BP looked bad
get a load of this guy
im bad like michael jackson
im bad like LL Cool J
momma said im the baddest tbh
maybe ill register my studio as Bad Games LLC
quick question, I know how to make a lever pull interact with a door, but if I want to have multiple lever-door pairs how do I make it so one lever doesnt open all doors, or all doors are opened by one lever? how do I pair them
or even better, make levers be able to trigger multiple things
Add a array property of type 'Actor' called 'Targets' to your level. Set the property to 'Instance Editable'. When a level is placed in a level, you'll be able to add actors to the array that are also in the level. This would be the things you want the level to interact with.
On you're level, when it's interacted with by the player, loop through the array and call the relevant function. (Most likely an interact interface event)
much appreciated, i haven't explored the interfaces yet but I keep seeing them mentioned with this kind of stuff, how exactly do they work/is there a video you'd recommend going over them
also, where should I store the array? just in my character? or does it not matter too much
The array should be on the lever as it's what the lever should interact with.
An interface is just a collection of functions/events you can add to multiple class so they all implement the same set. This is useful when you have different classes (in you're case actors) that won't share the same parent.
gotcha alright, I'm curious in that case why not just make a single instance instead of an array if it's going to be instance editable anyways?
An array would allow you to define multiple actors that will be interacted with by the lever. Instance editable makes the property show in the details panel when its selected in the level. This is where you'd add you're various actor references. The array could have a single actor or multiple if needed. (like a light switch affecting multiple lights)
ahh ok makes sense thank you
Hi guys. See the default scene root icon there in the middle? of the viewport? How do I make it invisible?
In level it is G - switches to game view, with no editor icons. Not sure if it is the same in other viewports
Yeah AI came back to me with G too, but doesn't work in the viewport it seems
Hello lads, is there anyone with mutable plugin experience? I'm trying to use the remove mesh blocks node, but since my character has multiple udims, the part I want to remove is outside the allowed grid, and I can't find any way to move it elsewhere. As far as you know, is this maybe due to wrong unwrapping process, or is it a limitation on mutable we have to live with?
There we go. Select the top-most object in the components list and find Editor Billboard Scale
Googling like it's 2025.
Is there not anyway to convert a soft object ref into another type without having to load it first? I've got an array of asset ID's that is a type of data asset and the function I have takes that specific type.
Within blueprints alone, it seems not. It looks like you could create a C++ function that could cast it for you.
Thanks. I got it sorted, nothing fancy but it gets the job done.
TSoftObjectPtr<UCompoundGroup> UUpgradeManager::GetAssetIDAsCompoundGroup(const FPrimaryAssetId& InAssetId)
{
if (!InAssetId.IsValid())
{
return TSoftObjectPtr<UCompoundGroup>();
}
const FSoftObjectPath AssetPath = UAssetManager::Get().GetPrimaryAssetPath(InAssetId);
return TSoftObjectPtr<UCompoundGroup>(AssetPath);
}```
btw you can often just return {}; to get a default constructed value
This is kind of a fun one... Given an ActorComponent, how can I get a random (but stable) color? IE the same component will always get the same color every time it's run
Define "Same component"
That exact same instance. The goal here is I've got a level-wide effect which acts on all physics-enabled components every single frame and I'm seeing some weird behavior I can't explain. So I'm drawing debug text for EVERY such component, which is obviously going to get pretty noisy. So, to maintain some semblance of sanity, I'm color-coding it by components so I know which lines and text go together
I know i can do it easily by saving a map of components to colors, and I know there's hash functions in C++ that could do it, but I can't find a good zero-storage solution in BP
Since it's just debug, turn the object's path name into a seed and use that to randomize the color.
Pathname is always stable for an object it's World.Grandparent.Parent.Object, so it won't change in a playthrough.
But don't subsequent calls get a different random number even with the same seed? I thought the seed just made the order deterministic
Correct. As long as you save and reuse the same stream. But if you create the stream each time from the same seed, you get the same result.
RIGHT ok that makes sense, how do I map the path name to an int seed though? That's what that C++ hash function was gonna do for me
How many objects are we talking about?
Few hundred?
I'm hitting a wall with this. Can't actually find a way to correctly convert the string to an integer or hash it. BP doesn't seem to have any functions for it.
I'll just save the map who cares its debug
Soo... Yeah I'd either go C++. Or make some map somewhere of Object/RandomInteger
Or the color instead of integer. Either way.
Final result: Pretty.
Also it annoying doesn't help solving the bug. Damn. You can see the path of that one object that zoops upward despite every single force line going to the right, like they should. What moves you upwards, you silly thing?
There is literally a node 'String to Integer'
Pretty sure that attempts to parse a string of numerical characters into an int. Like StringToInt("123") -> 123
are you trying to turn four into 4?
Nah I'm trying to turn "/Game/Maps/Level.Level:PersistentLevel.BP_Enemy_C_0.HealthComponent" into 265481414450645021
would something like this work?
Would there be multiple of the same component on a given actor?
Hi all ! Is it possible to teleport the Player into a whole new level (from an Open World map with World Partition) seamlessly ?
I mean without loading screen / lags ?
Maybe use a unique ID ? (UID)
If its only in the editor you can do this. It'll give you a colour specific to an each actor. The component can get the owners GUID.
I don't know if it's better to teleport my Player to a whole new Level or just moving his Location in the actual Open World map and just hide my "Portal Level" in this OW map. Any tips ?
Any idea why this might be happening?
spawns in but the information doesn't transfer correctly
specifically the Tree resource data struct
Can i just not pass a struct within a struct?
What is the output you get?
How does this macro look like / what does it contain?
it is simply a bunch of print strings
What happens if you hook up the Tree resource data struct to a print string
prints the contents of the struct, and the struct inside the struct
ill show u the prints
the bottom prints the input. the top prints the output
this shows that the struct data passes through, excluding the Tree resource data struct.
Now i need to see how the macro looks like
The Wetness comes up as "dry" because its an enum and thats the default value
okay
Look if you do any setter inside the actor you spawn
the setter is the item data, exposed on spawn.
Structs are so annoying to work with
they seem really great to me until now
it makes it so organized
but this bug may change my mind
im new
They are cheaper than other datatypes but you cant modify them on runtime without breaking them and accessing them is really annoying
U objects are way nicer to work with but anyways
I never come accross the "bug". May be node on your end.
All of these are printed.
You cant
If you dont use struct you are cooked.
Not with blueprint structs
You can still mutate the struct at run time.
and it doesnt set
Ye, you can also jump off a cliff
Maybe you mean dont change the order or add or remove in editor?
Mutating the struct it self at run time is no issue.
What there saying, in a very weird way?
Is, the actor your spawning messing with the variable?
Like, if you do a search for that var name, inside the spawned actor.
Do you edit it at all?
Set, or set members
Does the actor you're spawning do anything on begin play? idk if that would run before or after trying to read it here
the actor just exists. does not modify anything.
So basically these 3 get reset for whatever reason ?
