#blueprint
1 messages Β· Page 297 of 1
Make sure the array is also not empty, maybe the code works but if the array never gets populated there's nothing to damage
You do nothing if either of these are false
ha sorry, didn't mean to grab your image Spynora π
have added a bunch of print string and print text and nothing is coming up.
Then your array is empty
This is also a ticking time bomb, might result in a null pointer later
Unless the Get Player Component does any internal checks
sorry, am pretty noob to blueprint, what do you mean ticking timebomb?
oh those won't do anything. You need to pull off the green pins from the math checks to see what they are doing.
Use "Format Text" and then put pieces in {} to make them a variable. Like: "Get Distance Is: {x} against a check of {y}" Then plug the values in and connect it to the print string
a Null Pointer Reference Error happens if you try to access something that doesn't exist
Might crash the game
Anyone able to help me with AnimInstance?
You're pure casting to the character and passing it to a function directly. If that object is not a character and that function is not doing any validity checks it will crash the game
Because when you pure cast, if the cast fails the object reference will be returned as Null
Here as well
It may look like you're checking validity but the Select node will try to access both options before performing the condition check
So it may also cause a null pointer
Sometimes these pure functions don't cause any problems in the editor but they can cause a crash in a packaged game
Hi guys, I almost solve the problem.
So my question is: How to remove the last previous click stored Array and only store the last click?
If you only need the last click why do you need an array?
maybe clear the array when you apply the changes?
has mobile inputs been solved at some point in unreal engine 5+?
In the past you needed convoluted setups where it would take on the first touch, then over tick check the delta to make a swipe or scroll action.
In the widget BPs, there seems to be functional overrides but I cannot find any documentation or videos that explains this. Even the latest message on this channel is from one of those convoluted videos, so am I missing something?
What's convoluted about checking the delta?
Not sure if they added anything for swipe controls with Enhanced Input
they had repeatedly mentioned mobile support such as better inputs since 5.0 but I never saw any of it
and in the past, there is a LOT of tweaking to be done on simple commands
I confused, how to prevent the changed actor keep resetting to its orginal mesh. Should I use SaveGame for this?
right now my other than clicked actor, will keep reset.
Do you mean when you reload the level?
yes
When you reload the level everything in it gets deleted
It won't keep any changes
So yes you need a savegame
Save before the level change and load after
Alright, I'll take a look on that. Thanks
ahh yeah i have caused one of those before.
ok this change is nwo getting a print string
its printing decimal values so am assumign that makes it the first print sting thats pulled off the ABS green maths check. is that what you meant?
whats the alternative/better way to do it to avoid that issue?
dont use a pure function if it's not 100% guarantee that thing exists
ok, what should i do instead? not being rude, just totally oblivious as to the alternative.
you can use an impure cast instead, that handles validity
For the select, don't use the select node unless both options guaranteed to be valid
you can use a regular isValid switch to check which option is valid, and assign that to a local variable
then use that variable when you need it
impure cast? that isn't like something i just type in like cast to is it?
ok, so have added print strings to each bit separately now. when the ai hits the built piece i get the print strings firing from before the branch but not after
added print string to both of the branch true and false and the brahc comes back false, as thats connected to nothing it dies
How can I set up whether I need to press to interact, or hold to interact? I tried making a variable in my interface but it wont let me
Editor crashing and throwing this weird error. Can someone explain this what does this stands for ?
@proud salmon is the problem that the built item is not being put in the array, therefore it is failing at that branch
There is nothing we could do with that error.
It means nothing on its own, for any hope you'd need a full stack with debug symbols installed, and even then the callstack is fairly useless for bp related crashes
Its annoying to do, if you want an easier way of doing it you can pass through the values into the Animation Blueprint, i think if you have a Posable Mesh Component you can also do it that way.
https://youtu.be/B0RiuWI3jek?si=YEUlFnEpr-Rfcwy_ anyone know if this still works for 5.5 and or if thereβs any tutorials on this system? Iβm trying to make something similar where the player can interact with a book to navigate the book locally and other players cannot interact until itβs free to be interacted with
The Widget Interaction System Asset Pack for Unreal Engine is a universal interaction system for 3D user interfaces placed in the game world. It allows a smooth and automatic camera focus on widgets, transitioning from default player movement to direct mouse input on the focused user widget.
Included blueprint classes cover computer terminals, ...
Hey folks
I'm just getting a black screen when I try to load a level like this from my main menu.
If I use the "Open Level (by Object Reference)" node instead it works fine, but freeze the screen while loading it.
What am I doing wrong?
You can't do that for loading persistent levels like that.
Hmm okay. So my only options are to accept the screen freezing, or to make a persistent and empty top level, and then have the various levels be subLevels and then use "Load Stream Level"?
Hey guys, I hope this is the right section to ask
I'm doing a walking simulator game which is very narrative based and with dialogue choices that can affect the gameplay. What would be in your opinion the best workflow to achieve something like this? Also I'm working with a writer, is there a way where he could work outside of unreal and then import the dialogues with choices in unreal? Thanks
The issue with levels is they can take up a lot of memory. It's why you can't cast to a level object in BP. (Just imagine being able to force load you're entire game. π ) Adding to this, in a lot of cases, you might need to unload the current level to free up enough memory to load the new level. Level streaming is a little different as there's an assumption its only part of a level, not the whole thing and subsequently has to be streaming into the persistent level.
If it's a level transition, just popup a widget with the words loading in the bottom right before you call the load the new level.
I'm trying to do the same thing, so I'm building a plugin for it, there are some plugins released as "Narrative", but one of the options I think are good is using Gameplay Tag Query, and make the player progress about a structure that contains a Gameplay Tag Container, which will make it easier to select next Task (Dialogue) based on player progress
hey guys i want to create an in editor widget for my lightsets, i have 6 of em. in my widget blueprint, i have succesfully turned the lights off when i click the button, but the problem is the correct lights wont turn on (or any lights for that matter) after i click the button. my lights are children inside an actor bcus i dont want to use blueprints to put my lights in. the image is my widget blueprint. i added a tag for each of the actors that are parents to the lights. i think my blueprint doesnt understand that that i want to turn visibility on for the lights according to the actor parents. please help me im stuck. thank you!!
the code is messed up
Thank you Hamo for the answer I appreciate it you're very kind.
I see, I used gameplay tags in the past (mind that I'm quite noob). Would you recommend the plugin Narrative over doing it on my own? Also can you imagine some way of having the writer (with no experience in unreal whatsoever) writing the game and choices and directly having them imported in Unreal?
Okay thank you. Can't do a "throbber" in the loading screen then right. I'll just write loading and use this BP node.
there is a for loop that's empty, and the events run a function that uses a parameter from another event
im sorry im really new and chatgpt is making me lose my mind
If you're working external, this normally means it would need to be done in something like a spreadsheet. This however isn't the easiest to work with or visually show the flow of dialogue. You might be able to find some tools specifically for this that provides a CVS export and build a system around the data it provides.
no need for GPT, try a live chat with someone
im trying it now π
Yea, the widget will freeze unfortunately. You can always use a loading screen plugin at a later date and swap it out. I believe they normally handle the loading screen on a different thread so it doesn't stall as the map is loading.
Thank you pattym I appreciate the answer. Yes I was hoping in maybe finding some tools like this, if anyone has any suggestion I would greatly appreciate it!
Narrative plugin is good, but to import tasks to unreal as one file, you might use a data table, but I see what you want which might need some C++ coding to convert that new type file into code in the game, als you need to know that each task in the game will need in game coding, as some might need references from the world
I think you'll struggle to be honest. A few thing to be aware of in addition to the dialogue are animations, camera positions, sound effect (could add to animations though) and triggering other events. These things are almost impossible to define externally in any meaningful way, meaning it would need to be do in engine anyway.
you need at least an in editor widget to organize the missions and their tasks
Narrative got one, but not as you need it
i need to connect the loop to the light component array, but i cant do that and i dont know which parameter u are saying that is from another event
you need a live support, I can help using Chrome remote control just dm me, but I still need to understand the full idea you want
okay hamo i will dm u π₯Ί thank you π
hello i have an issue that i don't understand. i spawn an actor.
I can see the shape of the actor but not the static mesh. The size change with the Static Mesh input. But the static mesh is not visible.
But when i run the test directly by playing the level: they are there.
but when i load the level... they are not there but i see the size of the box...
when i load the level everything is there exept the static mesh... when i load the level, the cube is there but the static mesh is not there...
how are you setting that static mesh?
Any idea why this sometimes throws an infinite loop error? I have the player possess a BP_TapeCamera and a BP_TapeSelector (basically just a sphere collider) is set to update to their mouse position on screen on Event Tick.
yes directly
yes but how do you use it then in the code? it's a variable created by you, you set it on begin play? on custom event?
yes it's from another BP, where i select the static mesh. and inside of it is defined into the constructor, I set the Static Mesh byt the Input Static Mesh
show code and show where this code is
move this to custom event and call that event after you spawn object
ok will try
i think construction scrip is getting called way before you set static mesh variable on the ''spawn actor of class' node, that is why it's basically null
what is the exact error?
Not entirely sure, somebody just report getting a stack overflow error. I haven't been able to get the logs from them yet
no it was not that
it's still empty
this might be somewhere in blink cursor orcall unhover and not here, get the exact error info
show code and what did you do?
ok and you call it after spawning actor?
can you also change the name of the static mesh variable that is beeing set so these are easier to recognize?
yes
yes
and it's called just after the spawn
that's weird because i can see the box lol π
Print the name of the static mesh before you go to set it.
Also, do you use the static mesh component anywhere else. You might be clearing it somewhere else.
no i just spanw them and that's all
ans set if they are blocking or not
isnt that scale 0.1 making it so small that you cannot see it ?
Have you enabled 'Hidden In Game' on the static mesh comp?
i was thinking the same but even with 1 it's huge box but no mesh
and the with box get the mesh size to be able to draw... so i guess he found the size of the mesh
change the static mesh to cube for example instead of sm bush
but ok don't worry i will reach all code
at least it's not something related to the spawn
i will search π
if its child maybe you modify something in the aprent
ok i found
for a strange reason the overlap function is triggered when i spawn them
and on overlap, i hide them
in fact i should add a boolean out of the Interface saying the function is ok or not
like that i know i i call the good actor and continue if yes
if bp error tells you that there's infinite loop error, it's not always the case, sometimes it's just too many calls. just make sure it works correct and doesn't produce multiple(too many) calls a tick
I assumed this was the case but needed a confirmation. There's no way my current logic should have an infinite loop, I guess just many calls if you begin overlap is called many times for some reason.
yup, been there done that. bp error handling and debugging is just so annoying. you can hardly rely on anything but damn prints
That's actually the case with all code. There's no way to know before hand if a piece of code would enter an infinite loop. (One of maths great problems) So most programs have a call stack limit where it'll end the program.
For BP this is set to 1 million but you can increase it if needed. (Not really recommended unless you actually know what you're doing)
What does 'Blink Cursor' do? Also, what binds to the event dispatchers and what do they do?
Break points. π You can step through you're logic and check the variables as you go to see if they are what you'd expect. Even see what nodes it jumps to next.
hi, im working on a script to make sliding surfaces like in mario 64, its working but i would like the player to have much more control of their left and right movements as they slide down, im not sure how to do this
I'm pretty sure you can do this with physics materials. You can define how slippery a surface is.
Thank you again Hamo. Could you expand what you mean with this? You mean a widget to show the missions and tasks for the player to see? I saw that the Narrative plugin has one, you say that is not as I need, why?
I believe they mean to organize them in the editor. So you can define what mission leads into what.
thank you, ill take a look at that
it works well, but you need to implement a code for each task which the narrative plugin doesn't have, so I mean nodes in that widget will be tasks, and you be able to implement an extra code inside that node or other tasks, for a multi choices story driven game
having it at a very high friction dosent seem to help
BlinkCursor is a simple opacity switch. The HoveredTape and UnhoveredTape events are bound when the BP_TapeSelector is created (when the player interacts with the tape record box and they possess the BP_TapeCamera).
i think because the slide uses the flying movement mode
it doesn't always work. Sometimes breakpoints are missed. Sometimes variables are not visible for some reason and so on. So many sometimes in comparison to beautiful cpp code debugging π
CPP debugging suffers from the same thing, its all about scope. Things like local vars can't be shown unless they've been set already along the execution path.
As for missing breakpoints, this is very rare of which an editor restart resolves. If it happens a lot you might be selecting a specific object for the debugging. This means, break points in different objects wont be triggered. Pretty useful when you want to debug a specific object, just got to remember to clear the selection.
I believe the movement mode would need to be walking.
What does interp selection transfrom do?
Not good in what way?
Basically just raises and rotates the hovered tape.
Another question unrelated to this other one. I have a project I was working on back in October. When I try to come back to it, I'm getting a ton of compiler errors because many of the plugin functions I was using have been updated as the plugins were updated. Is there some easy way to rollback the plugin version on those plugins to the version they were in back in October? Ideally just rolling back the plugin version for this project.
This is most likely where you're infinite loop is coming from. You overlap, move the hoovered tape which then makes it no longer hoovering which makes it move again but now it's hoovering again and so on...
Got it, it's strange that the issue only happens very rarely then, but I'll put in some logic to avoid calling the hovered if it's interping
Just download an older version of the plugin (if available) and replace it in the plugins folder. If there's no older version you can get, no. You'll have to update the relevant logic.
heres a comparison with flying as the first
Yea, there's probably a spot that makes it happen where it falls in the Goldie lock zone.
Turn the friction down.
about the same with 0 friction
π€ Have you applied the physics material to the material/mesh?
Check the character movement component, I believe there's some settings on there as well that are used when handling the physics material.
i made it No Owner See, and i can still see it ingame, what am i doing wrong?
got it
needed to add is locally controlled
with a branch and set vis
Hello everyone! Here's the problem. There's a plane that moves along a spline, a character can enter it and move around freely. Time is calculated on the server, the position and rotation are set, and then, using variables, it's replicated to the client, where positions are interpolated so that everything is smooth. The problem is this. When jumping, the character simply starts teleporting to different places inside the plane, or being thrown out of it altogether. I suspect that the problem is either that when jumping, the character is not affected by the impulse from the plane and therefore it seems to stand still while the plane is moving, or perhaps it's because of some desyncs between the client and the server, but I doubt it. Has anyone here encountered a similar problem? How did you solve it? Maybe you have something to suggest. I would be very grateful.
Heya; Bit confused; is the find node -> break node not what i should be using ?
The variables all seem to be there but not getting an output:
Is there anything else or only Salt as a key in the Map right now?
an addition; further down the line; i get something out of the break but its not looping
because for every key you set Array, so the Array quanity will be always the last thing from the map
instead of making array
use For Loop and plug last index to the Quanity
Oh hey Amber π Ive tried putting it to on complete but am still not getting the for each loop on from the array
Full image for ref
because your 2nd loop will only loop 1 time right now not the quanity amount of times
its For Looping X indexes of the array which is 1
use For Loop, not For Each Loop
what's the node called like reroute nodes with multiple lines but to execute multiple functions so i don't have them in a single row?
Sequence node.
a yes, thank you, didn't come to my mind
Hi, is there any snippets/plugins/tools to force Save All on entering play mode (just before staring play mode)? Im tired of randomly losing progress cuz unreal decided to crash and I forgot to press save. Why isnt that a default behaviour of pressing enter playmode?
I created a flying drone out of a character blueprint in a 5.3 project, worked great. When i import it into new 5.5 projects the movement is really choppy/laggy. Tried it in a new 5.3 project and it worked fine there. Can anyone point me in the direction of a reason/solution? Please and thank you
β Is anyone aware of a convention on making private functions stand out from public in the My Blueprint sidebar? For example using an _ prefix?
I don't know, but I got used to pressing CTRL + Shift + S to save all
Use categories? or am i misunderstanding?
I use categories for topics, e.g. Interaction vs Sensing. And then witin those categories I like to have some private helper function.
I'd also recommend pressing the 3 dots next to compile and changing it to Save ... On Success Only and then only using the compile button
That's nice. Now if only it would be more concise. No need to display public imho, just assume that as the default. But thanks a lot! It should be an icon instead of long text. Onto my list of PR ideas.
Which node can I use to get a class's master class (parent class) in Unreal Engine 5?
I guess cast to that class of actor object reference
My current system to apply an AI controller to characters on Unposses is messy. Very messy., I don't use BT's and honestly assumed getting the ai controller to possess my pawn on unpossess woulda done the trick but no dice.
How in the lord do i assign an AI controller to my characters when they are unpossessed?
I forgot i can cast.
lets pretend this never happened
I have a problem. I have a character with a spring arm, and a lock on mechanism started, but I can't figure out how to limit the rotation of the spring arm. I basically want the spring arm to only rotate within a range so that the target and the player are in view while the player is "locked on". I have attempted this by using the camera manager's "set view yaw min/max", but I run into an issue, so I don't think I can use it. I have attached a picture of what I'm trying to achieve, even though it isn't the best. The red is the target, the blue is the player, orange is the spring arm, and green is the camera. Any help would be appreciated!
Please do, I've been tearing my hair out trying to figure this out all morning
I thought finding it would be quicker... hold tight
Okay good new sand bad news. One, pretty sure i remember the tutorials i used. Bad news, the tutorials are only kinda related.
https://www.youtube.com/watch?v=c65W1AxMkZg&t=1861s Here's the target locxk vid
https://www.youtube.com/watch?v=3trRGScjFVg&t=20s Dudes aim offset vid
I'm NOT good at helping get more technical like most here - but yer basically gonna mash those two together and clamp your axis
πGet Access To All My Unreal Engine Courses At : https://www.unreal-university.com/pages/learnunreal
πGet My Free Unreal Engine Beginner Course : https://bit.ly/46mUWMr
#combat #UnrealEngine5 #Uisco
π Chapters
Intro 0:16
Replacing The Third Person Character 5:07
Making A Lock On System 12:26
Breaking Lock On 27:49
Camera Lag 30:52
Locomotion...
πGet Access To All My Unreal Engine Courses At : https://www.unreal-university.com/pages/learnunreal
πGet My Free Unreal Engine Beginner Course : https://bit.ly/46mUWMr
πProject Files : https://bit.ly/3UrrP6O
πAnimations : https://bit.ly/3JtC843
My code is UNASHAMEDLY messy. Like... no one would hire me BUT here it is if it helps
I love spaghetti
And thanks, I'll use these
I really hope they're the same ones i followed... They look it but it was ages ago
The code should help at least. I appreciate it
of course!
No Owner See only works if the Actor is the ViewTarget iirc.
So only really on the currently possessed Pawn in most cases.
Three tips if I may:
-
I like the Blueprint Assist plugin, where if you press F it formats it in a standardized compact way.
-
I embrace creating smaller additional functions and call those in the larger function (divide and conquer).
-
Instead of drawing from the same variable over and over, I sometimes create intermediate local variables and then draw those into the graph repeatedly as inputs to nodes that need it. And you get that for free for any input variables to the current function (another argument to create new functions instead of hooking up all the code directly to the event). These are automatically available via "get <variable name>".
Best of luck with your long term maintenance!
#3 alone would get rid of SO MANY LINES
and would create so many unnecessary copies...
uhm. Why can't i access " Is Locally Controlled " in one of my blueprints?
it doesnt show up
Hi PEOPLE!! im implementing a dash ability, I want to press D+SPACE in this case SPACE is IA_Jump, and it works! But I realice that i dont like that even if Im pressing other key the dadsh is still working, so for example, if im moving foward (W), and presss D+SPACE the dash still happening, its doing W+D+SPACE to do the dash, I dont want that to happen. How can I make it work just with those keys, so the player have to releace all the keys to execute the dash. β€οΈ
Probably don't have a method for it. What blueprint class it's derived from exactly?
Um im trying to access it in my main fire arm bp
Which is derived from?
An actor? A pawn?
Yeah no,
It's a method of controller or pawn afaik, don't have editor to check.
If the owner is the pawn then you can do get Owner-> IsLocallyControlled
Cast to the type ofc
Can you Set View Target with Blend just before calling Possess to another pawn?
It seems that I need to delay after the Set View Target with Blend with the Blend Time and then possess? Unsure.. I didn't think I had to do that.
Possession also sets view target, so no.
How do some games make a smooth interp when riding something upon possession though?
Depends. There's a few different ways. One way is that there is a boolean somewhere for setting the viewtarget. I don't remember if it's in the CameraManager class, or Controller. But it should stop the possession view target calls so that you can manage it yourself. But this also literally means you need to manage it yourself.
Good to know. Thanks π
I think easiest route is just delaying the possessed function until the blend is done. honestly.
Remember to cast?
cast to what?
Owner return an actor type by default
To w.e the owner is
You best print string first to find out what the owner is
Then cast to the owner type afterward
ok the owner is my charachter but what do i connect to the cast
Casting is just a type check.
it needs an object
The owner
oh
Hi guys, I've got a problem recently. Suddenly the character in my game stopped moving, I tried everything to solve this, but nothing seems to work. I can't move my character, I can only rotate the camera. Also the EventBeginPlay doesn't work for some reason. It would be great if someone could help me, because I have no clue what could I do next.
You probably spawn the wrong actor if your begin play doesn't work but you see a character being spawned.
I mean my character is spawning and i can move the camera, also I set print string on inputs responsible for moving the camera and it was printing during simulation.
Nav mesh not generated ? Play the game inthe viewport, click alt+S and then P and check if there is nav mesh?
Is nav mesh needed to use a pawn in the simulation?
Depend on how you move the pawn.
For A.I or move To command you do
To move a character with input and velocity, you dont.
it is about player's pawn, not ai's
Same deal, it depends on how you move them.
What sort of camera mode is your game? And do you use the default template? Have to make guesses without seeing any code.
Also why simulate? Just play in editor
"MainMenu" variable always resets after editor restart and even in shipping build . Any ideas how to fix it?
You can't add object reference this way.
Technically they don't even exist yet. You need to point to the widget main menu you created at runtime.
Where do I check the camera mode? I created my pawn by myself
Is it a third person game? A top down game? Do you move by mouse point click or do you move with wasd.
With wasd and the camera is on Spring Arm so it's more like third person i suppose.
maybe it will be useful
Oof legacy input
Print string here. If they don't print, check your input binding in project setting.
I suggest to just not use legacy input and use enhanced input for your gameplay codes.
@elfin jasper also the input may be consumed somewhere else too if you have the same input declared else where with the bool ConsumeInput ticked.
print string is printing but is isnt moving anyway
its the only place where i use these inputs
Print string the axis value. Other than that, i have no idea.
it is printing -1 and 1 as it should
no movement though
Well, no more idea. I mean you can check if nothing is blocking your character, if walk speed is not 0, and if you are not playing in simulation.
Check if you didn't change the movement mode too.
Other than that no more idea.
whats that?
is it a ue plugin?
No, use GitHub desktop for easy mode.
Not gonna fix what's done.
But will help in the future.
You mentioned this enhanced input
whats that?
i know is is a plugin
but is there a documentation on how to use it?
It's what unreal comes up with that preceeded the legacy system
There is doc in epic website
With instruction on how to set it up
Okay thanks β€οΈ
Gl, if you are still early. Just set-up new project, use enhanced input and source control.
i tried adding this enhanced input now and i made just input for moving forward and backward and it doesnt seem working. it might be because of event begin play not working, so mapping context cant be added. any ideas why is it like that?
Did you enable the context?
Where?
on begin play?
you need to Add Mapping Context, can you show how did you set it up?
you dont need to cast, just plug it to enhanced directly from get player controller
same thing is shown in ue5 documentation
maybe the cast fails or something
also you can increase priorty just to make sure that there isn't another input context withthe same buttons so making it higher priority will override the other one
it doesnt help
event begin play isnt working
i tried to print string from ti and it doesnt
Is this the controller or the pawn?
Where is this code
Pawn
sorry i didnt saw this message at first
looks like you are not possesing the pawn so there is nothing to controll? maybe ColdSummer can confirm
I don't have editor on me but try Windows-> world settings or something I dunno.
Or look at the right hand side of the screen in the editor. See if there is a world setting tab
This?
Ye try expanding selected game mode
Also don't add context mappings in beginplay. use the controller changed event.
Seems to be in order, I have no clue why begin play won't be called.
As long C_Character is spawned
Check GameState and GameMode's parent classes.
Begin play without a doubt should be called
GameState/GameMode, and GameStateBase/GameModeBase
my game state's is game state and game mode's is game mode base
sorry missclick i was responding to that message
Change to game mode as auteur says
Reparent it
But that's to do with possession
Begin play should be called either way
Authaer suggestion is great though, you want to bind on controlled changed
Your game is single player?
Also I forgor to mention, that this part of the code in my character works, unlike other
yes
how?
They are using the legacy input system, not the enhanced input system
We suggest him to use enhanced input
And he tried it as you can see if you scroll more
i was about to start setting it up but i realised that begin play isnt working
oh
you have a breakpoint on the beginplay and it doesn't hit?
I have no reason to believe begin play doesn't get called unless the actor is not spawned. Can you screen shoot the code?
GameMode and GameState mismatch can stop Beginplay from being called as well.
Did you print string after conditions or something
do you have print string in beginplay?
Right
of begin play?
0o didn't know that. I guess begin play gets called after game mode finished its thing.
Have you tried to print anything on beginplay?
Reparent your game mode. Go to your game mode, click class settings, pick the class from the drop down.
so what do i do?
If its working, then maybe you selected another debug object
and this is why it doesn't hit
Honestly. I'm shocked that the GameModeBase class doesn't have some simple validation in it to check it's set GameState's class.
Yeah imo it's kinda a common trap a lot of people run into
i did it and IT WORKS
It's a few lines of code for the validator too. :/
THANKS β€οΈ
Isn't set by default?
i've been struggling with this for past few days
Problem is people trying to extend game mode but they pick the wrong class
It is. But you can't mismatch them. You can't have GameMode and GameStateBase, or GameModeBase, and GameState.
basically the Base can be used for simpler games that are not focused on multiplayer and GameMode(without base) has some functions already can be useful for multiplayer and these can be overridden.
Made this system with blueprint to be able to swap characters mid game. I have the idle characters playing a random animation. Two questions: First, how do I make it so the animation keeps looping forever, right now it just stops after doing it once. Second, is there a better way to stop the animation from paying when you reposses a character mid dance, you'll see my current bp set up at the end of the vid, it works but seems redundant. Thanks!
@mortal canopy go to your montage track and take a screen shoot
There should be a little tickbox next to your montage section.
By default there is only default
Default -> default will loop default section forever.
It shows it looping in the player
No
See montage section tab at the bottom right of the screen? Click that.
And just do what was said above to loop the default section.
Afterwards read docs about montage section for further uses.
worked great, thanks!
Any feedback on this bp system to stop the animation when reposessing, seems redundant to me but works great.
Don't select anything for the value.
Keep it null, it will just stop what ever montage being played.
If you hover over the node it actually tells you that.
Worked! thanks again
My feedback would be , if it's multiplayer (judging from the video I seen) your code shouldn't work.
As in machines are not guaranteed to see the same animation.
If they are playing the same random anim then it's by luck not design
Good to know
interesting, so how would I go about hard coding it for everyone to see the same thing
You dont need to hardcode it but everyone have to agree on what montage to play.
So if you want to pick random anim, then let server pick the random anim then server can replicate the montage it selected.
What you are doing right now is. Hey everyone run this function that pick random anim from this array.
So each machine may end up with different animation.
I'll keep that in mind when I implement multiplayer, right now I'm just prototyping systems for a game idea
makes sense
Thanks again!
guys i have a problem again but this time my ai cant move anywhere because everytime i use ai move to it says it aborted even tho there is a nav mesh and this ai character has ai controller
@elfin jasper press p or open console and type show navigation.
Look under the A.I
Is everything green where it stands?
If not then some component is affecting the navigation in the ai character.
under the ai there is a blank spot
Yeah then it wouldn't be able to move
Yeah it's trapped
so what do i do?
You have to untick affect navigation on the component that have it switched on.
Maybe try the capsule component for a start
whats this option name
i mean there is this one but it is alredy unchecked
Look for other components
It's per component setting afaik.
Check your skeletal mesh and other comps.
unchecked it in all of the components and the blank spot is still there
Delete the instance in the level and place a new one again.
Might not pick up the changes
Build -> navigation
Or just move the navigation mesh bound around i dunnoe
Google it π
Why do you have to rebuild the navigation mesh?
it tells me to
you probably need to switch navigation mesh to dynamic so it updateds
this is pretty good
hard to say, didnt test it so much yet
Sure we can update the frequency but it won't do much for my character to characters collision that need frequent update.
I end up using static navmesh still, roi for avoidance and EQS to pick best locations
i have dynamic modifies only though
im pretty close to diving into this but so far I would say its acceptable compared to games made in 2005, its better for sure haha, definitely will need to dive and make some custom avoidance or whatever, not even sure what I will need to make
Using lazy gathering also helps a lot.
I also wouldn't recommend using navmesh for AI avoidance. That kind of dirtying isn't good.
What are lazy gatherings?
Like async?
At the bottom
I am unable to access any info from the buttons in the list view. Nothing works from taking it out of array elements.
Why do you care about the widgets?
because i need to know what widget / button is selected/ in focus.
I can do on key down but that isn't what I want to do.
Why not just get the selected item? What do you need it's display widget for?
How do i know what item is currently selected?
Get is a GetSelectedItem on the Listview. It'll give you the Object back that you originally put into SetItems or AddItem.
I run into the same issue where I have the Object but am unable to get any data from it.
I'm not following. Is that not the data from the object in your first screen?
it is, but I cant pull any data from it. I don't know any blueprint node that will tell me that data.
It's an object. It's just returning as UObject type. You have to cast that back to it's actual type. Your BP_ItemListView, I believe.
I think i got it. I have to cast it back
yeah
IDK why i have to if it already know what uobject it is.
thanks
Because the person who wrote Listview cannot know your type. They're handling the object in the lowest class they can, they don't know about your BP_ListView, or my UInventoryItem, or any other item a dev can make to put into a listview. So it's up to you to just do simple casts for the handling on your end.
Is there a simple way to check what mode I have toggled in this? Trying to use the "Default Player Start" for whatever checkpoint I have selected per gameplay needs, and then the "Current Camera Location" to act as expected.
Hello, I need your advice. I'm trying to create an interaction system similar to the one in Abiotic Factor. I want to use a single key for both press and hold actions simultaneously. However, the problem is that while holding the key, the press event keeps firing continuously. The press event should only trigger if the hold time hasn't been exceeded; otherwise, the hold event should be called.( understand code working correctly, but I need press event fire only when input key was released(I mean check)
Attempts: I tried using input start and complete but when holding the key and moving the crosshair away from the object, the hold time continues to count up, even after releasing the key."
For press you just use the cancel pin
Assuming youβre using a hold trigger there should be no reason from you to use ongoing
what type of input to use better for it. Currently i use on release. Hold has static threshold, but I have different threshold for each item
I just told you
Hold trigger
Triggered pin for hold action. Cancelled pin for pressed action. Done
Ofc thereβs other ways to do if you really want to or it has conflicts with your use case
Adjust the hold threshold as needed
Yes I got it. How to set up holdTime for each interactable in Hold trigger. As I know impossible to change dynamically threshold. Its the reason i don't use hold trigger.Maybe there is different.
your cast worked appreciate it 
I did it like this:
I created 2 input actions and added them to IMC with same key.
One input action for press i left as default.
Second input action for hold I use modifier hold and check to one shot. (Time as you wish).
Now create interact interface with 3 functions for press and 5 functions for hold.
That way you will have FULL control what can happen when and utilize full potential from enhanced input action.
Functions for press input action are started, triggered, completed.
Functions for hold input action are started, ongoing, triggered, completed, canceled.
Now When binding input actions In player class call appropriate functions from interface. And you can just override functions from interface in interactable actor to decide what should happen when its pressed and hold.
If you are worried about threshold Time you can dynamically set it but its static, what doesnt really matter if you check and change it everytime you interact with new item.
And you can change dynamically threshold if you get modifiers from input axtion loop with break them and cast for hold type to get this modifier properties and change threshold
Appreciated for explanation
I hope is not very confusing because i just woke up in the middle of the night and saw that maybe this is where I can help. π
Hey, I'm new and I'm trying to figure out how to replicate this for the player character. Any tips would be appreciated. (I'm working off someone elses project)
I'm working on a blueprint that brings up a sequence list to listview and plays it. I'm not sure where to get it from in duplicate
is there any check if a component/actor is movable? is just the simulate physics?
movable not if moving
There is a node called "Set Mobility". It has an status input as EComponentMobility Enum. You can create an equality check from that to create a branch off of it. Just an idea, have not tested it.
Quick help please: I have a "Set Timer by Event ", Event is defined by linking. What would be the best way to link to Events in the same blueprint without connecting the delegate pins directly? Or is it as with outside events: create delegate Events?
There is a node called CreateEvent. If you drag of the red square input of SetTimerByEvent and type CreateEvent, it will appear.
Using this method, you can also bind functions, as long as they have the correct signature.
Hi why does my ui distort messing with anchors hasnt fixed it
Im not sure that the distortion is very clear from the screenshot. Are you saying that your UI is stretching along the X axis? As an exaggeration:
Thank you very much
yes some of the elements are moving over
Your going to have to explain in more detail then that. If elements in your UI are shifting/resizing because of differing screen sizes, then it has todo with your anchor setup, incorrect positioning, or lack of proper size box use. There really is not much I can say without seeing and debugging the setup.
is the anchor bottom center? and if so is the position 0 at bottom?
#blueprint message Wondering if anyone has an answer to this widget interaction component
Basically just trying to make a system where my players can interact with a book one at a time, the book will show a widget on the book that is locally navigated
They do have their own discord. Why not ask there?
Considering their plugin is a paid one, I wanted to find out if there are any tutorial related resources to achieve something similar and also not to rudely walk in and basically ask for their stuff for free lol
Mostly you set up the interaction system with an extra addition, a bool stating if the system is in use or not.
There's also the additional replication of the widget interaction component and network ownership going to the player interacting with it, the question is how to go about it
replicate all server and clients
so can have also ownership list besides the bool if needed, and if owner choses to close interaction set bool off and ownership to none for example, can be an enum or an array of players
I suppose I can try that but the player input will also have to be tracked for when they decide to leave interacting with the book, hopefully setting input up will work
hey could somebody help me with a problem im having?
im developing a weapons system and im now working on the ammunition part
i have a struct with all the values for the gun
i reduced the ammo amount in the struct everytime the player shoots
and made it print
but the value decreases once and then stops
i set current ammo as 5
it reduces to 4
then does not reduce anymore
any help would be appreciated
It's not visible in the screenshots where you decrease your amount. But that set weapon struct at event-tick <= 0 is not optimal (if it's not only for debugging).
Looks like it should work, are you setting the CurrentAmmo anywhere else?
im preety sure not.
Hey guys, does anybody knows why animations work in the retarget (from mannequinn to metahuman) but then if i select in "Retarget Pose From Mesh" that retarget file in the ABP i created then the animations don't work? the preview remains static? and in game they do not work
i only check if ammo is less than 0
You can add a breakpoint and check if you really pass it second time.
Make sure you're not setting the members of a copied struct
ill show the entire structure of the system
It doesn't look like this is the problem from the screenshots, but it's zoomed out so just in case
If it's a copy struct it won't set correctly
ok lemme check one second
this is how it works
i have a function in the gun object
that when picked will be ran in the player
if the left mouse is triggered
IT WORKS!!
thank you so much dude
If you don't set that it just creates a copy of the variable
so changes won't be propagated back
if you set by reference you're manipulating the struct directly without making a copy first
It's easy to miss as most tutorials out there don't even mention this feature
Hello, I have an issue with a Texture2D I'm trying to load in a BP. If I wait for the project to load and run the construction script by editing something like the transform everything works. If I boot the engine and print the display name, path etc. that also is correct. If I'm looking at the actual uasset in a hex editor the values for the asset is correct.
But when the engine boots and the construction script runs, the image x and y size is not correct. It's always 32x32 regardless of what image I have set in the editor. This is only true when the engine boots and not otherwise. Since it's a construction script I can't just delay the execution. How do I solve the issue where I need to run the construction script with the correct data when the engine boots?
hm, maybe try to force load the asset?
how would I do that? I'm a bit of an unreal novice
so this is what I'm doing now, and it still gives me the wrong size :/
That looks like you getting a soft ref from an already loaded ref to then try and load it again. π€
well the asset is set in the level as a property of the blueprint. It's loaded from the uasset associated with the image file. But at the moment the construction script runs when the engine is booting, the size it gives me is wrong and the vertices I'm generating using it are also wrong...
The construction script runs after it's loaded everything it needs. What are you setting the image variable on?
In my construction script I have an exposed Texture2D variable. In the editor I select my blueprint in the outliner and set the Texture2D to one of my textures from the content drawer. The size is read correctly and everything looks good.
The next day I load the level and all the BPs are tiny because they're all reading a size of 32x32 instead of the actual image sizes (256 to 2048 typically). If I recompile the construction script without any changes so that it runs again the right sizes are read and everything is back to normal, but I'd like it to read the right size the first time.
Show where you call the 'GenerateQuadVertices' function.
Here you go, I can explain anything in more detail if you want
It could be using the class default value instead of the instance value. Print string the name of the texture to see what i gives you.
yes it's printing the name of the texture that I set. Like if I set the texture to crazy_frog.png and print, it gives me the name crazy_frog for the texture and content/images/crazy_frog.uasset as the path, but the size will be 32x32
If someone could please help
Im trying to package my game and it says βunknown cooking errorβ
How do I solve this
If itβs unknown I donβt have any clue of finding out what causes it
Last time i tried to package it went fine so how did this happen???
scroll up on the output log and look for any errors
Iβll try that
Any other tips to avoid this in the future?
idk, that error can be caused by many things
best you can do is to find and read the errors
Quite literally what Spynora said. But more specifically. Clear your Output Log. Start a build. And when it finishes, literally search "Error", you'll find a few usually and you can go through and fix them in order.
Iβll do that
Thank you both :^)
With it being a hard ref, it should already be loaded so I'm not sure what would be causing it to return the wrong size.
yea I'm trying this also, but it's also returning me 32x32 no matter what when I open the unreal level. There's no mipmaps or weird settings, the project settings are pretty vanilla and I don't have any kind of mods or 3rd party modules installed.
Can you show the texture settings? Cause that really sounds like mipmapping. It wouldn't return 32 without a texture, it would return 0. One thing to try is to set the texture to never stream, and maybe also set it to UserInterface2D, which is misnamed. It actually means that there's no compression.
sure, this should be all of it
Actually there seems to be some code here that is returning a temporary default texture.
are you looking at the unreal source? Or something in my settings
Source. Given that it's so early, there's a chance you might be running into that IsDefaultTexture being true.
int32 UTexture2D::GetSizeX() const
{
if (PrivatePlatformData)
{
#if WITH_EDITOR
if (IsDefaultTexture())
{
// any calculation that actually uses this is garbage
return GetDefaultTexture2D(this)->GetSizeX();
}
#endif
return PrivatePlatformData->SizeX;
}
return 0;
}```
bool UTexture2D::IsDefaultTexture() const
{
return (PrivatePlatformData && !PrivatePlatformData->IsAsyncWorkComplete()) || (GetResource() && GetResource()->IsProxy());
}```
If it hasn't completed it's async work on the texture, it'll return a defaulted one until it is done.
This bit though. π
That looks exactly like my problem. But I don't want to use garbage values π¦
It might just be an editor issue as the way it loads/unloads stuff is a little different then in a build.
You could try switching to a different level and then back to see if it it applies correctly. (It doesn't always unload stuff when you switch levels in the editor)
so if I want to use the built-in texture 2D in the editor I see there are a few options...
- edit the source code
- make my own texture2d class
- store the size when I load the texture in a separate parameter and use that instead if the size returns 32x32
Am I missing something? 
Out of random curiosity. Could you try dragging off of the UTexture2D, and before anything else, call GetCPUCopy?
You don't need to do anything with it, just call the function. It says it'll stall until the texture is ready, so I'm wondering if you could stall the gamethread just until that finishes. Since this is an editor only issue.
It didn't seem to do anything, unless I'm misunderstanding something. I'll try changing the object reference type also to not be soft
I don't know if that's actually calling anything though, since there's no execution thread and I'm not using the return value? I'm not sure how BPs are compiled
wait till the resource is ready!?
at least in cpp there's methods to check it
Are you on 5.5? You can right click it and show exec pins.
Hi, i have got a weird issue, I have this GeneratingPlatformBP that basically spawns a new platform when its collision box is overlapped by my player vehicle blueprint. When i try to add a random rotation, i get a infinite loop detected error? Heres the script. (UE5.5)
Im guessing its a bug?
probably because the rotation is enough to cause the new platform to immediatly trigger the overlap, spawning a new platform, spawning a new platform, spawning a new platform
Can i even debug what happens?
Okay, i changed it so it randomizes the Z position of the platform, and it still gives the infinite loop error?
gtg
First off that's not spawning a new platform when it's overlapped by the vehicle, it spawns a new platform when it's overlapped by ANYTHING
Yes, 5.5.3. I will try it but unfortunately I ran out of time today. Thank you for the help though!
If you can explain to me how I'd love to do that!
Hello! I have a question, In my game I have this interactable actor, however the way i have it setup for now only works when I have one in the level at a time. The widget only correctly works on the first one I place and I have no idea why, i have some screenshots to attach and lmk if you need any more details about something!
Here is a video of it in effect, as you can see only the left one gets the widget correctly popping up, even when i look a tthe other one
'
It feels like there is something obvious Im missing here.
I want to be able to copy however many interactables i want across the map and they all act like their own unique actor despite just being a copy of the same one.
Got a quick question about saving! If I wanted to save my actors location (can already do) but at end of play, whats the best way around this ? because in the gamemode - at end of play; the character has already been removed so it results in 0, 0, 0
EDIT:
i know i could add it to my "quit buttons" but was thinking in the case of someone force quitting? more ofa question of curiosity
Any tips ? ^^
Hi i have this ui widget and when i press the 1 key the mouse gets unlocked and i want the cursor to follow it but when i do this code it is at a weird offset ?
widget origins are at the top left corner of the widget
how do i fix it ?
On End Play, it returns why it's ending play such as being destroyed, level transition, shutdown etc....
Subtract half of the widget's scale from the position
How do i do that ?
A lot of geometry conversion.
You need cursor image's geometry to get it's local size. You might be able to simply multiply that by 0.5 and subtract it from the absolute to local, assuming there's no extra scaling issues between their spaces.
Each lantern should have it's own widget. Or you have to get that Widget and fill it up with info each time you hover over something. These are widget components right since they are in world? Just make each lantern create it's own widget and should be fine.
Oof. Widget components for interaction stuff. We had that on Red Solstice 2. There's a reason I hate widget components. π
yeah i can use the switch to determine different save variables; but im not able to get my actor transform variable as hes already gone
Hmm so i would have to spawn the widget to the actual lantern i am looking at is what you are saying instead of just manually adding it to one of the lanterns?
do you use the create widget or spawn actor node for adding a widget comp?
I am really bad at communicating between widgets and bps, idk why it just feels way harder than normal bp communication.
Realistically you should have some form of interaction system that has some form of idea of "Hovered" and "Selected". I did this in a generic way that I use in a lot of different game styles from RTS to FPS. Hovered in an FPS is looking at something basically. And in an RTS and a FPS/TPS game, you want to see info of what you're hovering. Whether it's your mouse cursor or your crosshair. So you track what you're hovering and make delegates and such for when it changes. One of these things can also move around a widget component to the currently hovered thing in your case. One single widget component, instead of having many. And when you have nothing hovered that can be interacted with you simply hide it away.
Yeah I do have a pretty solid interaction system, i just think i went about the whole text floating above the thing wrong, right now i just manually add a widget component, then hide and show it depending on if my linetrace hits or not. But If i actually add it on hitting and destroy it when not that should also grant me more performance right?
cuz lets say i do have like 500 interactable objects, if i didnt load and destroy and instead just hide and show, all of those widgets are still loaded into memory?
Should be better, generally. Less widget components is always a good thing.
No widget components destroy their widgets when invisible
And widgets don't tick while invisible so even if they were still in memory it would be much of an issue
Damn I wouldnt have guessed that, thank you for the information. I will keep that in mind.
But if you're already adding the widget comp on demand I wouldn't get rid of that system
It's still a good one
Hi,
Can you get an array from the 'get field' node like shown in the image?
In my project it only functions in-editor, but not in the packaged build. If it is a 'normal' variable instead of an array, then it works fine.
(I'm using Unreal Engine 5.5 and the built-in json utilities plugin.)
You can
Not sure why it wouldn't work in the build though, at work I use that exact node for arrays and it works fine
In-editor the values are for example: "string01", "string02", "string03"
But in my packaged build it is: "", "", ""
If it's not an array, then it gets ready just fine in the packaged build.
The node says that the reading was a success and it read how many members the array has correctly, but the values of each member are just the default value (if it's an string array then it's "", it is 0 if it's an integer array).
You can also just have 1 widget component associated with the controller or pawn that just teleports around and updates
What version are you using?
5.4.4
Hello, I'm trying to pass some ActorsToIgnore into a LineTrace and I'm doing what's in the picture. I'm sure this will work, but it made me wonder about the length of the resulting Array, and it's coming back as "3". Presumably, this is doing something like storing an empty pointer for index 2. What would be the simplest way of getting rid of any null, empty, or invalid values from the array? Is there a node to do that?
You can just right click on the index 2 pin and remove it
''Is Valid'' node is used to check if a reference is null or not, but you should't need it here if you remove the index 2 anyway
Are there anyway to access a blueprint component from C++ class, for example I have UImanagerComponent in blueprint created, and i need to access it via C++ ? Is this even possible
no
and wrong
Isn't it one way?
FindComponent says hi.
also this, but if the component is made in BP you end up with reflection again
Anyway, I needed for proper regular workflow, not going to go for reflection etc. π
TBF I'm not sure if BP created means placed on something in BP or if the component has no C++ base.
If you force it sure but it was by design made to be one way afaik
Alright, thats much more clear, thanks guys
Is this disabled "Add Call to Parent Func" because i dont have BeginPlay on my c++ player controller, or it is not allowed, so that it will directly be called, and then this blueprints begin play will be called
you can just drag off pins to enable it
I meant "Add Call to Parent Func" sorry
C++ begin play runs first, and then the bp begin play
So If i want to not override C++'s begin play in my blueprint, is that possible in that case?
I should have been clearer that I know this is why the result is "3", and this is just an example. I wanted to know how I'd remove "invalid" items from the array. For further clarity, the resulting node setup still prints "3" and I'm not sure why:
You can create a function and expose that to bps
Not sure if you can expose the BeginPlay directly
Never tried it
Alright! Thanks
For some reason when i try to resume the game only the audio starts playing the game remains paused and can't do anything
Because you're not removing the index from the ''Object Array'' array
You're trying to remove it from the ''Make Array'' node
Ah, thanks!"
Is it the game not unpausing or is it the player not receiving input again?
Try set ''Input to Game Only'' on the controller when you unpause
Anyone know how you could go about disabling tracking/input on the widget component for other players if they're not the owner of the actor the widget component is on? Trying to make it so that other players can't click or press on the widget while someone else is using it (set with a player character object variable and Set Owner)
Easiest solution would be turning off the collision of the widget component if they're not the owner
But switching the owner for interaction is not a good way in general
QQ:
Is it better to have multiple save slots (one for time of day / one for stats / one for location ) ? or all in one ?
Depends on your game and preference
Cant really say one is better than the other
I'd prefer an all in one though, when you want to send a save file to someone it's easier
But multiple slots are easier to work with
Am i correct in thinking; if its 'all in one' and you split up the loads (in different blueprints - like level loading time & bp_char loading stats) if they run at the same time it can bug out ?
How you'd handle it depends on your implementation of the save system in general
I would not do multiple. A save game should be a savegame. It's a concept and should be kept whole. The only time you should use multiple is if you have a separate entire concept. A user's control preferences is an entirely different concept than their game progress. And if you allow multiple saves, you'll have a really hard time tracking all of the correct saves for the correct playthrough.
I noticed that I'm getting the following warning in the log when packaging my project: "UATHelper: Packaging (Windows): Warning: FJsonObjectWrapper::ImportTextItem - Unable to parse json: () | PackagingResults: Warning: FJsonObjectWrapper::ImportTextItem - Unable to parse json: ()"
I didn't notice it when trying the package a project in 5.4.4. Maybe that is the reason why it doesn't work for me.
Does someone know what might be causing this?
so instead of Char_1_save & char_2_save you think it'd be better to have Char_save with multiple variables like char_1_agility & char_2_agility ?
Probably not, I get that warning too when I'm packaging but all the json related stuff work fine in the build. also 5.4.4
They'd be in an array instead of being multiple seperate variables
If these two characters are in the same playthrough, then they should be in the same savegame. You should have some form of data structure in place to make it easier to save multiple things into the same savegame. EG if you have two characters, make a struct that houses everything A character needs, and make both create a separate struct and put it into an array, or into specific properties for those two characters.
This concept kind of gets easier if you get into C++, and just do basic object serialization and replacement code. I really do not miss having to manage two sets of data structures, gameplay and saving stuff.
That's why I just use json to save my games
SaveGames are a pain in the ass to work with in bps imo
They are. I really wish Epic would expose some very basic byte serialization code to BP. You can already checkbox the SaveGame property in BP. May as well be allowed to serialize that to a byte array and write it back to an object of the same type.
First of thanks all for the advice! π
Secondly; my current setup is this:
-account save
----proffesions (saves across all characters)
---- time of day
---- Player location
-char save (multiple)
---- Stats
---- inventory
---- level
---- equipped
-level save
---- dropped items
---- mob spawns
---- respawning nodes
Thats all i can think of top of my head; you guys reckon i should merge it all into one save? sorry for all questsions; want to get saving all sorted and neat ! π
This all looks like a single playthrough of data, so I would say that it belongs together.
How can i calculate a full circle of Y pitch? it always resets at 90. Is there a way to do it simply? Tired of branches because i need the circle to go back also.
you can still make those different structs in a single savegame
How do you mean calculate? For what usecase?
I have a ring that rotates when pushed. I want to get its full rotation so from start 0 to end 360. The player can push the ring back also so it can go from for example 270 to 40.
ok so what's the problem exactly?
I think i get it; save multiple structs of data for each character (structs being what needs to be saved)
Have the structs in an array with names
What makes it get stuck at 90?
rotator makes it stuck at 90
Can you show code
You probably don't need quaternions for it, but we can't just blindly guess what the problems is
show code
A rotator of
Roll = 0
Pitch = 100
Yaw = 0
Is actually
Roll = 180
Pitch = 80
Yaw = 180
There is no such thing as pitch outside of -90 to 90. If it is, then it swaps roll and yaw.
so you saying authaer there is no other way?
just count the when rolls and pitches change and divert logic?
I would maybe consider changing your axis to Roll instead of Pitch if possible for what you're doing if you need this functionally easier.
yeah thought so but i thought maybe someone has a nice fix
welps change the whole bp then :;)
You can also set the rotation with a variable
xD no shit π
setting the pitch to 90+ the engine will automatically handle the swap for you
yeah i dont care about the swaps, but i need numbers from 0 to 360 in pitch
but i guess i have to change rotations now
ahh merging actor just 90 degrees should do it.
Is this what you meant? π
Im assuming those are in a struct, yeah sure
Hey folks, I'm having trouble with a Python script in UE 5.5. The script is meant to interact with a Spline Component, adding new points based on user input. However, when I run the script using the 'Run Python Script' node, it doesn't seem to interact with the UE object, but basic print statements and calculations work fine in the console. I've enabled the Python plugin and Utility Widget tool. Any ideas what I'm missing?
it worked thank you
how to get rotator to count to 360? same problem with roll now but it is 180 the limit
There's a function for that somewhere. Don't remember the name
Map Range Clamped probably
clamp angle?
It's axis specific for rotators. It converts -180 to 180 values to 0-360 space.
Try ClampAxis?
was it normalize axis? nope it clamps to -180 to 180 lol
ahh clamp axis
dont remember the name
yeah that did it.
I wonder if there is one for this Pitch too.. like -90 90 values to 360 ;D
you can still map it
map range clamped
wait no nvm
it's a pitch that wouldnt work
Yeah, you'd need to check if the yaw is negative and do some calcs for the pitch
but it's ugly
I'd just keep the angle as a float variable in that case tbh
That way I can keep the angle my way and make it go up to 360 if I want
Instead of relying on the rotation value directly
im ofc keeping it a variable, but really the problem disappeared using roll and that clamp axis node.
Hi guys, how do I make a loop working until an integer value reaches a point?
For Loop
i need a loop working while the integer is more than zero, because things in the loop will subtract a value from the integer
yeah then you need a while loop
i made something like that but it doesn't work because of an infinite loop
and unreal doesnt let me run it
i need it to happen every second
Thats also an option
you good, I got the idea
Put everything into one save class and just save it in different slots based on ''Profile''. So you would maybe need 1 save for everything and 1 save for profiles. So first you load profiles, and after you load profile loads the slot of saved game. At least it's something that I'm doing.
Hi all.
Got a question about using Interfaces and Event dispatchers together, mainly just wondering if its a good route to go down im currently tip toeing in. Cause trying to research it seems to just say "which one to use more" with some mentions of using both.
So far my current plan to use both of them together is:
Collison Test -> Try to call Interface -> Interface in player calls Function in attached Component -> Function calls ED -> ED In Player allows different response.
It seems a bit round about, since i called get the collision to test for the component and skip some of the roundabout. But it seems to remove any dependencies by a lot, by only checking if it has a interface and nothing much else.
It seems to work, be able to be overriden and - well no issues in the simple function calling.
Yeah that's a very good way of doing it
Very scalable
But it also depends on the context.
Like for example if that overlap is only for adjusting Exposure and it's always meant to be used in conjuncture with the Exposure Component -
then in the overlap I'd get the Exposure Component of the overlapping Actor and call the Add Composure Value function on it directly. No need for any interface or delegate
But if that's not 100% always going to be the case, then your method is the way to do it
Hm alright, cheers!
I was a bit concerned that i was over thinking it.
hey all, I have this JSON object with parameters like "stream1", "stream2" etc. How can I get all the fields. I can only execute get field for one parameter
Get Field Names if I remember correctly
this returns an array of field names but not their values. Do I need then to loop through that array?
yes
hmm I loop through them but I have now the field names without their values.
call Get Field on the names for their values
awesome! ty!
now I have 3 text boxes where I want these values to be displayed. How can I pass these values from the loop to each box? Is there a way to create an array with each box and somehow link the values?
Hello Sourcers.
Ain't the first time I introduce this subject but please bear with me. I'm still struggling woth it because i don't want to rely on a plugin to achieve this, a timeline without using an actual Timeline Component which, as you know, we cannot use within another component but it's exactly what I need.
I've found out someone created a timeline component substitute of it in a macro but didn't share how he did that. So I've been trying myself but failed miserably so far. Was that just a troll or is that, as I believe it is, actually possible? Did anybody find a solution like that?
All I managed to achieve so far looks exactly like a timeline Component...
...but it needs all the actual funcionalities of a timeline component.
This is how I added the Timeline component into my own component creating the reference to it...
...while this shows how the macro looks like.
Any hints on how to add what it's missing!?? All I have are attempts...
Actually I didn't try it yet, I mean... I'm kinda sure something in missing like curves and other nodes like Set Timeline Length, Set Timeline Finished Func, curves...
Also... I didn't find the way to actually call that node within other BPs...
If you really need a timeline you can create an object with a timer in it that mimics the functionality of a timeline
I'm kinda lost...
Here I made one for you
It's an object
You just spawn it in and call functions on it
Update and Finished are dispatchers
But it only works with a single float curve
I have this JSON object of stream urls which I can now get the values for each stream. I also have a variable array of stream media sources. How can I set the source for each element in the streams array?
I know how to do it for one but I can't figure out how to do it in a for loop
Thanks, I'll definitely have a look in there...
One of the uses I was trying to make possible was, for example, having a smooth transition between transformations of a body's skeleton which cannot be created otherwise like by an animation.
blends?
Like standing on toes using the very same walking animation
You can probably do it in an animbp
In any case whenever creating a component
uses are many, not having the possibility of having a Timeline actual component within another component is a huge limitation when creating modular systems relying in components quite massively
Well you can use the one I sent u
modify it to your needs
But keep in mind it will tick in the background even if it's not running
You can set the tickrate on spawn
I can make a one that doesnt tick in the background I dunno why I didnt make it like that from the beginning tbh
never used Objects before. I'm searching for some tutorial about them and how to invoke them within another BP
This is the usage of the one I sent u
I'll make another one that doesn't always tick, the usage will be the same
Oh ok, I see now
This one doesn't tick when not running
It's the same I just changed a few stuff
Hi i'm having a little trouble, I'm trying to make a survival with the template topdownview, so far I haven't had any problems until I added βInitializedInventoryWidgetβ. Basically everything works, I can move around with ZQSD and add items to my inventory, but when I use the click to move around sometimes it lets the information through and sometimes it doesn't create this kind of hitch. I'm sure the problem is really super simple to solve but I've been working on it for a while and I'm tearing my hair out ahah. If you have any solutions I'd love to hear from you. I'm fairly new to blueprint so I follow tutorials and there's definitely something I haven't figured out yet that's blocking me.
what does InitializedInventoryWidget do
Sounds like an input mode issue to me though
If you have a canvas on your widget make sure it's set to Not Hit Testable instead of Visible
Thanks again...
...I'm learning a lotta new stuff from those and I noticed I wasn't probably too far from some of the logic I see there compared to what I was doing. it definitely helps me putting all pieces finally together
I got it working but is there a simpler way to do this? Set the source of stream media sources and the set it to media players to play?
I dont think that will work
it will just play the same video on every mediaplayer
hmmm
And your foreach for the Streams array isn't even plugged in, will always return the first index
Do you have same number of Streams and MediaPlayers as well as URLs?
Im assuming you need to set assign a different URL to each one?
That's what I've got, I'm sorry and the screens aren't necessarily in the right order.
AND to be more precise, the tuto I'm following uses a key to show and hide the inventory, in my case I'd like it to be always present.
yes same number and different URL to each one
There's nothing that would cause the issue you're having
It's likely an Input Mode issue
If you have a screen-size canvas in your widget that is set to visible that may be causing it, might be setting the input mode to Game and UI
Which will make you need to double click to do any action in game
other stuff might also cause it but it's not in the screenshots
But I'm not very familiar with Common UI, it's possible that it's something else entirely
You found the fact that I have to double-click to perform the action of moving and I hadn't paid attention to that. And it's really when I plug in the βInitilized...β that I have to double-click to move.
It's probably related to the Game Inventory Layout widget
You can try setting the Input Mode to Game Only on the Player Controller after you call the Initialize function
which doesn't work either, I'm not really sure what the problem is
Like I said check the widget itself
I'm so lost again... didn't figure out yet how to actually use that object... I mean... let's take this example...
Refer to this image again
Drag from the object and assign an event for Update
I dunno, maybe I didn't get everything... I mean... i can use that object within my component and having the actor calling that event from there?
I found it man! just uncheck it! thank for your help !
You can call it anywhere
the object can be anywhere as well
ty! I was not aware of the GET.
So im trying to play a looping animation in UMG, and it stops looping after a few sequences and I cant figure out why. YOu can see the green bar looping just fine, but the green dot widget stops looping for no reason (i am not calling Stop Animation on it anywhere)
Screenshots of the Animation settings below. The green bar and the green dot both have pretty much identical blueprint events/animation assets for them....
Tried changing the Play Mode. again, green dot just loops 3 times then breaks
There's something I feel missing and I'm not finding the way to explain it... the only way I can see that working is having the TimelineObject invoked inside the actor's BP and connecting, in this case, the update/finished event to the actor's MoveWall event... but what i need is to simply do that inside my own component instead.
I dunno how to explain that better
Using Render Opacity instead of Color And Opacity has the same issue...
Hi, I'm wondering why I can pass the output pin of a CastToPlayerController node into the input of a Set node for an Actor variable, like in the image. Where is the magic happening that means this doesn't fail?
Heyo! Need help finding a solution to animate the camera during a player death in first person. I found a tutorial showcasing a potential solution, but surely there's got to be a better option? Throwing the question in here too in case anyone knows of a better solution #1350266805415055484 message
Create the object in the component then
Though you can have still the object on the actor and still bind events to it in the component
I did but dunno what I was doing wrong there. In any case I believe my solution did actually work!!!! I can't believe it... π
I've tried to play it and it did...
I've spent months, probably half a year, trying to figure out how to do this
You helped me a lot by the way, I believe I can use those functions you created, to further implement my solution. I'll definitely experiment with them and see what I can achieve. So thanks @runic terrace , a lot!!!!! π
Player Controller is also an actor
That I always knew π€£π
I did but dunno what I was doing wrong
Please keep message in this Server either way. We have a rule against unsolicited (not asked for) DMs.
You can always create a Thread in most channels, if you don't want to deal with the other people talking in between.
What I don't understand about your issue with the Adding/Deleting Asset is: Why are you doing this during Runtime?
I'm pretty sure once you package this it won't work anymore.
And if not, then it's still strange to do that. You should probably keep track of your entries in some Runtime class and add/remove from that.
How would approach a structure like, I have many interactable items, like pickup items, door etc in my game. They have Gameplay Tags like Event.AddInventory, Event.DestroyAfterInteraction.. But i check those tags inside the "Interaction Component" where we line trace and call interact method, then i check the events there. But in time, It will be spaghetti to add logic there and i think its against Open-closed Principle. What do you think I should apply that logic, inside BP_PickupItem for example? And access my inventory via blueprint interface like IInventoryOwner.AddItemInventory and pass its own data? I want to make this scaleable as i can. I am also using GAS for now to apply some buff effects like some of the pick up items wont be added inventory and apply effect directly, like "a POTION" in a ground.
Like this. (picture is Interaction Component and owned by Character)
So, you should 100% handle the Interactable specific logic inside the Interactable.
The only code in the InteractionComponent should be the one start/stopping the Interaction itself, without knowing what the thing you interact with is or wants to do.
because I need this in real time
Generic actions, like "add to inventory", can feel like a copy paste, but in theory a lot of this will be the Interactable getting the InventoryComponent of the "InteractionInstigator" and call AddToInventory on it with "self".
If you still find yourself having duplicated code for those actions across a set of Actors then:
- Make sure they share ParentClass
- Or move the overlapping code into a static FunctionLibrary
- Or think about a system that can perform re-usable actions, such as UObjects that have the logi in them, which you an simply create and run if you need to. But that might be overkill in your example.
What is "real time" for you here?
You need to understand that the Asset stuff is an EDITOR feature. While a good chunk of the AssetManager still works in Runtime, creating/duplicating/removing Assets should probably stay within the Editor, so nothing that you'd do during your game.
Real time this is real time. I know and it is saved, only problem is that I do not know how with node to delete them. Because with node I can add and duplicate βDateβ, but I can't delete. The only option is to delete in the editor by selecting and pressing delete
Hmmm so it is problem that I can't removing during game.
You probably can't even create/duplicate during the game, cause those nodes might not work in packaged.
Alright! Then i will just call Server RPC then Interact of interactable.. They should do the rest.
Wait ? I don't understand. How I can't create duplicate during game how I can do this.
@flat jetty For something that shouldn't be predicted by client, normally you can think that Client should "Request".
Request to Open Door, Request to pick up item, etc.
Server handle the logic
and replicate the values if valid. E.g updating the Item array if the item can be picked up.
I think ParentClass would be fine, it can check its tag, and directly call via that. Or i can crete BP_PickupItem derived from BP_ItemBase class, and call that AddInventory logic inside the BP_PickupItem without checking tag.. But then i would also need to cancel that for pickup items like potion, they wont be added inventory. So i think i wont be able to escape dplicated code anyway.
What do you mean by Predict? You mean prediction algorithms like used in Shooting to sync in best way?
You are using EDITOR Tools. You are testing in EDITOR. Assets should not be duplicated during RUNTIME/GAMEPLAY. If you want to do this you need to have an Array of your data in some gameframework class and add/remove from that whenever you want to duplicate.
look up articles about Client prediction. Kinda important in multiplayer if you want your game to be responsive.
but ofc it can't be applied to a lot of things.
Since my game is not competitive, I dont care that much actually. But i am not sure until i see some "unreponsive thing" that triggers me. π
Think about shooting a gun and updating the ammo.
If you wait for the server to update your ammo, you will see the ammo changes 0.2 second later if you have 200 ms.
this matter competetive or not.
think about the example I just gave.
if Im playing a game and the ammo update 0.2 second later, I will instant delete the game.
Yes, I understood. But would it be still valid if we dont care about cheating and instantly showing on the client itself?
But I am using Array of data, But I just want to know how to delete these βdataβ from the folder where you save, by interacting with the delete button. Maybe it would be better if I create a thread to upload videos and photos there, which can better understand the problem. Although there is a possibility that I just don't understand.
It's not about your "Delete" question. You are using AssetTools during your Game.
Once you package your game it might just not work anymore.
hmmm
I don't know why it's so difficult to understand that you are mixing Editor with Runtime stuff.
Btw, for example in here, I call interact on the local. Then i will call this with Server RPC, but this would affect Server twice, How to prevent that in general? Like i need instead reaction on the owner, and then send RPC to server.
Why is the XY I get from IA_Move correct, but the Z Value I get from pawn by "Get Last Input Vector" is not 0?
AssetTools and the DuplicateAsset stuff is meant for Editor Utility Widgets. Nothing runtime related.
You should not add assets that show up in your Content Browser during your gameplay.
The code even has MessageBoxes and SourceControl logic in it.
You are just lucky that it works because Epic Games didn't think someone would do that.
Why would it be called on Server Twice?
unless you tell the server to run the function twice
The reason I am trying to do that is, I dont mind cheating, I need instant reaction on the client itself, and then send this to others. Because if i directly send RPC, i might also see a delay on the client on the first place
that instant reaction is what's called predicting btw.
Maybe i can react via Server bool.
but again, you can't get away with predicting everything..
@proud pilot The Delete thing is possible with the "EditorAssetSubsystem". But as the name says, this is EDITOR code. Not meant to be used runtime.
I can do local stuffs inside !Server bool, and do things with "Server" bool.
That Subsystem has a BP exposed DeleteAsset function.
the act of picking up item shouldn't be predicted imo, unless you want to implement a way to rewind it (putting the item back to the floor)
what can be predicted is like
If locally your item is already full, just don't send an RPC to server and display a msg where your item is full.
Actually what I said just now is not even predicting but a simple validation on client.
Yop, don't predict too much. It's easy to predict, but often pretty impossible to handle mispredictions.
pity
And that validation can also fail as a false positive.
Alright. Thanks for feedbacks. But what about the picture? Is that a correct way of handling instant on client? As soon as client interacts, it will see the effect, then send RPPC to server so that others can see later.
I wont need validations on that
You can predict non-State changes if you want.
If you can live with them being mispredicted once in a while.
But anything that changes state is a huge headache.
What i am doing is called prediction?! π
Yes, I am really aware of that actually after door disaster for me. π
Depends on what Interact does on the specific Actors
But yeah, callingit locally first is a prediction
Just imagine you move an item in your Inventory from 1 to 2 and then instantly from 2 to 3.
That already, if predicted, will destroy your week.
But i should still prevent this to be twice on the user of interactor right? Because for example in server, If i Interact with smth locally, then send RPC, it will make interact twice
Thanks anyway, this was related to blueprint architecture question and gone on multiplayer, sorry.
Why will it interact twice?
It will interact on the Server and on the Client. What that actually means is up to you.
In the picture, I call Interact as locally first, then calling Server RPC, and calling Interact again
But with a Server bool tick. I think thats where I handle logic to prevent duplicate logic.
Yeah but that happens on 2 different Instances, so what's the problem?
The call is not the issue. The stuff that this might do is the key
Prediction is not just about calling it locally first.
If Interact does things like Adding item to inventory and it's done in both server and client. Then that sounds totally like a disaster.
Ups, confused. So if we are the server, and call interact, then send RPC to server, wouldnt it to call server twice on the same instnace?
You have to handle misprediction, as well as reconciliation.
Alright, going to check those out!
Ah, that's what you mean. That's very specific though.
In that case that there is a ListenServer calling this, you'd want to block the RPC with a SwitchHasAuth
So that the Server doesn't call it twice.
Aha, thats what i meant! Thank you. So i would call this only on the remote on the server rpc right? Because lets assume I toggle DOOR (i would do that with rep notify but anyway) with RPC, and if i call it server again, it would toggle door again
Thank you and sorry for the disagreement if I offended.
You didn't offend. It's a language barrier.
Interact ----> SwitchHasAuth -- Remote -> ServerInteract
You also aren't aware really of what is even the headache of predicting state.
Alrighty.
Also, why are we discussing this in #blueprint
You might be right. I am beginning on the road actually. I try to relieve myself with those awaring.
Let's make a thread over on #multiplayer and I give you a quick example.
Yes, I actually tried to stop above in, but answers made me continue. π sorry, going to continue later this on multiplayer
Thanks anyway, this was related to blueprint architecture question and gone on multiplayer, sorry.
Is there a way to change the "tooltip widget, now it shows from cursor to ther right side down
i woudl like it to show left side up instead
screen shoot?
what is this tooltip widget
oh well, no comment.
I got a tool tip but it's just a user widget I made my self
yeah this is to
also applied the transform manually my self.
it's as simple as offsetting from the widget you are hovering.
I cant seem to find a solution anywhere for this issue, basically i have a system where the left hand uses a fabrik node to move to a specified socket on a gun, for some reason it tracks perfectly fine, but if an animation is ever played on the gun skeleton, it will lag behind the actual location of the socket. does anybody know of a fix for this issue?
is there a way to get a component from a casted class ref without constructing the object ??
I'm bassically trying to create kind of like a preview mesh in a way
bp interfaces and a variable reference
A component reference?