#blueprint
402296 messages ยท Page 840 of 403
So, I also have to destroy the 'Outer' object and then it get garbage collected. Can the reference be removed in the Outer object?
UObject holds a reference to Outer, but Outer holds no reference to UObject
But it stops garbage collection
I have an Actor BP which is the Outer Object while constructing. The created object only get garbage collected if the Actor BP is also destroyed. Only setting the Object reference to null does not collect it
Or maybe I'm doing something wrong
This is what I'm doing
What is it?
Construct node still holds a reference to the UObject
Call it 'myvariable_protected' or something instead of 'myvariable'
I'm confused.
But you have to use that node? How else would an object be created?
Also, how does a node hold a reference?๐ค
Wouldn't that make it impossible to release the reference then?
Is that BP an Actor? Just spawn it if so.
Reference gets released if you call the node again. Manually setting it to null via set var by ref should work aswell
Are those blocking refs?
the return values on a node?
I somehow imagined them being an exception to the garbagecollection system
By calling again, you mean calling 'Construct Object' again right?
Then that would create a new object?
Yes, and release the old one
So there's always going to be at least 1 reference then
got it
The BP in the image is an Actor, but what I'm spawning is a custom class derived from Object
A question, I was working on my project when I wen to add some things to the PlayerController just to find it that the project is setup for that, It's just that I can't find it.
No matter what I do, That file doesn't exists.
this works
So, the 'Construct' node acts like a variable in itself
I didn't know a node could do that ๐
That still didn't work so i tried bitshifting in blueprints... Flloored my ram to 32gb crashed my engine so i just made a blueprint node....
int USeedGen::GenSeed(int worldSeed,int chunkX, int chunkY)
{
int h = worldSeed + chunkX * 374761393 + chunkY * 668265263;
h = (h ^ (h >> 13)) * 1274126177;
return h ^ (h >> 16);
}
Was just... alot easier
That was the first time i ever had a huge headache in blueprints
Hahaha
I actually have no idea why the same stuff in blueprints just fucked up
Could be a UE5 thing tbh
scam link, do not click
discoerd sure sounded tempting
Idk my fav was discorb
i would think biscord was more up your alley tbh
Havent seen a biscord, but my all time fabs were discorb and streamcommuninty
Construct returns a reference to the UObject, when the reference is gone it gets GC'd. You could also save it into a variable to accomplish the same.
I just always naively assumed that return pins on nodes where somehow excluded as hard references
Having to manually clear them is.. interesting
Yes, But I thought once the execution of the pin is over and you don't store it in a variable, the reference would be gone.
I didn't think it would keep the reference till the end
It assures that you can use a reference later without saving it to a variable
And Garbage usually isn't a problem in blueprint anyways
fair enough
When I leave my car at an angle, this happens. How can I fix this?
Because this does not fix it
Well that fixed the character but not the camera
so this doesn't work
Undo what you do when you enter the car
Use set control Rotation instead
I don't think I get what you mean
Or Driver->GetController->SetControlRotation for multiplayer
Yes
Thanks a ton
hi everyone, can anyone tell me why physics object behave difrently depending on resolution and a way of potentially fixing this?
when i play on standalone full screen the results are vastly difrente from in editor aswell and when packaged into executable
Iirc default ue4 physics are change with framerate, not sure if they ever fixed that, i remember seeing it a while back
oh so its the framerate thats affecting the change?
Could be, i may be wrong though, physics isnt my specialty
i am making a 2d physics based pong game but the ball either gets added force very slowly or super hard
that would make sense
Yeah physics change based on frames, they can start to break at high framrates
For now maybe cap the fps
i will give that a go , thanks ๐
Np
hi, quick question, is it okay/proper to use the level blueprint to make events happening to the level? I.e weather events and changes
if they are unique to the level, that's where you would want them
if they are part of a system, you may be better off with a weather manager
lets say its like this: weather changes, players widget and ui and stats should react to this, its still okay?
that's irrelevant
okay, thanks!
I would say as soon as you need communication you are better of not putting it in the Level BP
does communication includes only retrieving data? no, or? cause what the player will do is only ask "what the weather is" and use the data to react accordingly.
I don't even think you can retrieve anything from the level BP
i mean we cannot change weather and all im trying is to try to object oriented thinking..
you can send tho
The level BP can only send
thats enough :D
cause .. all weather does is send, i mean i cannot change if it rains, but i can open an umbrella and the nature doesnt do it, i do, i hope it makes sense. Thanks guys, it clear that level bp's are exactly for systems like this.
So a dispatcher perhaps
or a direct call to the player if its only for the player that cares about it
sort of yeah, all needed is an independent weather system which works for itself, player only uses the data to do other things
I generally avoid level BP beyond debug
mind elaborating why? i thought about making an extra bp with a huge trigger box, and do exactly that, so far i started with lvl bp, but i gladly change my mind if its "better" due to X reason.
love hate here haha
It's more a me thing probably
ah okay
Most of its usecases feels as dirty as "getallactorsofclass"
"Lets just grab an actor ref here, and hardcode some stuff to it"
so in the end, i guess it depends then on use case
But you can't reference it, it's limit to the level, I tend to forget it's existence
And I like modularity
basically, all needed is try to replicate things around the world, weather is nature, and thus not controlled or altered by humans (directly), so a player cant change anyting, he spawns into the world and the world affects him, not he affects himself according to the world. Like.. "hey look im on moon, ah true i need to hold my breath cause there supposed to be no air" <-- i want to avoid this xD
im trying "ah damn i cant breathe, the planet doesnt have any atmosphere", how does he know? environment "told" him
I cant reference to level bp like "get" its stored variable reference?
WeatherSystem would in my world be its own actor
Yeah now it makes more sense..
LevelBP might spawn it due to level specific parameters for it,
Then Level bp is in most cases empty, ive seen it empty too mostly
Yeah i'd prob let GM or smth spawn it really
Or pre placed in the level, but then there's less control over it
makes sense, sort of like "generate and calc stuff in the existing world"
over when it initializes compared to other classes ..
Exactly
"Oh , this is some icy world with winter storm, lets tune this to the max!"
yup, still follows the rule, something "creates" it, it makes still sense, level bp could be "nature" in this case instead.
nice nice, thanks! good thinking
who creates it is less important as long as you have control over when it must be created and initialized (hopefully before player can see it winding up etc)
yeah thats exactly what a loading screen is for if it takes longer than a flash i guess
Exactly
Level BP is untouchable by anything and can only send
But it does receive event dispatchers. In reality it's not a "bad" thing to use, it just has specific use cases
It does serve a purpose yes
Its not inherently bad
Its just heavily abused in those uses i do see
not strictly true, it really depends on whether it's a system or level unique. if it's thematic to the level that there is a weather event and you want that to display on the hud, that's definitely level BP territory
if you have that for multiple levels however
it's better to have it systemic
I usually see the opposite: that people try to do unique level events as systemic
Tbf the only references i do have are those coming from tutorials, which is in a league of its own when it comes to quality and consistency
that sounds like me lol
fair enough, I don't watch tutorials but I can imagine them being quite underwhelming in terms of architecture
Oh they never disappoint ^
true
Then again my architecture is pretty far from perfect aswell ๐
as long as you can stave off tech debt for some time I'm sure you'll survive
Im used to finding fixes even in horrible setups so Most likely it'll work out in the end
Not sure what you mean by tech dept ?
Is that some common term for painting one self in a corner by bad architecture?
Ah. I try to avoid it to the degree possible. I feel like im bending over backwards to avoid future problems, but not sure yet as very few of my systems end up being developed far enough for that to become a thing
Perhaps this time... ill see if i managed ok
ok, quick explanation for 'tech dept' please?
is it the need of rewriting bad code?
i created a collision preset. this preset problem is can push by other characters in map. but default presets Do not have this problem
yeah I was gonna link this
which really springs from the fact that software development (and by extension game development) is wicked problem solving: https://en.wikipedia.org/wiki/Wicked_problem
In planning and policy, a wicked problem is a problem that is difficult or impossible to solve because of incomplete, contradictory, and changing requirements that are often difficult to recognize. It refers to an idea or problem that cannot be fixed, where there is no single solution to the problem; and "wicked" denotes resistance to resolution...
Hi guys, question about a character BP... I know how to set a morph target on BeginPlay, but what if I'd like to have it applied just in the viewport, so without any play or simulate event? Possible?
Construction script
or editor event
Thanks. Construction script doesn't have a set morph targe node however?
then editor events are your best bet
Ok, thanks I'll google about it, I never used them
they come up in the instance details panel like this
custom event -> details panel -> mark as "Call in Editor"
they cant have inputs
so the "inputs" must be instance editable variables
Thanks a lot @gentle urchin , appreciated.
I have a scene with many torches. I want to change the brightness during gameplay. I adjust the Intensity and Attenuation Radius but my FPS is dropping bad.
Is there a better way ?
https://www.screencast.com/t/YThtHg65wwx
Is there a way to 'Mask' off the Directional Light/Skylight?
what do you mean "mask"?
to have areas of the map that the Directional Light/Skylight don't effect
right now they are 100% off
but if i turn them on a little bit , then i can see the center area
not that I know of. sounds like stuff you'd want to handle at a renderer level
Show how you're adding force
I have set it but probably something it's missing, as it doesn't trigger the morph in the viewport. If I use a Toggle Visibility node it does work though... odd that can't set the morph target, maybe isn't supposed to?
I'm trying to spawn a big block of instances of cubes (32*32*16) but it crashes when I click run :(
The code is very basic, just a for loop in a for loop in a for loop, each for loop for each dimension
And "add instance" at the end
But I end up with this:
Idk if PC specs matter but they should not since I have a decent computer
GTX 1050 (with 2 GB of VRAM), i5 7500 or sth close, 20 GB of RAM
But most importantly I use (Arch) Linux btw
pc speed doesn't matter in this case
it just makes the int negative
ok
bp has a default max iteration of 1 000 000
yeah, if the loop is set up correctly
Remove your math shenanigans and confirm that a loop that phat can run
try adding a variable that increases inside your deepest loop, and print it everytime afterwards
Index is only set to Y axis?
max loop iteration is 1000000 for me by default
it's possible multiple nodes increase that count faster?
no clue
not sure I understood XD what do you mean by that ๐คจ?
IDK if it would but your non-pure minus node might be messing with your index
and then sets to Z
Remove the non-pure minus and run it
oh yeah
alright
- takes a ref
you might be modifying the index in place lmao
don't do that
it's flipping it each time
I can't print it... Because my code won't even run lol
should print nonetheless
Even if that's what he's after he's not gonna get it with what he has
until it breaks
it surprisingly works without the - sign
Not surprising.
- takes a ref lol
just don't modify the index variable itself (aka don't connect it with a diamond shape)
If your math has an execution pin you're prolly fucking up unless you mean to
My math has an execution pin? What do you mean?
I don't know if this helps, but there is a handy 2d Grid Macro build in
what
and you can just run that Z times
is it build in?
Ooh I see what you mean
i said the same thing when someone showed it to me
At least you understand how to do it manualy
This is right, right?
I now have a loop of 64*64*64, but it crashes because "infinite loop"
64*64*10 works tho
are you clearing instances before you start your loop ?
you may be stacking them on each other
Maximum loop iteration is at 1000000
1 000 000
I'm only at the quarter
It should be fine shouldn't it? but whatever, Ill split work
Also, last question, is it possible to have a instanced blueprint instead of a mesh?
You're getting into C++ territory IMO. This is not sustainable in BP
What's your frame time when you hit that loop?
yeah cpp has a lot faster iteration time
I thought BP was just CPP but graphical :(
You mean once all the stuff is generated, or as it's generating?
It sorta is but also like 100x slower and limited. I love BP and would never use anything else if it not for the limitations.
As it's generating
UE4 version of Cpp is so weird so I thought using BP directly would make more sense, but now you guys are telling me it's slower :(
It is quite a bit slower
It's always been slower. Use BP if it works for your use case, but I'm smelling this as not working. What are you trying to do, gameplay wise?
Proc gen a level ? First guess
Recreate Minecraft, kind of
Go cpp straight away^
Start with breaking the work up over ticks. That's what Minecraft does
Mhh got again in Trouble i have, 3 Widgets as Child in an Widget, why on debugger its always duplicates, like i called it "0""1""2". and i get it doubled -> https://puu.sh/IJLc5/ae6711c353.png
I feel like it would be easier to use Blueprint first, because Cpp objects are just a code representation of what Blueprint graphically represents. And it's easier to learn with graphics representation
But what you want to do is more suited to native code
Yeah ik
But it's not a real project
It's just to learn
Ill redo it in Cpp after I have made sure I understood everything
I'm a diehard Cpp fan so dw I'll do it ๐
I can get behind this. Forge ahead !
I mean 100x slower is an exaggeration. But loops are particularly not good in BP
In my case i got 8x the speed ๐คทโโ๏ธ
1 to 1 bp to cpp
So if you've made it work ok in bp you can be sure to reap some rewards moving to cpp ๐
I've only done proc gen in bp myself
Could go relatively big maps before loop iteration went to slow
Is it advisable to use the thing that converts blueprimts to native code before packaging
Even then, chopping it across a few frames avoided the 10 sec freeze
Not really, nativization is gone in ue5 atleast. Works pretty unreliable after what ive heard
Ah, okey doke
only if working with cpp was faster on my machine ๐ฆ
takes around 10 minutes to compile everytime I make a small change
i don't know. I 'Rebuild the project' in VS
OR use the 'Compile' button in the editor
both are really long
'Rebuild' rebuilds all of it, while 'build' just builds the files affected by the change(s)
How i edit Items in Array?, i was trying to Insert, but thats not like Editing, thats like Adding everytime..
But is this not like Creating always an Array Element?
Like i try to Add Dynamically Indexes on Changes,
like on Text Change, Add it on that Index ->
only is Size to Fit is checked AND you dont already have that index
Yeah that works Flawlessy, got bad Experience with it, but thats what i want!, Thanks Bro ๐
Hi
How do I disable and enable a component in an actor through blueprint?
I want to make a cube appear and dissappear
So for some reason, even while setting air control to 1 I cannot maneuver my character at all when falling... Any thoughts as to what I can check?
for some strange reason, that I don't know. sometimes I just can't get a widget to close. I'm opening and closing my inventory widget from the player controller,
I have watched about 3 videos and still have the same issue. anyone have any idea what I'm doing wrong.
Instead of relying on your custom bool
You can check if the widget is in viewport
Also you dont have to create a new widget each time , but thats just a detail i suppose
well it looks like the UIInventory wasn't getting set, So I added this to the construct in the Hud.
this is what I changed.
how ever it still doesn't close the widget. I can open it, I just can't close it.
Is it possible to call a Super in blue prints from a parent class? Let me show you a simple example.
Expected result: "Hello World!"
Actual result: "World!"
Hello everyone, I am creating an endless runner game and I have infinity tiles which spawn when it is collide with the box. When I set the for loop to 2 it creates 2 tiles in front of the character however in time its became massive amount of tiles and I am looking a way to tell the engine the max amount of the tiles.
Right click the event and there is an option to call super
Kinda new to blueprints, but are you trying to get randomness for the tiles? I would see the events to achieve this
I read that on internet but I can't find that option.
Hi
How would I get a child camera to follow the parent but add extra values to the position on runtime?
Hello everyone, newbie question here : In my PlayerController there is a Componement, I would like to have access to a variable that belongs to the PC from the AC, it's there a way or I need to cast it.
At the start of the event, as the first node it plugs into
It is but code takes time to execute l, its likely gonna be quicker to print the string than it is to call the parent
That is my main concern. I would like it to be synchronous, call parent event and just after it finishes, call the child event.
I think I've got an idea, though...
Go for it !
Just make the function in the parent
Call it at the end of on landed
Override it in the child
So how do you use a while loop without getting the infinite-loop error?
Isn't it the point of a while loop to be "infinite"?
I come from Javascript but I doubt it's different in c++
Why can't this just run until I set Can Enter to false?
It does
It runs the while loop in one frame
Or do I have to set it to false inside the loop at some point?
So I can't wait for another event to set it to false
if you don't set 'can enter' to false in the same frame, it throws you out
I thought the same and it works! Thank you!
not like that
No, cuz its blocking
It blocks anything else in the game thread from being processed
you can however create your own while loop and add a delay after every loop
Then I can't really do this with a while loop
Just want a text to rotate with the controller camera
Yes you can
But not ... in a while like that
You could say the preconditio for the while loop is a rotation comparator
Tick then?
If rotation != desired rotation
But
It doesnt make sense to have such a thing in a while loop
Tick is reasonable for this, yes
Aren't too many functions on tick tanking performance at some point?
Why is there no option with texts to just do this 
It would be done on tick..
You can add a rotation component to it
As the partial root of the text component
They tick in c++ so less costly
you could also create a timer
but usally rendering or physics stuff are one of the only things you actually put on tick
^ some of the good usecases for tick*
on this tick topic i was having a question. Should I use tick if I want to track what's the closest actor based on player distance?
Because to find the closest actor I'm using "get all actors of class" and for each loop, and running a loop on tick is costly.
How often do you need to check the closest actor? Almost constantly?
yeah that's really inefficient. I'd avoid ever using get all actors of class
all the time, kinda proximity based project. Press key to find closest actor thing
oh i could use this "press key thing" to fire the event
if you have to press a key, then you don't need any logic before that keypress
It's fine if you do it once to get the list, save it to a variable and then just loop through the locations
This was the reason why I was asking that ๐
Also using a collision volume for this probably makes more sense
Registering objects that come within a given radius
Then I would need to filter what that volume collides with
correct
Either you do it initially by the channel so only objects you're interested in reacts to it ,
Or you do it on overlap and check if they have a given property that you desire
Like Tag
Besides the Tick there, how does it look? (made it compact for the print)
messy
messy cause i had to pack the nodes for the print ๐
there is nothing inherently wrong with the code shown, but it seems to cover a lot of cases on tick rather than looking into how those cases should actually be registered
The idea is to replace the Tick with the player input event to fire the closest actor reroll, this would be more efficient correct?
it would but you're not solving the problem, only moving it
realistically it's fine but you can mash that key and you'd still have issues with framerate drops
indeed, thank you for the input will think of a way to put a cooldown or prevent the over triggering.
that's still a bandaid on a broken leg
Getting rid of the GetAllActorsOfClass would be my first mission
that part is easy
you should create an architecture to support this instead of looking at quick hacks to fix them
like CE said, it's still a problem and adding a cooldown is basically just sweeping all the dirt under a rug
all it takes is that rug to get moved and the dirt goes everywhere again
GetAllActorsOfClass isn't that bad performance wise btw
it's not just that it's bad for performance (and it is, if you look at the actual cpp code), it's also that it is a terrible shortcut that instill bad habits
It's not THAT bad but it could be much better
Sadly don't have that know-how to build that architecture. The player input is basically an aid to find actors on a maze. In the maze the more you use this the closer the bad guy gets to you. So I was assuming this would disincentivize player to abuse, on top of this indeed I need some sort of resource to manage the potential abuse. Any references I should look up to build this architecture?
Yet almost any setup beats it in performance :p
well you were given suggestions for it
registering actors on collision is a better way already
Also, I'm using this GetAllActorsOfClass because I need to reference actors that are streamed from other levels (maps) and didn't manage to find a way to reference these actors from other levels. So the idea was to target them after the level stream. Could you suggest any links or advice to target actors on other levels?
There's GetActorOfClass if you just wanna access the first one too
Less messy visually
the collision approach solves this issue
GetAllActorsOfClass utilizes hash maps which at best case is O(1) and at worst case is O(n), however I totally agree with your second statement
it doesn't
look at the code
it iterates through a TArray of actors
I've seen way too many youtube tutorials that push using GetAllActorsOfClass
Re-reading this tip, I would need to set a pre-determined distance or size of this volume, what if the actors are outside of the collision radius of the volume?
I'll check again
also UE doesn't use hashmaps, it uses TMaps, which function just like maps in BP and require a key,value pairing. it would make no sense to get actors from that because you'd still have to get an array of keys
that's fair
I don't know the implementation of TMap
I know TArray is a heap
is it?
Yeah it would be a predetermined size. Sorta depends on your scenario. Is it a problem not finding any object if none is within the given range?
Should I PM you to briefly talk about it?
I was under the impression they came pre heaped
wouldn't you just go left to right in the heap for indices?
it only tells you of inconsistent dll linkage, not of consistent dll linkage ๐
I ended up with two TMaps for semi-predictable iteration, and for speed above TArray
I think I've already asked this but can I have an instanced mesh that is a whole class I created, like a BP?
I have my chunk, my chunk is made of blocks, I'd like to have a ISM that stacks those blocks
How should I do it then?
Hello, how can I trigget 2 events at beginplay? This is not working, im trying to play video and audio at the same time
that's up to you?
you don't know what?
I have a block
I want a chunk that stacks a lof of blocks
But I don't know how to do it
ISMs are available as component inside actors if that's what you're asking
I don't have the full source installed and going through it via github is rather hard, does that count aswell? https://www.casualdistractiongames.com/post/2016/09/15/Inside-UE-Source-FUObjectHashTables-the-magic-behind-GetAllActorsWith
No I know how to use ISMs
If you wanna make minecraft you shouldnt be stacking cubes
yeah there's no such thing as an instanced actor in that capacity
Alright
you can have a manager actor that spawns bricks as you want them
or you can use the bricks as meshes
void UGameplayStatics::GetAllActorsOfClass(const UObject* WorldContextObject, TSubclassOf<AActor> ActorClass, TArray<AActor*>& OutActors)
{
QUICK_SCOPE_CYCLE_COUNTER(UGameplayStatics_GetAllActorsOfClass);
OutActors.Reset();
// We do nothing if no is class provided, rather than giving ALL actors!
if (ActorClass)
{
if (UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull))
{
for(TActorIterator<AActor> It(World, ActorClass); It; ++It)
{
AActor* Actor = *It;
OutActors.Add(Actor);
}
}
}
}```
yepp, that fits with the article I send pretty well
you do see that it is going through a loop that the article conveniently leaves out?
it loops over every actor of the class and just adds them to the out array
I never said if you want the best performance for you game use GetAllActorsOfClass
I just said it's not that bad as it often gets called out
void operator++()
{
// Use local version to avoid LHSs as compiler is not required to write out member variables to memory.
AActor* LocalCurrentActor = nullptr;
int32 LocalIndex = State->Index;
TArray<UObject*>& LocalObjectArray = State->ObjectArray;
TArray<AActor*>& LocalSpawnedActorArray = State->SpawnedActorArray;
UWorld* LocalCurrentWorld = State->CurrentWorld;
while(++LocalIndex < (LocalObjectArray.Num() + LocalSpawnedActorArray.Num()))
{
if (LocalIndex < LocalObjectArray.Num())
{
LocalCurrentActor = static_cast<AActor*>(LocalObjectArray[LocalIndex]);
}
else
{
LocalCurrentActor = LocalSpawnedActorArray[LocalIndex - LocalObjectArray.Num()];
}
State->ConsideredCount++;
ULevel* ActorLevel = LocalCurrentActor ? LocalCurrentActor->GetLevel() : nullptr;
if ( ActorLevel
&& static_cast<const Derived*>(this)->IsActorSuitable(LocalCurrentActor)
&& static_cast<const Derived*>(this)->CanIterateLevel(ActorLevel)
&& ActorLevel->GetWorld() == LocalCurrentWorld)
{
// ignore non-persistent world settings
if (ActorLevel == LocalCurrentWorld->PersistentLevel || !LocalCurrentActor->IsA(AWorldSettings::StaticClass()))
{
State->CurrentActor = LocalCurrentActor;
State->Index = LocalIndex;
return;
}
}```
second loop inside the `++` operator of the iterator
as you can see above it is absolutely not worth considering in terms of pure performance. yes you can get away with using it because of today's hardware, but if you're doing anything beyond the simplest prototyping, it is not worth it
Just to be clear, i didnt mean anything along the lines of horrible ๐ just not good , and often leads to tech debt as we talked about earlier today :p
Relying on such a function, that is
I'm still trying to see where GetObjectsOfClass is being called
because we're not even at the end of the rabbit hole here
and we're already at O(n^2)
Well lets end that here (kinda out of scope for #blueprint ), I stand corrected (or not I'm still not 100% sure :p). In the end using GetAllActorsOfClass is (in most cases) bad practice anyways and should not be used beyond prototyping.
it's worth mentioning that using it in editor is even more expensive, as it adds an additional 2n from what I can see. though I suspect even with any hashmap functionality you'd still have an additional n somewhere
Hey folks, any idea why I'm getting these gaps between my spline meshes?
does your mesh have enough vertices to support the movement?
Spline meshes are also stupidly expensive :(
Smoother way to teleport to interiors? Don't think so. 
Why split the pins? ๐
Oh I played around with the Z value before
that double comparison is unnecessary
Yeah, plenty of verts, but to be honest I would still expect them to be butting up to each other, even if it was just a 4 vert plane
they wouldn't if the path isn't straight
apart from that, I'd say it's the spacing given per spline mesh component
Hmm, I'm not aware of a spacing parameter (at least, my searching found nothing). What do you mean by this?
Also
your MeshLength parameter is your spacing
Using mesh length?
still working on my fortnite building stuff this is some code i have right now for when something destroys gets really laggy when i connect alot of buildings to eachother https://www.youtube.com/watch?v=z9F7UVloESw&ab_channel=WALLZ "Death" plays when i shoot something https://blueprintue.com/blueprint/f6qyleq5/ , https://blueprintue.com/blueprint/tndzuvq6/ any idea on how i should improve / remake this EDIT: "Checked in", "Checked out" And "Checked" are arrays
It works so well
MeshLength just changes how long the mesh should cover along the spline, not the spacing between it.
yes but integrally in your your spline loop it handles the same. it determines the space from mesh pivot to the next mesh pivot
whether a mesh actually fills that space
@surreal coyote
Right, I see. Seems counterintuitive, but I'll try with that. Thanks
Yeah I suppose you're right but it doesn't hurt
In coding you always have to expect everything. Even players getting cars in interiors
how is it counter intuitive? you take your spline length, divide it by your spacing and have how long each segment is. each segment then gets its own spline mesh component
seems like correct logic to me
So why is it spaced
that wouldn't make a difference. you're already doing the cast
are you asking me?
Actually i think i realized it
Is the spline only like 4-5 segments?
Doing the division you're missing out on the fractional part
Ahh, yeah that'll do it
Hello I got an problem. My NavLinkProxy is not working. I assigned my NavLinkProxy to an BP, but when the AI follows me it wont go through.
I appreciate you thinking through this as well, honestly it doesn't make any sense why it's spacing.
I even checked the mesh pivot, and it's perfect
I've done these splines so many times before, no idea why now it's a problem
hi i started making a town down game yesterday, but im running into a weird issue where if my editor perspective isnt top down (ie: is in perspective) then the player starts in a weird location with the camera permanently rotated and i cant seem to find whats going on. anyone have any idea?
have you tried playing around with the mesh length and seeing how that affects the spline in question?
because there's your answer
Length / meshlength = #meshes.
Mesh index * meshlength = DistanceOnSpline
Math checks out in my head
But there is some initial offset
To only one of them
Which breaks the math
I think you need 1/scale somewhere in there if I remember correclty
Start of the mesh has an offset, end of it does not,
sorry, scale being 1/meshlength fraction
In the right direction that would give spacing
for the last one
Try without the offset? Null it temporarily
Sorry, do you mean "HeightOffset"?
Yes
That, or apply it to both start and end...
Same result unfortunately, all that's doing is shifting the points up in world space
I've somehow seriously broken this and I'm not even sure how ๐
Looks like the tangents are now broken too
this was surprisingly smooth
GetPlayerCameraManager->Fade
something along does lines
Ty
code i used, for reference
not sure what has happened really
Thanks! I'll try the flooring instead of Whole and Remainder perhaps
Yeah nope ๐
I tried using the start/end at each point instead, but it's not as good a method because you get massive UV stretching depending on the distances between points
ouf
looks pretty bad
i can force oddities at specific points,
but nothing weird beyond that
hey guys, is there a way to make a realistic mirror in ue4? i need it to be realistic no matter the cost in performance. Ive tried a second camera but ran into many problems, and using materials and planar reflections isnt looking too good :(, is there another way or am I missing something?
no array settings?
ue5...
I mean it's possible it's broken in UE5... But I'm pretty sure I had one working a few weeks back
Scene capture components
Why I have so many missing nodes, what the hell. I look for something and it's not there
turn context sensitive off?
are you in an UObject?
try with a different mesh
try the basic cube
nah
I did that too
that's all I got
same
What is the parent class that your blueprint inherits from?
functions don't support latent stuff like delay if you're searching for that
they would still show up I'm pretty sure. when placing them you'd get warned iirc
(the node wouldn't spawn)
just like spawn actor in construction script
I think that answers the question, thank you!
Why my particular mesh won't work is beyond me, but I'll investigate
Somehow its not the size it think it is?
they don't, the warning occurs if you paste them in
The world may never know.
I do have the 'bounds' increased (to avoid popping out when using worldpositionoffset i the material) but I doubt that'd be messing with it. I'll try
Ahh hahaah
Yeah, it was the bounds
Well, now I feel stupid, but at least I know that's causing it.
Thanks for the assistance folks
so im trying to play both video and audio on button press. But only 1 of them works. Can someone help?
I'm guessing the media player can only play one media at a time
even if I have 2 media players it still doesn't work
how did you setup 2 media players?
That's not two different media players...
I kind of suspected that was the case ๐
That is two different nodes, using the same pointer that points to the same media player.
Also
Why is the audio not encoded into the video?
because that would be too easy
because they are not from the same place
Why not use an audio component for the audio instead of the media player?
I tried that too
but maybe I don't do it correctly
is the audio in a separate video file?
That isn't an audio component.
Also. To do this, you probably need two different Media Players in your content browser. And even then I'm not actually sure if that'll work.
best thing would be to merge the audio and video channels before importing the video
well going by your previous example, you don't.
im not sure what im doing wrong
that's, again, not two different media players. that's just two pieces of media
I dunno. I've never tried playing sound through Media player unless it was encoded in a video file. Even then I use the MoviePlayer in C++ instead of the content browser MediaPlayer. Sounds are much easier handled as basic sound files through an audio component.
how would i get the timeline to stop part of the way from a to b
i tried to mess with the values of the timeline
but it didnt really change anythiong just the speed of movment
I did exactly this and It's not working
if you want to pause the time line and resume it later use the stop pin
else just adjust your float curve
remember that alpha is a value between 0.0 an 1.0 corresponding to 0% to 100%
Hi, does someone knows of a good way to find which character skeletal mesh is being used in the player blueprint? other than checking the name of the mesh? (I feel like that is something I shouldn't be doing, even though it only does it once at the start).
-I suppose that changing manually a public variable in each instance should do the trick, but I want to know if there's something that can automatically do that.
PD: I tried checking the distance between sockets and from the head socket to the floor. But my characters share skeleton, and that seems to make all values the same, even though all my characters are different height.
the only thing other than the name you could check is the asset being used
Hmm, btw is a bad practice to use the name? I'm no programmer, I'm just messing around. But I feel like that's like a "hack" way of doing stuff xD
usually you'd use GUIDs to distinguish assets in use, but unreal generally uses FNames for this
Timelines can have function tracks. On that function track you can make it pop out an event at a certain point in the timeline and that event can then stop your timeline.
Thanks.
Thank you, this seems to be the solution to my issue
Thank you for the help as well
hey guys, what is the best way to add my stats onto my charachter, i mean i got variables "strength,endurance" and each of them gives 5+ health how would i best make it interact with the value, instead of when increassing and decreassing str,end value to update should i use event tick to always set the max health value ?
When a stat changes -> recalculate stats
Either all or affected. Id just do all, duck it :)
yeah
Only on change
hm and i would do that inside my charachter Bp with all the variables i suppose ?
use a setter method, e.g.: create a function setStrength()
So when player levels up -> stats change -> recalc
When player equips/unequips -> stat change -> recalc
aye so i should do a function that recalcs ? and call it when i need it ?
Would recommend doing this inside of an actor component or something. Makes it reusable for other stats elsewhere on other things.
and the setter can call something like updateHealth()
Strengts affection on other stats would be hard to isolate in a singular comp tho?
It would be an entire stat comp
i wouldn't make a component for that
With its complex interaction inside
maybe rather an UObject
Why uobject over component? Modular piece of code may aswell reside inside a simple component?
component adds more overhead
and if you add one for each value you may get a clusterf*** of components in your actor BP
Nah, one for the entire stat system really , not one per stat
is there any way to create and publish game for IOS with windows PC?
Since they have some 'complex' effect on each other
That'd be a start yes
is using for each loop on tick a bad idea?
depends on what it does
it casts to the player, gets the current quest array, compares each item in the array with the quest object's variables then if it matches up sets the visibility of it's screenspace widget
it's a quest marker
yea that sounds like a bad idea
that sounds like something that can be event driven without any problem at all
i could have a event that fires when a variable changes in the quest struct
now guess what is more efficient, checking ~60 times per second or firing event every few minutes ๐
Using a timer that calls a timer that calls another timer that casts to all classes with a for each loop in 10 sequences and evaluates if the data is the same before infinitely adding it all to an array ๐
Nested timers decreases cpu cycle time, i've been told. Speed increases by power of timers
Pure mathematics
At some point i need to deal with the memory issue im facing ...
started coming after i played around with virtual texturing
which i have removed yet it haunts me
yay got it to work ๐
how do I make it so that my static mesh rotates toward its velocity?
So, what's the best way to remake Minecraft with Blueprint/Cpp?
pretty broad question
Anyone know why Making an Enum via a Byte is incorrect? In this example, just to test that something was wrong with bytes, I convert an enum to byte, to int, back to byte, back into the enum. I'd expect these enums to be identical, but they get different results (byte is always returning enum index 0)
tried going via literal byte?
you're truncating to int when you convert to int
expanding to int -> trunacting to byte , no?
might be
Take out the steps to isolate where its zeroing.
Enum - int - print
Enum - int - enum - print
Etc.
is there a way to append 1 array to another using only uniques. instead of having to go foreach loop and using add unique
hello, does anyone know if I can reference each chunk in a chaos fractured mesh system?
@torpid hound @odd ember I don't think it has to do with the int to byte conversion, for example, these both print the same results, where it should be different
The conversions seem to all be correct, in that they are appropriately always 0 or 1 as expected, but plugging those byte values into the enum results in the same enum (index 0) each time
Magic. Barring that, not really.
I mean you could dump them into Sets maybe. Can't remember how blueprint handles adding arrays to sets. Could work, but it's the same thing internally. Just loops over the members to check and adds them.
il try something with sets
Convert to a set.
Hey guys, I'm having a little trouble finding something, Like I literally just want to stop running a behavior Tree, The "Run behavior tree" node set up with no value dosent do anything, any ideas of a node ? I can always run an empty bevior tree to make the AI stop, but I'm pretty sure there is a "Stop running behavior tree" node, right ?
https://forums.unrealengine.com/t/stop-ai-behaviour-tree/303473
2nd link in Google
Is there a way to stop the AI behaviour tree from running? In the AIController module you specify it to run with Event begin play -> run behaviour tree and tell it which behaviour tree to run... All this is fine. I'm looking for a way to stop running the behaviour tree. The reason for doing this is if I kill a pawn I don't need the behaviour ...
thanks, I belived I tried that into the AI itself, not into the controller x)
so i'm trying to make a system to allow me to swap my character at runtime, and i tried this, but for some reason randomly sometimes it will not put me on the new character, but rather just put the character in the ground and not have any input
this bit of blueprints is on all the characters, and the get character macro gets the class of the current character
looking closer at things, it appears when the camera gets put in the ground, no new character is spawned, and all that remains is a camera actor
what's inside the macro
also I believe you don't need to unpossess before possessing anew
also I'd ensure that the controller you're giving is the controller of the character you are using
this is the macro
That really should be a function with a class input and a boolean output.
Not the problem though.
i tried but the problem is when i do that, the create actor won't send out a pawn, just an actor, meaning it won't work with the possess node
that makes no sense?
I mean the macro you're using the get the class and the == class check you have on your branches.
Hello, I am using set view target with blend, and it works great. The first time I have a smooth blend, but the second time it's called it's instantaneous. What is the reason ?
is the time set to 0?
No blend time is set to 2s everytime
that's what i thought too, but i stand here with evidence of unreals oddity
Don't mind the spaghetti, it's a POC
I have a camera rig with CAM_IDLE. I press a button and it's blending to CAM_PLAYER. but after that, whatever blend I call, it's always instant
it's not an oddity, but probably the default class is set to object or actor in this case, which is why you get that behavior. but that is also not what we were referring to
oops, my bad, did you mean the branch checks?
yes
gotcha, i'll redo those, and i tried removing the unpossess and still nothing
hey, i'd love some help. I have a blueprint spline which uses a line trace to snap to a surface but i'm struggling to get the spline mesh to replicate along the final spline. any ideas? - this is what i have so far. https://blueprintue.com/blueprint/jrtuppz3/
check what the controller is possessing
i have it connected to the character being spawned
right but you're saying it only sometimes possesses it
so check what it possesses in the cases where it fails
Hello, Add controller pitch Input not working! I tried everything but it does not work any idea ? I feel like it is a bug.
how would i find what it's possessing?
is this inside the pawn or the controller? if controller is tick enabled? if in pawn, does this event also exist in the controller?
I think the function is GetControlledPawn
It is inside the main character blueprint and there is no controller input.
When I connect that to yaw it is controlling it but not other way around.
i had it print when i did the switch and possessed, and whenever it failed it showed the correct name, but it still did the camera in the floor thing
the camera floor thing is probably setting the location to 0,0,0 which is default behavior
that appears to be correct, yes
what happens if you use SetControlRotation and modify the pitch of that?
and what's your input pitch scale?
it's likely in the player controller
random: is it possible to use the navmesh as a render target? or as something to generate a minimap sort of thing
possibly? not sure if it's possible in blueprint though
I fixed it thanks for the help CE
how did you resolve it? just for posterity
It was my fault, I enable the pitch and fixed.
i'm still stuck, not sure what it could be at this point
what did the possession message say?
Probably not in blueprint. The core data is held entirely in cpp and the render for the debug view is done direct in a scene proxy that's tightly coupled to the navmesh actor, so there's nothing that would be easy to extract and render out. It's not too much work to grab that data and reuse it for a mini map in cpp, but also not trivial either
it said the character it was supposed to be possessing, but the camera still returned to 0,0,0
how often does this happen?
Or maybe you could set something up work in editor and render out a single component from a top down view? If that's the case then you probably could just render the RecastNavmesh actor as long as the debug view were on. I don't know if that's possible though
@odd ember
I don't know why you keep pinging me when you have no new information. I know as much as you do
if it's happening randomly or because the switch is too fast perhaps it's a same frame type issue
but equally I've said how you could optimize your code so that your minimize risk of these issues propagating
my apologies, i'll see what i can do, thanks for all the help
anyone here good with bp splines and stuff? i'm not sure what i'm doing, been following a few tuts and i just want to be able to spawn mesh along this spline - at the moment there's a linetrace to make the spline stick to the ground, but i just want some mesh to spawn along the line. This is what i have at the moment, would appreciate some assistance - cheers https://blueprintue.com/blueprint/jrtuppz3/
I am trying to do something similar. I want to add two spline points in a world in real time and then connecting them together
oh, like an intersection?
when i mean connect two things together, i meant two separate lots of code together.
oh okay
can someone help me with this? I'm trying to spawn an actor at the position of my cursor in the world space but with this blueprint, it spawns the actor at where my camera is at. I guess I need to use "world direction" too but Idk what to do with it or what to connect it
get hit location under cursor?
thank you solved it
much more easy with that
Does the Blueprint version of GetComponentByClass not work with derived clasess? If I try to get a component of a base class type from an actor with a derived class component, it returns none:
Blueprint Debugger is unreliable, did you actually check if it's truly none?
Well, the code beyond IsValid doesn't execute, so as far as BP is concerned, it's none.
if I do a GetComponent<> in C++ it works with derived classes - it seems that in BP it does not
I was just hoping to avoid needing to write a new C++ class for a simple thing that can be done in BP
Yeah, I think it searches specifically for that class
Actually, I have it running in the debugger now - it runs the same code as FindComponent by class, the bonkers thing is the IsA test is Failing!!
OK, this is bannanas - when I step into the IsA() check - it returns true..... but FoundComponent never gets set?
I'm going crazy
It does
Your case just seems to behave diffrently
does your actor contain a static mesh?
actually create an new actor
just static mesh
and try it there
I've tried it with both static meshes and ShapeComponents - result is the same
the crazy thing I'm getting now is that the IsA check actually succeeds and returns true - but in the debugger the FoundComponent is never set (stays null) I'm not sure how the code block is getting skipped
it shouldn't
did you try to access a function of the component?
try that and see if it actually errors
Ok, so I see that GetComponentsByClass (with an 's') actually executes a different code path
yeah that returns an array
just tested it with my blueprint by replacing GetComponentByClass with GetComponentsByClass - and it works
that is weird
But GetComponent (no array) does not work - at least for me
in the C++ GetComponents uses the templatized version of the function, while GetComponent does not
I thought you accidently edited the IsValid macro
but that it actually just does not work is weird
No, I haven't changed the macro - I just finally got fed up and went to visual studio and am now seeing that these two BP functions follow very different code paths
just remember, the blueprint debugger is not reliable whatsoever
always print your values
Well, I guess this is the way for now for me - I mean, it's not super important code, but I'll need to keep an eye out, it could be that GetComponentByClass is broken in 4.27.2
wait let me try actually
I actually almost always use GetComponentsByClass
I just assumed they would behave the same
no idea whats cuasing this but it is blueprint caused... just not in the way you'd expect. I'm trying to organize my files but whenever I try to move the contents of the blueprints folder (They appear to be the ones from that one test level that shows the materials and effects like the smoke and light) the engine crashes. It dont even get to the part where i can copy and paste, dragging them is enough to cause the crash. Is there some aspect of blueprints that cause this jank orrr
When you move a folder with a whole lot of assets that are being used in the game the editor will try to redirect a ton references - which can go wonky
I am having an issue with moving some pawns they face the wrong direction when moving and I enabled orient rotation to movement but it still doesnt work
Ive manage to narrow it down, its a single default blueprint. When i open it the engine crashes as well
the only way I've been able to successfully move a load of assets into another folder is to export / import using a tertiary project
"BP_Light Studio"
any idea what may be causing this one blueprint to crash the engine? I've never touched it before
Unreal engine create redirector files where your old assets were
you can clean them up when you right-click on the folder
still crashes after that
no Idea what BP_LightStudio is - is it from a marketplace asset?
it could be referencing code that is crashing
nope, this comes with the 3rd person blueprint starter
thumbnail is black and interacting with it in anyway crashes the engine
do you get a crash log when it crashes?
Assertion failed: !IsInsideRenderPass() [File:D:\build\++UE5\Sync\Engine\Source\Runtime\RHI\Public\RHICommandList.h] [Line: 3377]```
for context i have no map open at the moment
both nodes just work fine for me
so it shouldnt be rendering anything at all
found this
that's my setup
So at least one other person is having the issue
If you're just prototyping something, I would just avoid using that blueprint - maybe delete it from the template
yeah, they mention it not being in 4.26 so perhaps its a 5 issue?
(sorry to interject, wish there was more than one channel...)
I'm trying to create a slider to control my directional light. I can create the slider, and I can control the directional light with a public variable, but I can't seem to figure out how to set the slider value to the variable (or directly to the transform) no matter what I do. I have a widget blueprint and a light blueprint. This is the error I get, so I guess I'm not setting "target" correctly? Blueprint Runtime Error: "Accessed None trying to read property Target". Blueprint: NewWidgetBlueprint Function: Execute Ubergraph New Widget Blueprint Graph: EventGraph Node: Set lightRotationZ
Maybe, it looks like the bug report is specificaly for 5
your widget needs a reference to the target
seems like you never set it
yeah that's just the type
but it doesn't know which directional light you mean
you could have mulitple
(but for directional lights you usually only have one)
this should work for your case
or wait actually
did you create a custom directional light?
I created a directional light from the "place actors" tab, then I converted it to a blueprint.
User Interface -> Widget blueprint ๐
no I mean in your code
you need to add it to the viewport and stuff
is it just in your player controller?
in my level blueprint
ah ok
yeah drag return value and place a 'SetTarget' node
drag from what?
that here
lol, on which node?
ok
connect it before add to viewport
then select your directional light in your level
okay then drag that in and set it to target?
exactly
it should work like that
Are there pointers in blueprint? can i input a boolean pointer into a blueprint function/macro?
You can pass by ref.
nope, doesn't seem like it.
You need to do that with reference variables, because you are basically telling your variable when you create it "You will receive (in your case) a directional light" and when you set it you're actually sending to variable to it
Would that be the same as a pointer?
top is level blueprint, middle is my directional light bp, bottom is widget bp
In a basic sense, yes. For example:
it's like a package, you are waiting to receive one, but when no one delivers it to you you'll just wait endlessly
Really appreciate the information!
do you still get the error?
there's no error, it just doesn't work
alright, that's already better
lmao
my game just crashed but i'm pretty sure lightrotationZ is just print out 0s
one sec
alright
ah right
did you change the max value of your slider inside your widget?
it goes from 0 to 360 ...
ok
you're welcome
why am i getting an infinite loop error ?
Mouse up would turn the Boolean false
Is it possible to set it to ignore infinite loops?
while loop runs continuously in the same frame, until the condition changed
however it will block the main thread while it's running
meaning the function never returns
meaning it will just run endlessly until the editor throws you out
Meaning the loop has to complete before it gets to the next frame?
can anyone help me, im having an issue where whenever i take damage it breaks my health regen
Is that the same with the function as a whole? it has to end before next frame?
yes
everything has
expect the functions with a small clock at the top right
like delay
Can i use it in this case? to have the loop keep going?
no, that won't work
you need to call your function on every tick
it doesn't make sense to talk about pointers in BP. everything is a copy, technically
pass by ref is the closest you get to being able to use pointer like structures
can anyone just tell me what might be wrong this
Just wanted to have a copy that's updated i guess
GetComponet(s) worked - thanks for letting me rant
thank you for the explanation!
okay, is there any reason for this?
it was for that loop inside a function i tried making but i guess it isn't the way you do stuff in blueprint since it didn't worked
why would a parameter not suffice in this case?
you're setting your 'mana p' when you probably want to set your 'health p'
i feel dumb, thank you
you're welcome
it looks fine to me actually
whenever i shoot the mana regen works fine, but when i lose health both mana and health regen break
you did change that node, right?
i did
i wanted to have a drag function, that would be initiated when the mouse click on a certain actor. But i wanted to have all the logic inside of a function for the purpose of having "clear code".
I thought that if i could have a pointer of "mouse down" which is updated when mouse is up or down, i could control the loop which inside the function, i understand that it is a wrong thinking about how stuff work, but wonder how to do it alternatively, without having to much stuff in the same page
Maybe creating another event graph?
i got it working
for some reason the mana regen got set to zero and was bein funky monkey
do you mean actor with object?
gotta say i love blueprint coding
Sorry, i meant when i press on an actor
it really helps at seeing how stuff works (when you sort your nodes at least)
you could do something like that inside your actor
Thank you very much for the solution!
In that case, would that make sense to have many event graphs?
I actually use never more than one
it's just personal preference I guess
doesn't really change anything regarding functionality
Don't you get to the point where the event graph become too filled?
Not really actually
But filled is different for every person I guess
I have a quick question, is there an easy way to keep a camera in the same spot when changing characters? I've tried storing and passing spring arm location and rotation but it just messes up all the camera movement.
I have 2 eventgraphs on the same actor,
1 event graph have a set timer by event,
what would be the best way to bind an event to that timer at the second event graph ?(cannot simply copy past the custom event and duplicate it it seems)
I already closed my project but there is a 'create event' node
I have done it but not sure how it helps to the problem, maybe i should explain better
Since i created a second event graph, it is slate clean, so i have no access to all of the previous event graph events
Any way i can also have these event in the second event graph?
If you want to override it, that is not possible
it's like having 2 functions with the same name
if you want to call the event you can still do that via the normal way
if you want that red square (delegate pin), use the 'Create Event' node
If i have a timer event, i only have that event on one event graph, can't i use both event graphs with one timer?
I have two event graphs
MyEvent is my main one
now I want to create a timer by event in my 2nd event graph
and that is how you would do it
ok but now lets say you want to have "MyEvent" on the second event graph too
you mean you want to define it?
Better ask, can you connect two events to one timer?
like have 2 'MyEvent' with different behaviour?
ahh
you don't
create 2 timers
or create a event that calls both events
I'll try it
Thanks for everything, have a good night!
How can i get insert a file in a foler and it reads an array and is usuable in combo box
Is there an equivalent to that in blueprint?
I want to run a function each time a certain variable is set