#blueprint
1 messages Β· Page 360 of 1
The right pin? Yes. It is inside the loop, so the loop will end on it and continue with the next iteration from the start. Or go to Completed if there are no more elements
is it correct ?
Code wise, seems okay, yes.
One advice though. Try to keep your code cleaner. Otherwise it will be a pain to debug some more complicated things later. Just keeping the connections straight and avoiding crossing the wires (when possible ofc) improves readability by a lot. You can double click the wires to create a reroute node, to avoid hiding important wires under other nodes
guys, related question
Is there a good example of FPS character with the new Mover plugin?
I can only find TPS in the Mover example, and they're C++. I find these hard to reverse-engineer into a BP-only FPS pawn
(And I'm looking for a physics based pawn π )
If you know a good example of Mover FPS implementation anywhere I could study, it'd be appreciated!
Thanks π will definitely keep it clean. Thanks for screenshot of nodes
I've not come across any myself. I believe it's still experimental so a lot could change. I would imagine Epic would release something when they feel its more in its final form. I believe there plan is to have it replace the current character movement component.
hey guys how can i input a custom property into the create event node
its binded to a float value function but i also wanna pass something in
You can't, the signature needs to match. You need to edit the other end of the binding first
but lets say i want to loop through every widget of a class, get their object name (which is different) and store it in a map within the game instance
i cant just for each loop in event construct because the name of the slider will always be the final index when a sliders value is changed
so i need a way to locally store or pass in the name but creat event creates a completely new function and i cant pass in the string
so ive hit a large roadblock here
I'm not understanding what is the point of this, but if the OnValueChanged is not what you need, you can make your own dispatcher with additional variables. Bind to it and call it whenever you need it.
Anyone know what the default value is for AO ?
So to confirm, you want a popup for picked up items added to the inventory?
+1 apple
+3 oranges
+2 lemons
yes exactly
right now it's just gonna say +1 apple and that's pretty much it, no matter what I do
Are you using common UI?
no, why?
I just fixed the problem btw
Is it bad practice to handle player input outside of the player controller?
If you mean inside the playable character and its a singleplayer game, then it isn't
Just that common UI adds some things that can be nice. Doesn't matter though.
Also, glad you figured it out.
It depends what what it is.
Handling a jump input on the player character, sure no issues here.
Handling jump input on a coffee machine, don't do that.
Handling jump input on a launch pad as a trigger, sure if it makes sense in your project.
As a general rule, inputs on the player controller are inputs that would apply regardless of the character being controlled. Inputs on the character would be inputs specific to the character. Handling inputs on other actors, whilst not strictly wrong should be a last resort and only as long as it makes sense.
i wanna made some kind of advance hit reaction (obserber =view this is not Hardπ
frekingFresers) like hit someone from up attack play certain montage that could be controlled by us
have any idea
like if this notiy trigger we want to do something
Image
Great Brother
light forward so the hit actor play forward animation or any stuff
Thank you
Not sure if this is the right channel for this, but I have a crash log I could reallyt use some eyes on.
I tried to introduce sub levels for sub level streaming and it led to my main level becoming unsaveable because a lot of grouped actors were "illegal references" to private objects that belonged to an external map. So I ungrouped the objects which resolved that one by one. Until the last error I had to solve was an illegal reference to the sub-level, which was referenced by 'LevelStreamingDynamic_0' (at '/Game/CSConceptLevel.CSConceptLevel') in its 'LoadedLevel' property (private object belongs to an external map).
The only way I solved this error was to return everything in the sublevel to the persistent level and delete the sublevel. This let me save the main level again. But Now I get this error and it crashes on run time start:
Script Stack (0 frames) :
[2025.10.24-04.19.30:617][ 7]LogWindows: Error: appError called: Assertion failed: (Index >= 0) & (Index < ArrayNum) [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 783]
Array index out of bounds: -302333536 into an array of size 31
[2025.10.24-04.19.30:617][ 7]LogWindows: Windows GetLastError: The operation completed successfully. (0)
If I delete ALL the actors from that area that I made a sub level for, it no longer crashes, so if I have to I can one by one delete them to find the "corrupted" actors.
I'm not sure why assigning grouped actors to a sub level was such an issue for the engine and I'm not sure how to solve this or avoid it next time otherwise. I've validated all assets, updated redirectors, rebuild my saved/intermediate/etc. and still it crashes unless I blanket delete the actors from that area I made a sub level in.
This is the crash log. I have a lot of errors, mostly about a plugin I've half ripped out, but those aren't relevant to this new error and crash issue.
duplicate the level asset, and try to open the copy
usually unreal skips over invalid stuff on duplication
@timid ivy
I'm making a fps game (original, I know) and I'm trying to figure out how to make more "responsive" or "snappy" movement. UE5s first person template has very slippery movement and I'm not a huge fan of it. I'm trying to make something more like quake 3 or ultrakill's movement where it feels more snappy and jumping is less floaty. I've been searching around on the internet but can't really find anything on this and making my own movement system has been... Difficult, so I figured I'd ask around a bit here.
Check if you dont have some weird comments on functions or prints. Also install symbols for debugging and you will exactly know what causes this error when you check logs via debugger
I had it today and installed symbols pointed me to exact place this error was taking place and it was something weird like I had comment in my header file with a lot of @@@@@@ and it couldnβt parse that
You'll need c++ to do more in depth changes, but you can do stuff like increase gravity scale and acceleration
I know it's a lot to read but can anyone give some insight on this? https://forums.unrealengine.com/t/recreating-viewfinders-expanding-view-level-transition/2668466?u=_artescape
This is a bit of a bump to a previous post of mine linked here. Iβm attempting to recreate the level transition effect seen in the game Viewfinder. The effect can be seen here: Since that post Iβve been pulling my hair out trying to figure out a way to do this with a βdevelopedβ photo in Unreal. While the replies were helpful they...
like the air strafe speed?
and max acceleration speed
u change it in chara move component
FYA - New 5.5 functionality, incase anyone hasn't seen it yet. Phat Bools!
Please explain this https://youtu.be/Dws8cJ9Xr5g on trace hit i have called my event despacher in the player and in ai i casted my character and assignthis depacher witch i made in player and assing in animation for each case but when i am hitting the ai the other is also playing animation
You are using the dispatcher wrong.
Dispatchers are used in One to Many communication. Which means, when you call the dispatcher on your Player, EVERY event bound to this dispatcher will execute. So both enemies take the hit.
Instead you should call an event only on the actor that you get from the Event Hit. Either by casting to it and using the current event you have (Hit Enemy_Event) or by creating an Interface and a function inside it. You need to implement it on the Enemy actor and call this interface function on the HitActor from the Hit Event instead of the dispatcher
Hi! I'm using level streaming to stream in new levels in my game, but for some reason the game is now crashing (only in compiled build, not in the editor) sometimes when I load in new rooms during level transitions. Any ideas? The error I get says the following; ```"Assertion failed: IsInGameThread() [File:D:\build++UE5\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\StrongObjectPtr.h] [Line: 27]
TStrongObjectPtr can only be created on the game thread otherwise it may introduce threading issues with Grbage Collector
Crash in runnable thread FAsyncLoadingThread"```
Do you mean it crashes only in packaged version?
Also sometimes? so it's only from some level to another (specific level?)
also do you use hot reload or live coding?
Sorry I should have been more specific! Yes I meant packaged build. But it's fine I figured out what the problem was just now, it was because of the EasyMultiSave plugin I was using which was set to "Multi Threaded". Disabling that fixed the crashes! π
Nice, glad it's fixed π
hello, quick question. I'm trying to make the light fade in when the player get close and fade out when they leave. but it stays on when I play the level and it turns off when the player gets close to the collision.
Guys, can someone explain to me why my focus doesn't work on close objects? It blurs them.
Can't be sure without seeing the timeline, but sounds like it is flipped? Maybe the timeline should be in the other direction?
Or your initial value is wrong - not the one on the timeline, but the initial intensity of the light component
this is the timeline i set, could you tell me more about the initial value please. I set all the intensity of the light component to 5000, sould i make the one in the detail panel 0?
Your timeline set set to lerp the value from 0 to 0 over 1 second.
i'm sorry correct me if i'm wrong. I'm still learning how to use unreal engine. did you mean it like this?
nvm i figured what you meant thank you
is there any way to draw a debug sphere in an editor viewport at design time (not at runtime)? I have an actor component that does stuff in a radius, and I need to easily visualize what that radius is... super annoying to have to keep running the game over and over again to see what my debug sphere looks like....
Try drawing it inside the Construct script. But even if it works, it will draw it each time you move the actor which will look ugly
You can also make a function be accessible in the editor, to manually trigger drawing something
actor components don't have construction scripts though
Or just add some visible sphere collision and delete it on begin play
actor components also don't have components π
Well yeah, they don't "exist" in the 3d space. They need to have a connection to something else
right- thus, a debug sphere that I can set a location for
Oh, you mean component visualizers - I donβt think those are exposed to BP
You might be able to rig something up so that every actor with that type of component needs to do special support to kind of visualize things (with extra components), but even if you get that down to a single function call in the construction script, you still have to remember to add the extra components and that call to every actor type using it
bummer
Does anyone know the point of making blackboard structs if you can't even get their values?
Hm, but you can't add structs to the blackboard, I think
Oh, seems like it is new in 5.6, I was looking at an older project. Yeah, weird they added it without access via Blueprint
Yeah very weird, but a normal thing epic would do. I'm adding it into the engine code in c++ though so my projects can access it
Just hate that I have to go through extra steps because they didn't either think it through all the way or just didn't implement it fully
Has anyone managed to get CoreRedirectors working with renaming C++ for BP references in order to migrate assets from something like Lyra?
I know it's a lot to read but can anyone give some insight on this? https://forums.unrealengine.com/t/recreating-viewfinders-expanding-view-level-transition/2668466?u=_artescape
This is a bit of a bump to a previous post of mine linked here. Iβm attempting to recreate the level transition effect seen in the game Viewfinder. The effect can be seen here: Since that post Iβve been pulling my hair out trying to figure out a way to do this with a βdevelopedβ photo in Unreal. While the replies were helpful they...
Hello, so i got this problem and i don't even know the reason of why it's doing this, i gues it's probably dumb but i fon't get it :
for more contest, i'm making a small game and this function is for equiping a weapon, so i start in the player controller and then go to the actor of the wepaon for conditions and all, but it's calling the event, can someone explain me.
thanks π
Im assuming that ShotgunRef is invalid and set to None. Are you getting any errors in your log when you play the game?
You mean, where you would edit the sequence of things that should happen?
I think I have found it:
Yus, that would be it.
Thank you!
Hello. Is anyone here who knows how to successfully detach a component from an actor and attach it to another one?
I am currently trying to detach a Audio-Component from ActorA and attach it to the Root-Component of ActorB.
Somehow it doesn't work and I cannot see why.
What I do:
- Spawn an ActorB
- Use "DetachFromComponent" on Audio-Component
- Use "AttachComponetToComponent" to attach the Audio-Component to the Root-Component auf ActorB
- Destroy ActorA
I have tried different approaches like with "AttachActorToCoponent" or use "AutoAttachParent"-Object on the Audio-Component, but i coudln't make it work.
Hello Guys, i have an issue
i use the trace
yo draw a sphere for colision
but when i attack fast...
i don't touch...
is there a way to fix that?
Is it because i'm low FPS PC? and the drawing of the Trace is not fast enough to cover all the attack surface?
I'm blind or I don't see the sphere trace beeing even spawned?
can you set debug and see where it gets spawned?
also you probably want Sweep and not just normal trace (unless you want to have 'aoe' around your character simplified)
yes wait i will re record with the draw
maybe it's my logic which is not good
It hits so it's working actually, the problem might be with logic that is next?
The positions of the traces definitely look like it can miss some hits from time to time due to how fast it is.
yes i think my logic is not good
i will rework it π
but it depend on the tick / fps
With this speed maybe you should trace for a cone hit instead of the line trace
But cone tracing is not in the default engine, you would need to make it yourself
Because then you can trace the entire front of the character in one go
Since the speed is so fast I don't think you need granularity like the line trace
But that will mean i toutch even if i don't touch?
What I'm saying is - the weapon moves so fast, tracing between it's points may miss some hits, depending on the angle.
Tracing the hit in a form of a cone in front of the character would detect hits properly, no matter the fps - unless you have more than 1 hit per tick lol
Yeah, sort of
ok i understand the idea
Basically tracing on tick won't work properly with this speed
You could also move to OnHit event, there is an option to use Continuus Collision - but this would require reworking how you handle the entire hit interaction, since switching to OnHit would need collision adjustments etc
But I never tested it with a speed like this, so not sure how much better it would be
I think you don't ahve to Detach, just Attach to new one and it should be working. You might ttry to also add scene component as root and then try to attach to it rather than attaching root.
I don't understand that one
move to onHit event?
I also tried without detach without success.
And what do you mean to first add scene as root? My ActorB already has a scene as root. Do I need to create one explicitly via BP?
Yes, try to add empty scene component and set it as new root and then add to it.
And in case you need it. The rough idea for a cone trace works like this:
- you add a notify to the swing animation when the trace is supposed to happen
- on notify start you do a sphere overlap centered on the player, to detect every actor in range
- then foreach actor you do some math to detect if the actor is in front of your player and in range and if so, deal damage
I'm attaching my old blueprint for this - it is not entirely mine, I think I got parts of it from the internet. And it is old, I don't remember most of it xd
https://blueprintue.com/blueprint/ygf_taez
I also tried that without success π
Does it even work? Switch the parent of an existing component from one actor to another?
thanks i will check that
There are a few ways to detect hits. Using overlap events, tracing and using Hit events. All of them work slightly differently. OnHit approach uses collisions of the objects to fire an event when they hit eachother.
No, I mean add like StaticMesh or something and set it as root so it's not default one.
aah i'll try that. Ty
also by not working do you mean that you don't see these components dissapearing in viewport and beeing added to new actor ?
Well, the ActorB gets created successfully, but the component doesn't attach to it's new parent (ActorB).
might also keep location rule to local
I have tried:
- Add a StaticMesh instead of default SceneComponent as Root in ActorB and Attach the AudioComponent from ActorA to ActorB
- Tried to use Relative Location instead of World Location
Both didn't work :/
and it is not the first time i've tried this. I never made this kind of "Switch Component between actors" logic to work... Which is why I ask myself if that even works?!
I believe the issue is down to ownership. The component is owned by Actor A so when you destroy Actor A the component will be destroyed as well.
Attaching a component to another component doesn't change who owns it. (Or the actor it belongs too)
I see... that might be something. But another core problem is that the Component doesn't switch to the root-component of the new ActorB.
I look in the Details pannel into the Actor's Component-Viewer at runtime. The Audio Component didn't switch.
It probably doesn't work if the components are in two different actors. I'd have to check the source to be sure.
You'd normally attach a component to another component inside the same actor. The alternative is attaching an actor to a component instead.
What's your end goal anyway?
I want to attach the component to ActorB and then destroy ActorA. The reason is the SoundFX playing in ActorA. When destroying ActorA, the sound immediately disappears too, which I don't want. So I thought, attaching the component to ActorB temporarily would be a solution to that.
What sort of SFX?
Simple audio, relatively long.
Hey, sorry for the late reply. I have seen this function and tried to make it work with some connections but it seems like it doesnβt work or I may be doing it wrong
I will provide a screenshot to show how I did it, again not too knowledgeable in BP
What's the SFX? Music, explosion, something ambient etc...
Ambient-like. I am not sure why this matters?
But anyway. The main question I had got answered. Now I seek for alternative solutions. Thank you.
If you really need it
you can use the "Rename" function
During gameplay, I spawn a new component using the code below. UStaticMeshComponent* pComponent = NewObject<UStaticMeshComponent>(pActor); if (pComponent) { pComponent->RegisterComponent(); } The problem is, it can ONLY be attached to its owner (or any <USceneComponent> owned by the same Actor). Not to any other Actor. How about a β...
but its c++ only
If it's for ambient type of sounds it might be worth making a system specific for it.
an alternative is to spawn a specific sound actor, which simply is an Actor with a sound component
that you attach to whichever actor you need it to follow
Interesting. Yeah that could help, thank you. But Why isn't this available as a BluePrint function? Haha. Anyway. Thank you all so far.
then it'll have its own lifespan
I've tried using this function and just ended up getting crashes. π UE doesn't like outers of objects being changed haha. (I was most likely using it incorrectly though)
Because there's normally other things you'd need to do as well. I believe the forum post squize shared mentions unregistering the component with its current actor first and then registering with the new one.
Still the custom actor is the absolutr best way to handle this
No messing around
And easily done in bp only
Hi, I have an open world game and Im trying to make a save and load system... the problem is the game is tooo big and tooo complex to save, so there are around 25 thousand actors almost, its open world survival crafting sandbox, and many things can be changed... So it's just like minecraft almost on a 4k x 4k map...
So the player can build, farm, gather resources from the world etc, and turn them into other resources. Everything is ready so far, the only thing left about this game is the save and loading system...
the loading is going to be kinda hard because if the player collects a rock then I'll have to generate the world the next time he loads it, with that specific rock missing
so for example if I had to make it, I can think of one funny way to do this, might be ghetto way, might not be very optimzed, but I could do this with multiple line traces or sphere traces... so the trace is gonna smite all those things it finds that shouldn't be there on the begin play of the load
yeah, it's just an idea, I could also destroy all actors in the game... and then recreate them...
Is there procedural generation?
Or I could copy paste my level so I can have the sculpted landscape duplicated, and then I could have an empty landscape only with the necessary actors on it...
Id spawn everything as normal, then remove based on some id / guid thing
yes I used PCG volumes to generate my actors and my static meshes and my HISMs, but now they're no longer PCG volumes, because I used the pcg only for generating each batch of actors & folliages
so on load you'd remove based on id/guid?
Post spawn yeah
Unless you can intercept the spawning process ofc
Better if you dont have to spawn it in the first place but the limits are what they are
If the spawn id is the same as the guid ypu can check it pre spawn/creation
so when I press play I go on to the same level which im gonna play at when I press New Game... Im using level streaming... Ive put a blur behind the menu and the camera jjust moves over that world... when I press new game I will just go spawn on it..... the landscape is already full of these actors.... But if I press load game I wanna try to somehow destroy all the actors that should be destroyed and spawn the new actors that the player's has created with his buildings etc.
on play with others, it's gonna be a different level
yesterday I also implemented a plugin for the loading screen... when its simulated
intercept?
they're already spawned
Manually spawned?
25 thousand actors in a giant landscape... rocks, plants, animals, etc.
Assumed pcg,/procedural
not manually spawned... they're already spawned in the level...
Gotcha
hmmm.... its hard to explain
when you place PCGs, these volumes just create the actors, but then you can delete the PCG, and create a stamp, so this is what I did.... the actors remain there permamently. Even if the PCGs are all removed... I removed all my PCGs once I was done with them
and I can still use more PCGs to add more folliage... etc, which I probably will but thats pretty much it... The player only interacts with actors.. so static mesh folliages shouldnt matter
he cant terraform folliages
I would separate your static and dynamic stuff into separate maps. That way you could have 2 main maps where you place either the static or both in. When starting a new game you load the map with both static and dynamic maps and if loading, just load the map with the static map.
This should make it a little easier to handle loading saved data.
gotcha, so I would make a new level only containing static meshes or actors that are never affected by the player or actors that shouldn't have any data saved, like caves... or swimming_water_blueprint, and then when I press load I will only spawn again each and every actor that has to be created, aka the remaining actors that haven't ever been affected by the player... like wildlife, livestock, rocks, boulders, stones, woods, trees, and generally plantlife.. and then how would you manage the other actors?
this is some old draft code I had made some months ago to visualize how I did it before... I was able to generate at best, the character location, and stats, and then load some placed items that the world created on the world... but that's pretty much it... and that's on a good day. This load execution had many errors and right now if I implement this janky code it will completelly crash the engine on load.
and this is the other half of it
frame-slice?
Blurprints tends to dislike large arrays
You come aroumd that by frame slicing
Spreading the work over multiple frames
Let's talk about unreal's GUID system, which you can use to label your actors, components or any other object you may want with a unique identifier that you can use for a wide range of different uses. In this example, i'll show how I personally use it to have item picks remember if they should be destroyed or not between exiting and entering le...
I was able to find this which seems very useful for what im trying to do
but I couldnt find any resources on frame-slicing
not sure if it's a C++ thing but im sure you can do multithreading and other things on C++
Pretty sure i got a snippet
Its not c++ no
With a 1 frame delay between batch exec and step(outside the macro)
from what I understand Unreal has a cap-limit for how many iterations can do on a for each loop per second, and if it does too many iterations then it will crash the engine... I think the limit is 30 but someone told me people can raise or lower it etc... im not sure if thats true
does step stand for completed ?
Its like 1 million
But theres like 15 caveats to that number
my game has around 25.000 actors, should I divide them by a number to make it slower on the machine? so as to create the CurrentEndIndex?
Just copy the macro 1 to 1
And set the "ElementsPerFrame" to 500 and see how it goes
You might increase or decrease it depending on how much you do for each entry
The input should say ElementsPerStep, not per frame π
You can increase the loop count before timeout in the settings
Hi! So I'm making a game where you quickly move from level to level, and I've encountered a problem where if you hold a move key as you load into a new level, Unreal won't register / know that you're still holding the key in the new level, so you'll just stay stuck in place unless you release and press the same key again. Does anyone have any idea if there's a way to fix this?
no (sorry wen to sleep it was 6am in my country)
very dumb but for some reason my player character (spawned using the gamemode and playerstart) is possessed by AI (but i disabled the ai auto possess on the pawn)
any ideas what can it be ?
You could try setting the input mode to game only when the new level has loaded.
No luck, unfortunately :(
quick question... Set Integer (by ref) and Set Bool (by ref) is not a function, isn't a SET variable what is it?
Its indirectly setting a value (the target Which is reference (diamond pin))
Which is a reference
E.g. a direct pointer to the target input variable
Sorry, that was a sloppy mess of an explanation
Is this how you would connect it?
besides the 500 elements per second
I will set it to 500 soon
also should these be turned into variables?
I dont understand much but... I guess I will keep them as is and not change them... and Ill try rn to play with it & Load
Yes
Batch complete -> delay one frame -> step
And elementsPerSecond is set to some value atleast for testing and seeing how much you can handle
Id start at 500 and work downwards if it causes bad hickups
This should be a macro btw, not a collapsed graph
anyway, what I have right now is hooked up to regenerate only the player transform & the actors that the player generated...
oh okay I will try again with macro
btw can it be a collapsed graph inside of a macro?
Why would you do that π
Think you could just copy paste the macro from the forum aswell..
"Copy full snippet"
that doesn't work btw
I did copy the full macro but cant paste it into my panel with the macros list, I have to paste it into the graph and then work the connections etc.
anyway I will try to go with another method
oh I fixed it, no errors now
β
but I will do what pattym said
I will copy paste and create an empty level for every level that I have
Spreading stuff across ticks can be useful, especially if you're BP only.
I use this sort of setup a lot. I store the data in an array for what needs to be processed and then just get and remove index 0 from the array. Using the DoN to control when it should start a timer for the next tick if it reaches the batch limit.
Just to add, you'd be surprised what you can hide with a 1 second black screen before fading in. π
Hey i don't understand. I play a montage. that montage has a notifyState.
At the begin of the NotifyState i print a text.
If I spam the button to Spam the montage... the NotifyState begin is call only 1 time... i don't have multiple print screen...
is it normal? how do i restart the notifyState if it's the same montage that is played?
The way you handle the traces would need to change. Instead of performing them from the bottom to top of the weapon, you need to keep track of there position and then the following frame/tick you trace from T1 to T2 and B1 to B2. You can add segments in between like in the image if required.
At what point is the notify state placed in the montage?
it's the 1
Try having them trigger at frame 1 instead of 0.
Oh yeah, that is also a good idea - to trace between the weapon position on previous and current tick, instead of along the weapon.
Yea, you're less likely to get misses that should be hits that way. Because attack animations can be fast, you can get situations where smaller NPC's could fit between the space between frames. Tracing from previous to current frame positions helps solve this.
so i guess the idea is to put multiple socket on the weapon and trace betwen their location
i will try, it sounds fun π
It's definitely a fun project. This was something I worked on a while ago. (Ended up spending longer on it than I thought I would) Make sure you test at the lowest (acceptable) frame rate though as this can affect things.
https://bsky.app/profile/mpattym.bsky.social/post/3lhvokbl4pc2l
So what I thought would be a quick project turned into something that took far longer. So here's what I've been working on.
In short, it's a 'frame stable' weapon trace system. I would have liked to have implemented a hybrid approach but 5 days later it's time to move on. π
I think no need for saving previous locations we can get very good locations by offsetting the current one in opposite direction and then doing trace from there
And we can also do multiple correct traces steps using this even at low frame rate
Now if only we could bake this info
Bake the offsets so you can querry them at any given animation position / time
So you'd bake it at say 30 or 60 fps, and just go from there
Then you can simply use deltatime to figure out how many traces you should do to catch up, accuratly
Calculating the locations are not expensive, the traces through which to get the data from the world are expensive
Still even cheaper to just get it from some asset directly
Traces can be reduced to single traces , baked at whatever precision you deem necessary
Tho line traces are dirt cheap
Also means the server could get away with less processing for animations / blends
Why not spawn a capsule collider instead of doing 10 traces per frame?
Cheaper with 10 line traces
It it?
I cant recall thr relative cost of the different shape traces vs line traces , so 10 might be off
But the cheapest trace type is line trace
Offsetting just offsets the spacing rather than solving it.
Yea, this can be a nice approach. You just have to remember that you'd have to bake the positions for each skeletal mesh that can use the animation. Slight differents in bone lengths (even though they use the same skeleton) can really throw things off if you dont.
Id just store that too in some dynamic variable
Along with e.x. sword length if they share the anim
So you can manipulate them as you'd need them
Spawning anything has extra stuff that has to be done for registering it with the world. Traces dont do this as they just query the world data.
Add more points etc
What if you pooled the collider?
Unlikely, traces are actually pretty quick. I would imagine the pooling system would just add unnecessary overhead without really saving anywhere. Feel free to build the system and profile it though.
I mean solve it but not by saving previous locations, only saving previous direction and then offsetting the start from socket locations towards previous direction or the opposite of sword direction and the end towards the forward of the sword direction
If you're storing the previous direction, you might as well just save the previous location. They would both be vectors anyway. Going for direction, you'd probably then need to save the distance as well (To prevent gaps) so you may end up doing more work than just storing the previous location.
The microscopic memory cost is nothing to talk about in any case
I attempted to dynamically get the previous location from the anim data directly but ultimately failed.
All the helper functions epic has for it (which makes it really easy) are all editor only functions.
this is the first thing i see when i open this channel and im scared
So, how does number of nodes influence performance? when I was working with them I was super worried I might be adding too much lol
Each node adds a slight overhead due to how blueprints are handled
BUT
In vast majority of cases your design and what the nodes do matters way more than the overhead
ic ic
one thing I did for fun while in class was just make a simple cooldown (i'm a beginner), which was just delay -> print x5, total of 10 things just for the countdown
though there is probably an easier way lol
You shouldn't worry about it. Unless it is inside a large loop, like 10000+ for loop
nice
Just to add, the number of nodes in a BP can affect editor performance whilst the BP's are open. If you have 20 BP tabs with a ton of nodes, the editor might start to feel a little sluggish.
However, you'd have to going pretty hard to get to this point.
it does animate them when they're active, i'd imagine something like that happens
my profesor said a variable with a delay for the actual cooldown aspect was the way to do it for now so i did it like that lol
I take it they've not taught you about timers yet. π
E press -> stuff for the ability -> set cooldown true -> [print -> delay] x5 -> set false
no lmao
every time i try something on my own i learn the way he taught us is either not efficient or not working lmaoo
I personally would favor timers over delays.
It sure sounds perferable
I'd have to tie cooldowns to a UI element regardless, so its not like the prints are needed
As a quick example. The great thing about timers is can can store the timer handle so you can pause or cancel it if needed. With a delay, once triggered, there's no way to pause or stop it.
hmm, how does the event node work? the red boxes connecting
If there is a video explaining the node types (don't know the terminology otherwise i'd look) that'd be nice actually
My knowledge is all over the place lmao
any day 100%
The red square is to indicate a delegate. So when you start a timer you have to specify what function/event you want it to fire when the timer has elapsed.
A delegate is pretty much a function. A delegate might require specific inputs so the event/function must have the same types to be accepted.
Alternatively, you can use the create event node which allows you to select a function. This will only show you the functions that are compatible.
Ah fancy with a dispatcher
oh wow, didn't really think it would go left
effectively makes this function as a straight line then
Create event is also really nice to know, biggest cause of my messy blueprints was events lol
like the custom event?
you got one for like, the actual colored nodes- ie the white, blue(objects), red, green (value), etc?
Try to avoid the by function name one though unless you actually need dynamic function names. They can break very easily if you rename a function. π
Red is a boolean
Blue are usually references
Green is a float
Yellow is a vector
Pink is string
Teal is enumerations
If you create a new variable inside yur blueprint you can look at all the data types
White is execution
ah
the red boxes are events
you can hover over them and it shows you the type...
True there should be tooltips for every node when you hover them
yeah, they just tend to be different on the same color
would you recommend dissecting the existing stuff on the engine?
might be hard before you understand all the existing datatypes
But ye generally its a good idea to get the unreal example projects and go trough the code
wdym by data types?
What is
A vector, a int, a rotator, a boolean, a float, a reference, a string
Try to start classic with a hello world
On button pressed-print string to the screen
When you have that - on button pressed - print string hello world but in another actor not in your player
now in another actor
the print string node is in a second character
In your player you press e -> now in the second actor the print string has to get executed
In this video you'll learn everything you need to get started with blueprint communication. If you're struggling with this in Unreal Engine, make sure to watch till the end to get a full grasp on how this all works!
#gamedev #unrealengine #unrealengine5
0:00 - Intro
0:20 - What is blueprint communication?
0:28 - Direct communication
2:05 - Ca...
yee i know cast to
Its always baffled me why people lump casting into blueprint communication. It's just a type check lol.
Is it?
A cast is basically telling the compiler how to interpret data so ye true
It shouldnt be in blueprint communication
Its more like the event that you call that is the true "communication"
Yea, i think the bit people actually struggle with is getting the ref to begin with. Casting isn't going to help with it. π
Ah easy - get all actors of class π
i always get stuck on what to put for object tbh
I shouldn't laugh at that. π
You need something that detects the object in the world first
For example a sphere collision
Simply put, it would be the object you want to call the function on. This however might not make sense if you've not done any object orientated programming before.
You can do get all actors of clas then get a copy of 0 if you only have 1 single thing in the level you want to cast to
but its dirty
i have made actor -> static mesh -> custom event -> print string
There is a non plural getter for this as well.
and on the character Keyboard Event E -> Cast to BP_Hello_World -> Hello World (custom event)
but the cast still need s a object right ?
so i assume the static mesh for the cube is not a good enough object reference
correct
You either need a sphere collision on your player
(it would still want an object)
Or you do a linetrace
If you want to cheat you can do get actor of class
But that wont help you most of the time
Prototype only... (for the beginner)
add sphere collision to the player instead?
ye i know how to
Think of this sphere as your field of view
'How to get a reference' is the key phrase. There's 3 main ways, either: (there might be more)
A: store a ref as soon as it's created of which you can then pass it around when needed. (assuming you have a ref to the thing storing the ref π ) or
B: Perform some sort of trace into the world to 'try' find what you want.
C: There are some overlap/hit events that also return a reference to the object.
Which you would use can depend entirely on what you're doing.
and get all all actors of class π
Best to plug it on a tick
I purposely ignore that one. π Technically it falls into A though. π
To make sure
have a sphere collision on player, now what?
it works both ways
now when you press e
Or whatever key you have
what do i do with it though lol
You drag in the sphere of your panel into the event graph
or you right click in the event graph and say get "SphereName"
dragging it worked
this is a reference now
a reference to your sphere now drag off your reference
And say get overlapping actors
it will return you an array with all actors in this sphere
from there you drag off and say get(a copy)
Thats your object for the cast
now add another event in your player call it answer
Event answer - Print string
The reason why you cast is because the object type it returns is of type actor, which is anything that can be placed in the world. Most BP's you would create to place in the world would be a child of actor so the cast is like saying, 'Hey, i've got this object, is it a Chair?'. If it is, the cast is successful and it returns an updates object ref. If not, the cast fails.
customm event?
Now try to execute the answer event after the hello world
yep
is the other actor placed in reach of your sphere ?
yes
ah you are maybe detecting yourself
In get overlapping actors
select the class hello world
Now your sphere will only look for this actor
Also the answer Hello should be called in your second actor
Not in your player
Yep
Its very easy to get the player object
get player character
and you can cast with that
works
This are the absolute basics of blueprint interactions
This was only a cast
you also need to know how to do that with a delegate / event dispatcher
And how to do it with a blueprint interface
Different ways of communication
THe problem with casts is that they create a dependencie, a hard reference
As long as your player exists your hello world will be loaded into your ram now
Learn about hierarchy and function only base classes. And then about actor components and composition. π
And before anyone says it, interfaces aren't a replacement for casting. π If you want memory management, hierarchy and soft references should be your main go to.
trying to figure out how to lower memory usage atm lol
want to try to optimize games, not to the extreme level the nintendo switch has, but yknow
Thats something to worry for way later
Do you currently have a BP that has a lot of large dependencies?
But it doesnt hurt to get a good habit from the get go ...
probably, im in the combat preset for 3rd person gamemode
avoid casts π
That's no true. Casts are fine and tick is all about what you're doing on it.
Please don't tell people to avoid casts. Its horrible advice.
It depends to what he casts
keeping it lighter as i go does mean it will be easier to fix up later
Having a chain of ahrd references in your code is main beginner mistake
I would go with, be smart about what you're casting too.
and since i don't have the most optimal set up, i won't run into things that slow it down
You can always cast to your player without problem, you should however not cast from your player to other classes
yall got some general advice for improving performance? unreal likes to tell me that my video memory hates me XD
thats mainly when i add visual things though, default level seems fine right now
So hard references aren't always a problem, it just depends what its too. The trouble makers are things that contain things like textures and sfx. These can get large and might not always be needed so having them always loaded can cause trouble.
This is where hierarchy comes in. You can look at the character class as an example.
This goes:
UObject -> Actor -> Pawn -> Character -> ThirdPersonCharacter
Most of the core logic is inside of character which can be safe to hard ref because A) it has a small footprint because it doesn't reference large assets and B) would most likely be loaded anyway.
Doors can be a great example of creating your own hierarchy.
UObject -> Actor -> DoorBase -> BirchWoodDoor
The door base wouldn't contain any references to things like meshs, materials etc... but might setup empty references that can then be setup in child blueprints. This base class however would contain all the core functions like 'OpenDoor', 'CloseDoor', 'LockDoor' etc...
This means if you have a door, you can store a reference to a door using the base class without much of an issue.
Then there's soft references but getting hierachy down first will make soft refs easier to understand and work with in the future.
That is because you have too many models with high res textures
Unreal only uses 1 gb of your vram by default
you can incease it like this in the engine or you change up the editor ini i think it was
If i remember correctly, in a build UE automatically detects available VRAM. You can change the PoolSize in the editor if you want to test at the given amount.
Sometimes some models have super expensive stuff enabled like foliage with wind
i haven't added any other materials lol
you mean you get this message even i na empty level ?
with the starter content
win + r
Type in dxdiag and hit enter
Memory: 8192MB RAM
next to the system tab you have one for your gpu
?
display1
should be fine to do a full screenshot right?
sure
Ouch i see
my second "monitor" is a chromebook + capture card lmao
π
what do they do
My old machien had the same gpu and i did work in ue5 with it
Lumen is real time lightning
im mostly going to use placeholders lol
4GB is fine. Just depends on the game. I ran a GTX970 with only 4GB for years.
Ahh its fine for most things
Niagara will be hard with it XD
Tried to do niagara fluids with it, no chance
honestly i think games going super detailed as possible was a mistake but unreal having it as an option is based
I like it looking not fully realistic
Also, Hogwarts Legacy was build using UE and its minimum is 4GB vram. Just got to be smart with you're textures.
the highest level of graphics i'd consider for personal projects would be around Dark Souls 3
looks amazing, i still here people complain about it lol
this feels so much smoother lol
so on the previous topic about cast tos, what would you recommend instead?
I'm going to do a spell system for this mini project, how would you go about that?
Organization wise I suppose
I would recommend you continue to cast and use hierarchy to create function only base classes you create children from for your system.
so referencing things lower on the hierarchy? or did i understand wrong
I would create an actor component that handles casting spells. This can handle checking any requirements before performing the relevant animation and spawning in the various SFX.
I would probably create a custom uobject that stores the data for the spell and possibly some core logic that all spells should have. This would allow you to create children etc...
Soft references would be great here for the heavy assets such as particles, animations and SFX.
hmm
Yes. Assuming where looking at an upside down pyramid with the base classes at the bottom.
Reference at the level you need but try to design so you don't need to reference the heavy levels.
For example:
Spell -> FireSpell -> BlazingInferno
Spell would have the core functions for things like CastSpell.
FireSpell might have additional functions for things like applying burn damage to a target.
BlazingInferno would be the actual spell thats cast and would specify your particles, sounds and animations.
Casting to Spell and FireSpell should be fine but you should rarely (if ever) cast to blazing inferno.
If you have spells in you're game chances are it'll be loaded anyway and if there's a chances its not needed, because it's a lower footprint, it doesn't matter if it's few KB are loaded.
As an FYI, building systems is more involved than just making something happen so don't get discouraged when things don't work.
Have you made an interaction system yet?
wdym by interaction system?
player -> cast to spells -> cast to fire spells -> cast to Blazing Inferno
this makes it so its checking cast to spells and no further until it succeeds, if i understand correctly?
Hes not saying that.
If you need to tell the spell to explode, or spawn, just cast to spells
You don't need to know what a blazing inferno is, just to destroy it sorta deal, so why cast to it.
i understand that muchm just seeing how it works
No, an interaction system is a system for querying the world for things the player can interact with and providing a way to then handle an input to trigger the interaction. They can be a good thing to learn as a beginner. They can range from really basic to over the top complex as sh...
Inheritance bahh
like "press f to unlock door you're looking at"?
yea pretty much.
then yes
Did you just follow 1 tutorial?
it was a lesson i did in class
we did a sight line that generated when pressing f
A linetrace ?
yes
rip
Can work for other genres too tho ^^
unrip
Ahh cool. I would recommend also looking at some tutorials on YouTube as well for them. The reason why is because there's a lot of different ways you can set them up all of which have their pros and cons.
I find its the easiest example to understand what the differences are doing.
The main ones are Trace and overlap based. However, the way you set these up can change drastically. Single line trace, maybe a line trace with a secondary sphere trace. Interface based or component based. The list goes on.
This can be a good project to learn how to build systems as opposed to just making something happen.
From my experience the first few projects are just for learning anyways
real
halfway trough you will see you made really bad mistakes and its easier to start again
the final for this class (which will be "make an FPS") and what im working on now
That's just the FPS template isn't it. π (lyra project π )
and after these im going to work on one with a group, see how that goes
unfortunately making it from scratch
Be sure to make it all client authoritative. π
what does that even mean π
hmm what does that mean too
I wouldn't recommend doing multiplayer as a beginner. π
Lyra is a c++ project epic released to show people how they can do an FPS.
Making the client control everything.
Damage, movement, etc. π
Makes cheating super easy. π
Hey guys, I have a question about level streaming. So I have this layout of two rooms and a corridor rn. The player starts in the left room (room 1) and after some gameplay the door opens and they walk down the corridor to proceed to the room on the right (room 2), after they interact with room 2 I want room 1 to unload and a new level on its place to load (room 3). I want this logic for every new room to load and unload seamlessly like the rooms change by themselves. I tried using level streaming and having the corridor be the persistent level and in the level blueprint load room 1 on begin play, however when I'm trying to unload it from a blueprint inside room 2 it doesn't unload. I'm aware the problem might be that I'm accessing it through 2 different blueprints but I don't know how else to load the first room and having the player also start from the same room. Any help would be appreciated, I'm fairly new to unreal and this little issue is driving me crazy!
just need to make the project file so big it crashes his computer when he opens it
the school computers are probably more powerful than his computer, but i could put separate levels in it just in case XD
Can you provide more context?
hey quick question, i know the Boolean Not Node is used to convert if the variable is true but NOT node turns it/ switches it to false but if it involes a Function like a pure function or impure how do you know if this function is set to true or false and if i need the NOT node to convert it or switch it to either one?
Uh, what. NOT always negates the value. If it gets true, it return false. If it gets false, it returns true
no, sorry im trying to understand how this node works, this one i mean
im trying figure out how dose the NOT Boolean Node work with Custome Functions when you cant Convert the functions true or false?
Can you share more about how your character is setup?
so no help?
Check to make sure its not set to load via a volume overlap.
where do i find this?
new to Blueprints and I'm trying to understand how the enhanced input system triggers behave. I have a test where I'm trying to set a bool to true on pressed, down, and released when I push a button. Pressed and Down both work correctly as I expect, but released just doesn't want to fire. I have the appropriate triggers set to each of those input actions in the IMC.
My expectation is that the trigger would fire when the button is released, but that doesn't seem to be true?
You'll most likely need to disable controller rotation yaw before you start rotating the character and set back to true when complete.
On the streaming volumes if you're using them.
If I remember correctly, the bool is to indicate that the action is triggering.
Released works a little differently because once it's triggered the input action is no longer active and thus returns false.
hey everyone, I need some help, does anyone have advice on learning and understanding unreal's gameplay framework things like - Game Modes, Game Instances, Player and Game States, Save Games, (or even other more complex stuff) ... - and knowing how and when to use them properly. Like any vids or docs you watched? I've been seeing some videos but they dont really show much practical way to use these (especial on how to use them in a full game). I've been on unreal for some time and made some small games, but my blueprints were kinda messy and never really had any structure, so since I want to upgrade my games I though this is something important to learn
I'm not
I'm just using a box collision so when the player enters it the level loads
I cannot unload the first room though
Released might only be true for a single frame. That trigger is more about being notified as soon as the associated key has left the "Pressed" state. It doesn't need to be active for as long as the key is released (while it's not pressed down).
Any one trigger type can give you multiple callbacks, though, including a tick event while it's active
time to see if my device can run unreal TWICE
blueprint noob here. hopefully not a totally stupid question. i made a BP, put my static mesh in it. added my health logic, and at the end if health =0 it does s destroy actor. i then added a FAB product BP that does fancy volumetric fog. that works fine and follows the destroy actor. i then added a FAB AI Spawner BP, it works but ignores the destroy actor. why will one BP child destroy with the parent and the other won't? haev i done this the wrong way?
Could be many things, you havenβt shown any code so nothing anyone can do but speculate. Use breakpoints to triangulate the actual root cause. For all you know, you did not parent it properly, or you missed something obvious thatβs preventing execution
fair call. to haev a parent and child relationship cna i jsut drag the child blueprint into the parent? or must i use the spwn actor node in the event graph?
It depends. There are 2 types of parents: inherited and attached. If youβre using an actor component, you can just put it inside the main bp. If youβre talking 2 separate actors, you need to go in the child and reparent it to the desired actor
hmm ok trying to follow, so i did this using the spawn node
where the components are
Spawning an actor does not cause actual inheritance. all youβre doing is setting an owner that you can basically call on later on
oh, ok, but is the bp_fogtool a child actor of this BP?
It is a child actor component
yes
We generally try to avoid those as theyβre known to be broken
thats what i mean
CAC and Child Actor are not the same thing btw
ok, so how do i do it properly?
oh, ok so cac is this type of "child" whiel a normla child is when we press on a BP and choose make child of?
Yep
Weβve all been there
Iβd stay away from CAC but in this case youβre saying that part works fine but the AI bp is ignoring the destroy command
So you want destroy actor to destroy the AI system ?
yes
to destroy the ai spwn
so the bp is a "monster spawner" that can be placed by pcg, spawn monsters, and the player can go destroy the monster spawner. like bug holes on helldivers 2
so why not just do that and call the destroy from the AI spawner bp
the behavior I'm after is seeing the released trigger fire off for only one frame. Right now it doesn't seem to be firing at all, which is what's confusing me
but the AI spawner BP doesnt have a hit box, health etc.
woudlnt that mean i need to add that stuff to it as well?
What about if you use the event node for IA_ReleasedJump?
Then make a function inside the AI spawn bp that kills it and call it from the main bp, or set the AI spawner bp as a child of the first one and then you can call the inherited function. Your target will still need to be the child
what we learned in class vs unreal's way to do it π
wooow, ok, that feels like you jsut went way voer my head.
yep the event node would give me access to what I need, but this little project was a way for me to try to understand the InputActions and see how to work with them. Pressed and Down both work how I expect, but the fact that released doesn't is what was bothering me
I'd really like to try to get it to work so I could know when / how to use these
ok this bit "function inside the AI spawn bp that kills it" is that what i ahve done here?
Well that bool is, by my understanding, asking if the input is active? Could be that the release trigger doesn't stay true long enough to be observable in your tick?
Pretty much, but your target has to be the AI spawner not the self
how do i get that?
See bp coms video in pins
atp should i ask him "why"
any aprtiuclar part in the 2 hours?
oh I didn't know it could miss things? The tick would miss even if it's all part of the flow of logic?
All of it. Itβs the best 2h youβll spend if youβre serious about learning UE
What you learned in class is easier to understand for a beginner i guess
i cant really read the nodes
ye was just showing it lol
bro im forgetting how to do the dang node anchor point lmaoo
google is annoying to use
THe unreal streams are usually really good
double click yeah
Its a goddamn joke, their docs look like a 12 year old with adhd has written them but their streams are some of the best learning material i have found XD
am serious, jsut spent 2.5 years learnign pcg
first thing i simplified with unreal's method
the (?) is because i don't know if thats true or not
maybe we didn't need to current health -# to be able to do shields (the shields was an assignment in class instead of a requirement too)
you need current health for dmg calculations
you recieve dmg 10 hitpoints
Now you need to do current health - dmg recieved
Clamp sets 0 as the lowest possible float
yup
But what your doing now is
You recieve dmg
Then you set your health to the dmg you recieved
current health -# is the unneccessary part when AnyDamage already tells us how much damage we're taking right
Seems wrong
you recieve dmg with a amount
damage into - makes more sense right?
you need to subtract that from your current health
like this
Can anyone explain why the captured scene from a SceneCaptureComponent2D is almost always way darker and higher contrast that the normal player camera? I'm using RTF RGBA8 SRGB for the RenderTarget, Final Color (HDR) for the CaptureSource, and I've got my PPV's identical. First photo is the world view from the perspective of a SceneCapture, second is the RenderTarget it outputs.
yep
okay will let him know to have the event's damage connect next time
Try RGBA16f if you're using HDR
wonder if he intended to do healing with negative damage if the clamp is there, or if negative HP broke something
okay custom eventing death makes more sense but i can't blame him for not doing that lol
unreal makes me laugh sometimes
did i accidentally break this- should the execute nodes be connected??
Does anybody know why the camera mesh from the SceneCapture2D doesn't get displayed? When I add it to an actor blueprint it's hidden but if I add a Scene Capture into a level it's visible, If I add the actor into the level it's still invisible, I don't remember it behaving that way in UE4 and I can't figure out how to fix it
It only seems to happen in UE5.6
seems to work fine, weird loll
is there a way to change my cursor sensitivity? Similar to how League how their mouse speed setting
okay am i allowed to ask stupid simple questions lol
Doing this made it a BIT brighter, but still way off from the normal view (second image)
it still seems like its giving it contrast for some reason...
Is that the view of the render target itself, or the render target applied to a material?
Random thought, add a ViewProperty node to the material, set it to Pre-Exposure, and multiply the render target output by the inverse
Sorry for the delay, the first photo is literally the RenderTarget pasted onto the players screen. This is the material
First photo is multiplying by Pre-Exposure Property, second is multiplying by InvProperty.
Pretty much the same thing
Do you have any post processing in the scene?
Yeah i have a PPV with manual exposure. Tried setting it to auto-exposure and matching the post process settings in the SceneCapture to no avail. I also tried setting both PP settings to have Min/Max EV100 at 1.0 once again to no avail.
Override exposure settings on the scene capture without setting them, likewise override all color grading related settings without setting them. Just click the checkboxes to enable them
you mean like this?
Yep
:L
i might try making a new project and doing some testing to see if this still happens
seems to be happening with all my SceneCaptures, they are all darker than they should be
i wonder why i didn't just add a vector arrow + launch character, why did i do all of this
Happens all the time lol
Once a system is done and you know the exact scope, easier ways reveal themself
oh i knew beforehand, just wanted to try it this way lol
hmm im forgetting how i did it and i don't have the file on me
made an arrow, it went into something that had a light purple, that went into something that gave me a vector, and the vector got multiplied by launch distance i wanted
oh i have it on my slime
tbh idk how much better this is
okay checked it out for all features, with the arrow it is one less action
now i don't think i need THAT level of optimization, one action surely doesn't make a difference, but it is cool to see
wp.Runtime.OverrideRuntimeSpatialHashLoadingRange -grid=0 -range=X
Unable to execute this command and no loading range value is changing. Any lead her eplease
I spent a lot of time in blue prints today and tbh idk if it was worth it, but I think I learned something from it
Hey. I just added the Interact Interface in elevator blueprint but it didn't seem to work. Can anyone help me
its working fine in every bp but this one it didn't pass or print anything
The way you are calling the interface is probably wrong
bad reference most likeley
Do yourself a favour and write it cleaner haha
Hey, inside a notifyState (Tick event) it's ok to cast on all tick to get the character?
why do you want to set aglobal var????
player is already global
Has nothing to do with the cast. It's telling you that the variable is read only. Is this function const?
Itβs the function inside the notify state
Get the character reference and to use it after on the tick event
but the player is already global
Get player character - cast to MainCharacter
it 100 % is very dirty to do a cast on tick
Just do it on begin play
It's really not.
In the begin play of a notify state ?
It is you dont need to cast 60 times a second
Casting is nothing but an IsValid. You're going to want to IsValid it on tick too. So what's the issue?
that its dirty
And the reason for that is because...?
Because your not supposed to do something 60 times a second when one single time at the start is enough
But again. You're going to do it anyhow. You need to validate it before you use it in the function scope.
Yes but in the on the begin event notify I canβt cast it β¦ donβt know why
So itβs why I do the cast on the tickβ¦ but maybe with your knowledge you have a better approach
Is this a part of the anim bp or which one?
Yes itβs on the montage : animeNotifyStzte but itβs a custom anim state notify
You know, it isnt very expensive to do it, you have minimal overhead in execution from the node and the cast itself but its simply cleaner to do it only once
It wont matter much in your case
Isnt this notify event part of your Anim bp ?
If you are worried about it casting to unnecessary things - you can use "IsA (soft)" since 5.5 or 5.6 or something. And only cast if true
Yes most of the time I do cast one time at the startβ¦ but here seems itβs not possible donβt know whyβ¦
But if it is bad to cast on tick - it depends. If this is one actor doing it - completely fine. If you have 100 actors doing it - it can start being noticable. Casts are not that heavy, but it all depends on the scale
So just set the Variable in your anim blueprint
You can also just drag in the variable and say - get
Then you right click and turn it into a validated get
On true - continue your code on false do the cast
Because the notify is const, you can't re-assign variables, you can use it as it is (without setting the variable)
They should really fix BP const. You can do so many things in const functions you shouldn't be able to do.
Or maybe the logic of the gameplay should not be inside those notifyState... maybe that is my mistake
i should just use them to communicate to the concerned "class" what they have to do
What does it do, check only for a soft ref ?
Yeah. But after thinking a little longer it wouldn't improve performance either way, since then you use 2 nodes, and checking the class is probably almost the same as casting to it - perfromance wise.
It helps with not creating random hard references though. But it is irrelevant to the current question
If you have a soft ref somwhere will it also be loaded into your ram?
but if i get the owner and i use interface i should be able to communicate to my main character without cast... if i can
Like i still dont fully understand the purpose of soft refs π
No. The point of isA Soft is to only check the class. The class is not loaded - but because of that you can't access it's class specific things like you can after a cast.
mate just cast in your anim bp
But later on you will cast with the soft ref and that creates a hard ref no ?
Ye but it interests me lol
But yes, a cast in a class adds it to the dependenscies of this class
But then again i dont see the purpose of it
Like what does it do better than a hard ref from the get go
I need to do some googling
Hey guys, I'm looking for any leads to making a reloading setup for multiple weapons in weapons system component. I can't get my head around how I should make it work for multiple weapons. I've got data assets setup for the guns, with magazines, capacity, damage etc.
The same way as you would do it for one weapon
On reload pressed - get equipped weapon - if current clip < 30 && ammo in inventory > 0
Do the reload stuff, remove ammo from inventory put it in the current clip
Can u tell me what i do to make it work
No idea you didnt show the code where you call it
i am calling it from here using e key
and here i have set it up
in elevator bp
before you do on interact just do a print string and hook up your actor that you get from the linetrace
Okay
It is working there
what does it print ?
it prints "Tue bp actor name" ??
WHat is the exact name that its printing ?
BP_Elivator_Old
maybe you forgot to put interface on that thing?
And if I turn back to wall or floor and try again its pring the same
On wall or floor
What happens if you only do a print string with hello in your elevator old ?
The elevator bp name
It prints now
But give the error in branch on component hit
your component is invalid
ye print string - is valid only if yes you continue your code
more interesting is this
you check if the component is valid
I get it now
you have like 2 functions with different returns and one has no return connected to it?
Yeah valid but giving error after DoOnce node and then bp on component hit
how tf is it even printing the actor name in the first place lmfao
probably some 3rd hidden function somewhere π
Just fixed the hit component wire and it just pass and not giving error
It's just that I use hit result on the interaction interface it is not working but I use primitive hit component and its worked π
I want to ask when we use line trace by object and channel, what is the difference in them?
for channel you can have only 1 channel that you are trying to hit, for objects you can specify array of object channels,
in both cases the actor/object you try to hit must block that channel/object response
When I try to get the elevator to the first floor at 337 at Z Axis the elevator just stop at below the floor and when going back to ground floor it just goes under the ground floor, where it is at 25 at Z Axis value
UB
Hypothetical question: ~~Say you have your PlayerCharacter, and when he gets close enough to an ingame item, you want your SphereTrace to catch that item & show a widget that gives you the option to "Pickup". Very standard stuff, but what is the most efficient way to do this do you think? Do you....run the character's SphereTrace off EventTick? Have a CollisionBox on the item, that triggers the character's item Trace when he enter's item's collision? There are lots of ways to implement this....What do you think could be the most efficient method?
The collision sphere ones instead of showing the widget to pickup standard stuff but this looks very simple instead of event tick which causes performance issue. We can use line trace by channel to pickup each item and this option also removes the usage of collision boxes or spheres also while picking up item, the first question of yours is that it looks way more better
I've never had performance issues for performing an interaction trace on tick. (I normally do two)
The differences can be negligible. Go with whatever works best for your desired interaction system.
I am saying it because later optimisation will be harder and from the starting of the project it makes easy for us to work along with optimised way, it's just what i think
Hey, need help here
Premature optimization can cause a lot of extra/unnecessary work. If we were getting technical though, traces tend to be more efficient than collision volumes.
One queries current world data while the other adds to it. But again, in most cases you wouldn't notice the difference unless you have 100's of the interaction system which would be unlikely. Nothing worth wasting your time on.
How do you handle the elevator movement?
I would recommend first deciding what you want to happen.
Individual collisions on each pickup can make it hard later to change what is pickable based on distance - like if you have 4 items near each other, when they have individual boxes you can be inside of all of them at once and it will be more work to determine which to pick up. And the widgets can overlap While using a sphere around the player would easly give you an array to check which one is closer.
But doing a line trace in front of the player cursor gives you a precise way to show only the one item info the player is looking at.
So I would say it depends more on what you want to achieve.
By using MoveComponentTo Node
Show your code.
Here
Just posted above
If I put x and y value too then it just going in slide slant not straight
Move component to uses relative location not world location. The component moves inside the actor.
Can anyone help me with stopping a projectile movement in the third person template? I am using Unreal sensei's game tutorial and after losing the game, the widget kicks in, stops character movement and time from ticking but the projectiles keep traveling which might end in hitting a target and a win screen appearing. I've tried searching how and what to call in the Game mode class, but nothing came of it
By "stops the time", you mean you use the Game Pause functionality or something else?
in the tutorial there is a widget that counts down and if it reaches 0 you lose. So what i meant it it stops this timer from decreasing when you win/lose
Hi, I was wondering if there is any way to setup the value values of an array in unreal to be the same values of an enum instead of manually having to put every single value and selecting it
So it is a custom method then. Well you have a few options.
When the game end is triggered, you can use GetAllActorsOfClass, choose your projectile class and destroy all of them.
Or you can add a check in the place where you decide what happens after the enemy is hit and make sure nothing happens when the game ended.
You can also pause the entire game, but it may interfere with other things, depending how you have everything set up
Thanks for the suggestions! i'll try to figure them out and get back if i have more questions. Is there any method for just stopping the projectiles mid-air? (i know the others work and might be more efficient, but this idea just stuck to me and i would like to experiment with it π )
Not sure if there is a way to pause an individual projectile. You can change it's velocity to stop it, of course, but if it is the end of the game anywya, destroying them will achieve the same thing
How could i change their velocity to 0 for example?
i assume i can somehow call the max speed from the details of the projectile movement component
I think enums have their own foreach, not sure with custom ones though. Also they are just bytes, so you can use this method too
The type changes in the top example are int -> byte -> Enum
StopMovementImmidiately on the ProjectileMovement component
Create some event dispatchers on your game state for 'StopGame'.
When the game should stop such as a win or lose, you can call the event dispatcher.
Anything that might need to do something at this point, have them bind to the event dispatcher.
And how do i call this from outside the projectile BP? I don't know what to connect the object pin with
Oh boy, blueprint communication again. That is why I suggested to just GetAllActorsOfClass and destroy them
pattym wrote one option of doing it above
oh i tried that and it worked perfectly, i just want to figure out how to stop this mid air in case i need it because it seems interesting
As an FYI, don't use get all actors of class unless you absolutely need too. You can get yourself into a mess if you over use it.
Personally, I would only use it for a quick and dirty prototype.
It is a tool to use, using it for cleaning projectiles after the end of the game seems better to me than registering every bullrt during the game with a dipatcher
Personally I would block changing the state of the game after the game ended and just left projectiles alone
Yes it is a tool in the toolbox. Just a case of finding the right one for the job.
As for my suggestion with the event dispatcher, this can be more flexible as a project grows. It can be used for more than just projectiles.
This can be a good option as well. If you want to allow things to continue playing out without actually affecting the end result.
Not in BP. That's C++ editor code territory most likely. PostEdit overrides and constructor stuff.
Hi I have a problem. I followed Ali enzoheri's tutorial.. Saving & Loading system
Did you put a name inside the SlotName variable?
The only other possibility is that you created the save file with a different Save class previously and didn't delete it from the project files. And it loads the old, different version, ergo fails to cast. Changing the SlotName would let you see if this is the case
"Slot1"
so should I go into the project save files and delete something like a Slot1 folder?
do you mean the project settings?
Well changing the slot name would create a different file, so it would have the same effect.
The saves themselves in editor are located in the folder Project/Saved/GameSaves or smth like that
I have these two
should I do something with them?
its a bunch of gibberish π
I'll delete them for now and see if that fixed the problem
This is just settings, you want to look for the one with the name you had in the SlotName
I did look at Slot1
they're all gibberish inside π
Well yeah, you aren't supposed to read them as plain text
But the point was that if you want to clear saves, you delete them from this folder
I can regenerate them, can't I?
ProjectName/Saved/SaveGames - yes. They are the actual files created when you use the save to slot function in editor
ok, now I will run again the game... the first thing that happens when I run the game is this... it goes here now because I don't have a bp save game, and now im regenerating ti
Yes, because you deleted the file itself. After that check if it will load after saving
ok now this works...
I mean it executes all the way
but it spawns my character on 0,0,0,0,00 if the map
waaaay waaaay outside
and I don't even see ym character being spawned, perhaps im not possessing it
Ohhhh yeah
Well I'm going to eat something so good luck
Hi. I'm trying to end a "MoveTo" task, and I'm saving the AsyncTask reference on my character. For some reason the reference is being invalidated once it reaches this point. I'm saving the async task in two different situations and one it works the other the reference is lost. Any ideas why? One is being set in a GameplayBehavior (the one that doesn't work), the other one in a State Tree task (the one that works)
Iβve been experimenting with SceneCapture2Dβs and RenderTargets recently and keep running into this same problem. Every time I try to capture a scene to a RenderTarget, the final image always ends up darker/higher in contrast than it should. For example: This is the view from the player camera This is the captured image After hours of f...
Can anyone with any knowledge on SceneCapture/RenderTargets comment on this?
it's not as beautiful as you but the idea is there @dark drum
In a Blueprint Actor Viewport, is there any way of changing the default camera settings, ie focal length, and optionally switch to Ortho from a Perspective view?
but i guess the shape of the trace show that i have a bad computer π
Nice and well done. As for a bad computer, maybe not. π
The frame rate of the animation can affect it as well. (Normally 30 or 60 frames per second)
I had looked into adding additional points in-between and smoothing them out for a smoother curve. I didn't get anywhere with it but it might be a direction for you.
I'm using an interface to communicate from an Actor to a players Player Controller to keep everything decoupled.. In the image I am calling 3 separate interface functions on the same interface which then calls their respective functions/events on the Player Controller, in terms of performance would it be better to have 1 interface function in place of those 3 functions that calls all the same functions/events on the Player Controller or does it not make a difference either way? and I don't mean 'does this particular example make a difference' but like overall using this as a framework of communication, especially for multiplayer
The bigger question is what are the functions supposed to do?
I rarely use an interface let alone 3 BPI functions called one after another.
They're doing this, one sets an actor reference which is used elsewhere, the other 2 are just updating widget stuff.
I'm using interfaces to avoid coupling my Actor to the Player Controller.
You can at least merge the display CCTV and update name functions.
I'd need to know more about what happens before and after to make more suggestions.
I suppose I could but the update names gets called when cycling through cameras whereas the widget itself is only displayed when interacting with the 'Control Panel' Actor and removed when exiting the cameras
What I was thinking was 1 interface function 'Set Up CCTV' or something, which takes the Actor reference, the Display bool and Name inputs in and just calls all 3 in one interface function on the Player Controller instead of 3
What is the actor reference for? The source of the capture component?
Its used as a way to call functions on a different interface, its used in other places as well but almost in the same way
Interface functions everywhere. π I take it you've not learnt about actor component and hierarchy?
Anyways, what's the CCTV camera array to pull the name from?
Not sure what you mean? I've set up my player interaction as an actor component but not the actual interactable actors themselves, they're still set up as child classes of a 'BP_Interactable_Base' class
The CCTV Cameras array is an Actor array of type BP_CCTV, its editable so the BP_CCTV's can be placed around the map and then on the BP_CCTV_ControlPanel (which is where the first SS is from) you add each BP_CCTV into it
Also all the code does work btw π everything works as expected I just don't know from a performance standpoint whats better
I'm having an issue with my health shrine logic and replication. When any player triggers the health shrine it is only healing player 1 (Listen server). How would I go about getting it to replicate to the player that instigated the healing, not the server?
Here's my setup:
- Images 1-3 are called on player bp.
- Image 4 is in the health shrine bp.
Ah ok, then you can boil it down to a single function where you pass in the control panel. If the panel provided is null, remove the widget. If it's valid, show the widget and get the name of the first camera. (You can get them from the panel ref)
Is there a reason you're using interfaces so much? Seems unnecessary.
Purely for decoupling reasons if I'm honest, the player controller is where the widget is kept and I need to communicate from the control panel Actor to the Player Controller to display the widget and update the camera name and keep hold of the control panel Actor reference while the player is using this control panel Actor, if I don't use an interface I would have to cast to the Player Controller directly to call the display widget, update name events but then I would be coupling the control panel Actor and Player Controller classes together which I want to avoid because realistically there is no need for them to be coupled like that
I feel like the logic you have on the player controller should just be on the control panel. To me it doesn't make sense that the player controller does anything with CCTV directly.
I assume the control panel is an actor the player interacts with. You can pass the instigator through and get the controller directly from that to push widgets.
Im not sure, having inputs (IA_SwitchCameras for example) on an Actor feels wrong, inputs should really be on the Character/Pawn or Player Controller, the code for cycling cameras is on the control panel Actor but its the Player Controller who needs to tell the control panel Actor to cycle cameras because its based on input from the player
If you aren't wanting to put the input actions directly in the actor, I'd funnel it through the interaction system instead.
If you do this you could remove all 3 interface functions. π
For my interactions I normally pass a gameplay tag through that I can use to control what sort of input was pressed to trigger the interaction. You could have your main (inital) input that starts the interact and then addition (secondary) inputs that can be triggered during the interact.
Kind of re asking this here
Inside of blueprint how do I read from a string table to get its entry? The only function I can find returns a string (the function is named source string i think)
I need to dynamically select the text at runtime though
I would guess its the 'As BP Adventurer' reference, in your BPI_Interaction interface add an input to the Interact function of type 'whatever type your player BP is' called 'Player' or something, then in your server RPC event plug 'self' into the new input, you'll then have a reference to your player BP to be used in the class that implements the Interact event (health shrine in this case), then call HealPlayer using the reference passed through the interface instead of whatever As BP Adventurer is
Sorry. Do you mean in the interface itself add an input and connect it to self like this?
No your interface function, open BPI_Interaction and add an input into the Interact function you've created
Do you mean like this?
NM That fixed it.
Thank you
No worries mate, this method does however create a coupling between your Player BP and the Health Shrine Actor by passing a direct reference of your Player BP through the interface but if you're not worried about that then this method is fine
I wasn't worried until now. Is there anything wrong with doing it this way?
Nothing else should be able to use the shrine except for players.
It really depends on your set up honestly, whenever you create a direct reference to any another class it couples the classes together, if you right click on your BP and click 'reference viewer' it shows you everything that depends on that BP and everything that BP depends on, this means that all classes the BP depends on must be loaded into memory in order for that BP to function correctly.. have a look at 'dependencies' & 'decoupling classes' if you're unsure.
So again whether it matters or not depends because if its just a Health Shrine BP coupled to your Player BP and that's it then it prolly doesn't matter too much, but if you plan to have loads of different actors all implementing the Interact event then they'll all be coupled to your Player BP (shown in the reference viewer).
These two videos are good - https://www.youtube.com/watch?v=y4fE2JdFdvY | https://www.youtube.com/watch?v=EQfml2D9hwE&t
Thank you for the information. I appreciate it. However, the videos you posted are the same video.
Updated it lol
The solution to decoupling is essentially using more interfaces or creating actor components, if you want to decouple what you've just done you can create a new interface 'BPI_Player' or something, create a function on it called 'Heal Player' that takes a Float input, implement the new interface on your Player BP class, implement the 'Heal Player' event and have it call your 'HealPlayer server RPC' event, then on your BPI_Interaction interfaces 'Interact' function change your 'Player' input type from your Player BP to just 'Character' or 'Pawn', you can still pass 'Self' into the interact function like you already are because whatever your Player BP class is it'll derive from ACharacter or APawn class, then lastly in your Health Shrine BP use the Player reference and call the Heal Players (Message) function on BPI_Player (or whatever you name it)
Doing it this way takes advantage of the base classes (Pawn/Character, which will already be loaded into memory anyway) without using your own custom BP (BP_Player or whatever you've called it) and still being able to call the functions and events on the class without creating a direct reference to the class itself, keeping it decoupled.. this will make more sense after you watch those videos π
Thank you for all of the helpful info. I'll watch those videos for sure. I want to do this the "right" way early and use best practices. So if this is more modular, performant, and "safer" then I'll do that.
No worries mate, decoupling is definitely the more modular approach, as for performant there is an overhead cost for using interfaces of course so as always its down to how you use them that will determine whether the overhead cost of using interfaces is worth the cost to keep everything decoupled or not but that is obviously dependent on the scope of your project ect ect..
btw, I can't find actor by GUID
how can i make to arrows make look each other
Quick question about maps - If I'm looping through the keys of a map, and I want to alter one or more key/values as I go through, can I just add that key back again without affecting the loop, or will any key I add in again reappear again at the end of the loop?
AI says this:
As far as I know adding an existing key replaces the value, it doesn't remove anything. So it should be safe - but you can always test it yourself too.
How can you make what?
i wanna make them look each other
Use their positions in a FindLookAtRotation node, then apply the rotation. Same for the second one, but with start/target flipped
Okey but i need just one arrow move other need to static
Then do it only for one of them
Apply the rotation to the one that you want to look at the other
Okey thanks
This is correct
after check index 0 loop is getting stopped
There's a lot to digest but I just wanted to add (for those following the conversation) that you should be careful with overusing interfaces.
It can be the fastest way to make your project unmanageable as it scales. (Not often discussed and overlooked)
It's important to remember that you decouple the system not the elements/components that make up the system. Interfaces can be great for system to system communication but shouldn't be used when communicating between different sections/elements of the same core system.
An interaction system getting information from a stats system. Good candidate for an interface.
An interaction system calling a function on an interactive component. Don't use an interface.
A stats system getting buffs from another pawns stats system. Don't use an interface.
Pretending interfaces don't exist and only using them as a last resort can help foster better decisions when it comes to building gameplay systems and the flow of events.
For the most part this is fine. When you get the keys of the map (to perform the loops) the return value is cached so doesn't get any new keys unless you call the function again.
(This is me assuming you're doing a for each loop of the values provided by the get keys function)
Edit: I've just remembered they added a for each loop specific for maps so I'm not sure if it applies to that node as well.
Do you perchance have a Return node further to the right?
Ok
Usually if doing a loop inside a function tto find something you return only on one of the branches - so only when you find what you were looking for. The other branch doesn't lead to anything
In your case you probably want to leave the True execution as is. And connect what you have now on False to the Completed pin on the Loop instead
But what do you want to do? Using less with texts is not something you do often
its a timer. I want to make it so if the timer is under 5 seconds the color is green and when it isnt red
or whatever
Then use an int/float for it? And convert to text only for displaying
oh yeah
my bad
I was using the text in my ui instead of the float I already have
bruh
I've already found 2 pieces of work on your 'Portfolio' stolen from someone else. Also wrong channels.
<@&213101288538374145>
I have question about Instanced Static Meshes.
If I have 200 actors and each of them has Instanced Static Mesh, and they use the same Static Mesh, is it correct way to use it? Or should I have 1 actor with ISM and other actors add instances to t hat component so they are visible in the 'game'?
The point of ISM is to minimize draw calls. If the meshes are instaces of the ISM, they are drawn all at once, which helps greatly with performance.
If you have several ISM, they will all be separate draw calls, even if they use the same static mesh as a base
And as to if you should have 1 actor - it depends what it is for. If it is like a building - yes, it is better. But if the actors are independently moving pawns for example - not sure, since all instances of the ISM share some settings and behaviors, like culling
Adding to this, there is a relatively new feature called instanced actors. Depending what you're doing, this might be a feature worth checking out.
So this only works if I have 1 component and each actor adds Instance to ISM to 'display' to that one actor with instance?
Or if each Actor has ISM and uses the same static mesh then it will be one draw call ? Rather than if I had Actors with Static Meshes then each static mesh has 1 draw call?
I didn't know about it, I'll have to check it out too
maybe simpler question is - is Instanced Static Mesh Component* on each Actor literally the same as just putting Static Mesh on each Actor?
So if you have two ISM components, that's 2* draw calls. If you had 5 actors with an ISM Comp then that would be 5* draw calls.
One thing to be aware of is the draw call count is affected by the number of materials the mesh being used has.