#blueprint

1 messages · Page 11 of 1

red berry
#

I'm copying tarkov's inventory system. So a backpack can have multiple groups of grids in them. So a backpack with a 1x2, 2x2, 1x2 would have 3 of these StorageTileParts. If I try to add a 2x2 object, it will try to add it in the 1st which will fail, but then should succeed in the second group.

StorageTilePart is basically row, column and an array of ItemDataObjects. That array is the one that gets started as a 2x2 (4 item array), but then gets to a 1 item array for some reason (what im trying to fix).
Edit: I only have 1 compartment in my backpack for now, its just a 2x2. Items larger than that don't fit in which is expected.

dark drum
#

If you pull from the root component and search for collision, it should show you the right node.

dark drum
red berry
#

yes

upper badger
red berry
#

I haven't checked if the array gets reset upon me picking up. So I will try that now. If I pickup the bag, is the array reset already? Or is it still 2x2? I have to know

echo storm
#

Can I disable input for a single instance of a Blueprint Class instead of the entire Blueprint Class?

dark drum
# red berry I haven't checked if the array gets reset upon me picking up. So I will try that...

That would depend on how you pickup the bag.

In all honesty though, there's a few issues with how your going about things. The for each loop on the first screenshot is pointless with how you have the function setup for resizing the inventory. In addition to this, you change the inventory size on begin play but you should be setting the inventory sizes in component defaults when you add it to an item. (your backpack in this case)

I'm still not convinced the resizing is working, adding to this, why do you even need to resize 'ItemDataObjects' array?

frosty heron
#

Keep your input in your player controller/character

dark drum
dark drum
upper badger
red berry
#

I managed to find where my code is bugging but its still not fixed. Does breaking a struct passed in as an argument to a function create a local copy?

tawdry surge
#

Unless it's pass by reference yes
However structs (like most things in BP) are copies anyway.

red berry
#

So if you have a struct with an array, then its impossible to alter that array? Every time you try to reference that struct or break it, its a copy?
Is there any way to break a struct without making a copy?
Seems like I have to redo some of my code to use Objects instead of Structs, because blueprint structs don't work well with arrays.

frosty heron
#

Try splitting instead breaking? Iirc breaking gets a copy

red berry
#

Won't let me split a struct

versed sun
#

Nothing can be plugged into the pin you want to split

frosty heron
#

I'm not in editor, is there no get by ref?

red berry
#

Get only seems to work on an array of structs, which you can then split. But if you have a single struct on its own, it wont work.
Edit: Im wrong. I created a local variable of type struct and you can split it.
Edit2: I'm giving up on structs. They dont play nicely with arrays at all, even if I removed all the breaks and use splitting. Passing a struct into a function just makes a copy whether you pass a ref or not.

untold oak
#

Hello, I have a map with 3 different lighting levels and i'm trying to make the map load with a specific lighting level enabled when I select that specific lighting in the menu and load the map, but so far I can't seem to get the lighting to stream in properly.

#

^the beginning

#

It should work from what I can see but it doesnt load the lighting.

#

The lighting levels have been properly added to the map in the levels window, and the streaming mode is set to blueprint.

frosty heron
#

Get by ref (Diamond shaped one)

#

passing an array to function always pass it as reference by default

marble tusk
#

Also a common issue people have with arrays of structures is in not knowing the engine's "For Each Loop" macro gets a copy, and you can just double click it to open it and verify. Then you can copy it to your own macro library and swap out the get (copy) with a get (ref) and use that instead

lunar sleet
#

Get makes a copy, the normal one

red berry
# frosty heron Get by ref (Diamond shaped one)

You're a godsend! Thank you so much! I was about to refactor my code using objects instead of structs because I couldn't figure it out. But checking pass by reference in my functions fixed it for me!
Edit: @marble tusk I can attest that breaking doesn't get a copy too. I tried it on my code and the struct's array can still be edited perfectly when passed by ref.
@frosty heron I'm not sure that arrays are passed by ref as default, didn't work for me I think. I had to manually check it.
Edit 2: Actually arrays are passed by ref as default. You can't uncheck it.

echo storm
#

What is the best way to change the item a character is holding? Add it as a component to the blueprint and then use the "activate/deactivate component" nodes?

frosty heron
#

Yup , it greyed out the option

west gate
#

I have a requirement where in, when the game is started, there should be a certain movement (as if player is walking some distance) and then the game will start.

I understand I will have to write a blue print event on game start and adjust the position of the player capsule component.

Please suggest me how to get this done.

But I am not able to implement this as “move component to” functionality is available only for static mesh.

#

In short I want to mimic the joystick navigation for some 10 seconds initially

lunar sleet
torpid juniper
#

Hey, i'm trying to still get my head around how data assets work and how and when i will be able to use them and when i need to use actors with components or such. If i have a data asset class (primary data asset) which has a function for storage containers like chests and stuff that has an on interact which will open the interface for that chest. What is the best way to do that? Am i able to do it all through the data assets? Or will i need to use the inventory component and just have the data asset function deal for opening the widget and pointing it at the chest i am clicking on and then stuff will be redirected to the component?

winged zephyr
#

How do I allow a widget to have childeren

dark drum
worldly breach
#

Hey, I come to you with questions about game architecture (ie how unreal wants us to do things) as a complete unreal noob. We generally want to program in C++ but I suppose this question would be the same regardless of using bp or c++, and I'd like to prototype this in blueprint first. Consider this situation: we are making a game where the player needs to place cards on a square-grid board. These cards are like in tetris: they are the size of multiple tiles on the board, just like tetris blocks contains multiple squares. Once the card is placed, we no longer really care about what tiles belong to what cards; only the tiles really need to keep existing and we can effectively remove the concept of cards altogether. While placing, it would be nice to have them grouped such that the player can perform actions: movement, rotation, etc.

It seems to me the most logical thing would be to make each Tile a separate Actor. However, if we want them grouped, it would make more sense to make Card an Actor and each Tile in the Card a SceneComponent. I think, not sure. We will be generating the card shapes from scratch during runtime. What is the best way to group these actors together, in your opinion?

winged zephyr
fiery ridge
#

Where do you guys think it's best store stats such as character upgrades for singleplayer? So that they can be saved and accessed across different sessions/levels

thin panther
fiery ridge
#

Thank you

dark drum
dark drum
worldly breach
fiery ridge
dark drum
fiery ridge
#

Then gamestate can get loaded before anything happens yeah?

proud wasp
#

this is the first time seeing this type of issue , what is wrong with it?

dark drum
fiery ridge
#

Thx

median whale
#

Hello, I'm currently a game tester interested in transitioning to game development. I'm a bit confused about whether to choose Blueprint or C++. I'm seeking advice on this matter from a seniors.

thin panther
limber citrus
#

editor

thin panther
#

don't really need aa senior to tell ya that tho

dark drum
frosty heron
dark drum
limber citrus
#

I just want something global, so I can save some variables in, and read them inside other editor bps

proud wasp
#

anyone got an idea?

limber citrus
#

I gues game state and game instance will have the same problem

echo storm
#

Is there any way to set static mesh to "none"?

dark drum
dark drum
dark drum
limber citrus
# dark drum What for?

they contain level names, for each array there should be specific logic related to the editor tool logic

echo storm
#

It just keeps the mesh that was selected before

#

And there is no option for "none"

frosty heron
frosty heron
lunar sleet
dark drum
distant hollow
#

Hi all,
I used a "Async Load Asset" node to load a Static Mesh soft reference (using blueprints)
Past the "Complete" pin, I did a "IsValid" check on the output "Object", it returned True and even returned the name of the Static Mesh that was supposed to be loaded.
However, when I tried to set it to a Static Mesh component, it keep giving me a waiting message "Waiting for static mesh to be ready 0/1.".
Can someone tell me what is happening, and if there is any way I can check and confirm that the Static Mesh has indeed been fully loaded into memory before I use it, without having the disruptive "Waiting for static mesh" message appearing?

distant hollow
frosty heron
#

the picture that you showed doesn't reflect on what you write

distant hollow
distant hollow
frosty heron
#

Not really

#

i still don't see you setting the static mesh after it finished loading

#

you most likely got the error because it's not resolved yet

distant hollow
#

Essentially it is checking whether it has been previously loaded, before Async is called
If it has been previously loaded, it goes directly into casting, otherwise I add it to a reference list for counter-checking

#

In any case we can confirm that it reaches the Set Static Mesh node, because that's where the "Waiting for static mesh to be ready" box appears.

frosty heron
#

not entirely sure the order of what you are trying to do but here is a simple way to async load soft ref

#

I see that you have array as well

distant hollow
#

Yes, that is exactly what I did.

frosty heron
#

you have to becareful when doing Async stuff using a function

#

lets say you call the load function twice

#

if the first mesh is not loaded yet and second mesh get loaded then first mesh get loaded after

#

you won't get the latest mesh

distant hollow
#

There is no "latest mesh", I am trying out only with one mesh even.

frosty heron
#

i mean disregard what you have right now and just do the simple version

distant hollow
#

That was where I started out with and it gave me that error, which was why I went further to do the checks and all.

frosty heron
#

just have a test bp

#

and write that one function

echo storm
frosty heron
#

If u don't get error then it's the extra logic you applied when doing the load imo

distant hollow
frosty heron
#

Huh, why is it editor promt?

#

is that even related to the async load

distant hollow
#

Because I am running it in the editor ?

#

As in PIE

frosty heron
#

In Pie is fine

#

This is not PIE tho?

#

Not sure about that promt, I never had it but totally looked like the one that pop out when saving stuff in editor

distant hollow
frosty heron
#

which doesn't have anything to do with packaged version

distant hollow
#

Nothing to do with Packaged

#

On package it would simply get stuck

frosty heron
#

well that was never mentioned :

distant hollow
#

Which I don't want it to get stuck

frosty heron
#

it's most likely what break stuff

distant hollow
#

Which also should not get stuck since it is supposed to set to static mesh after Complete

frosty heron
#

you should just try to load it to Test

#

just with 3 nodes

#

nothing else

#

then you can probably deduct if it;'s your function that mess things up

distant hollow
#

No, as you can see, the function was skipped, it was done with that three nodes above

frosty heron
#

I'm still seeing many nodes which i don't know does what. My only suggestion is to do it in seperate BP and detach your self from what you have right now

#

because it work on my end with no problem whatsoever

distant hollow
#

Ok, thanks for trying anyway

#

I appreciate the gesture

frosty heron
#

gl, I am also doing the same thing right now

#

loading soft refs for my character customisation

distant hollow
#

If you can instead point me to a way to confirm that an output Object from the AsyncLoadAsset node has been fully loaded into memory, that would be very helpful

frosty heron
#

obj list class=staticmesh

#

For example

distant hollow
#

I'm using Blueprints

frosty heron
#

it's console command

#

you will see the result in your output log

distant hollow
#

I will need something that can return a value which I can use in the blueprints, not just reading in the logs

#

As in

#

I will not try to set the Static Mesh until I confirm that the Object has fully loaded into memory

frosty heron
#

it should be resolved (or loaded to memory) right after the completed pin

#

safe to load it

distant hollow
#

Well apparently it isn't

#

It should, but it isn't

#

Which is why I am trying to find a way around it now

frosty heron
#

you can check from the output log for debugging purposes

#

as mentioned

#

@distant hollow Try to write the command

#

you will see if your static mesh is actually loaded

#

try to restart your project first tho, incase if it's already got loaded. Because anything that the Editor loads will stay loaded till you restart the editor

junior prairie
#

So I've got this so far, does this look reasonable and how do I get a force in the direction the character is facing?

frosty heron
#

then normalised it I guess? not sure, I drop out from hs

junior prairie
frosty heron
#

@junior prairie Try this

fringe junco
#

does anyone know how this node is used?

#

Im passing my grid data into but the pathfinding seems to use the navmesh and not this navigation grid thing

junior prairie
frosty heron
#

no idea them, hopefully others can help. does hard coding even do anything?

#

if it doesn't then I would look at the add force node

junior prairie
#

so now trying to figure out how to fix that

twin path
#

Does anyone have a tutorial on triggering events with a stream deck? Activating lights, niagara effects, animations?

ruby cobalt
#

something's fishy.. new project.. almost completely empty. I'm trying to add a widget to test things.. it won't show up.. so I dumb it down to "event begin play: print hello" and it won't even show?!?!

supple dome
#

did you place the actor on the map 😄

ruby cobalt
#

even begin play in level bp won't print

#

i must have done something weird somewhere idk

lunar sleet
frosty heron
#

If restarting don't work, check if you have print to screen ticked

ruby cobalt
#

ah it seems to be related to my game mode

#

and possible related to dlss

lunar sleet
#

That doesn’t make much sense but 🤷‍♂️

ruby cobalt
#

as soon as I removed my game mode.. hello showed up

frosty heron
#

could be just bugged, it wasn't showing up for me too yesterday

#

but it shows up in outputlog

#

can't remember what I did but i think restarting fixed it

ruby cobalt
#

LogGameState: Error: Mixing AGameState with AGameModeBase is not compatible. Change AGameModeBase subclass (BP_GameMode_C) to derive from AGameMode

junior prairie
ruby cobalt
#

ah i must have changed that inadvertively

lunar sleet
ruby cobalt
#

i don't use game state and player state much..

#

yeah changing it back to gamestatebase fixed it

desert briar
#

I want to reuse something, let's say a model + a light, as a component in multiple other blueprints. What are the options? ActorComponents don't render. ChildActors for some reason can't be edited in the editor. Do I really need to write code for this???

#

Goal is that I can edit the light in one single place and have it automatically updated in all the blueprints that use it

lunar sleet
desert briar
#

I want to use it as component in blueprints. In some blueprints I'd like to adjust parameters of it

lunar sleet
desert briar
#

Because I generate a level with blueprint building blocks

#

I could add scene components to the blueprints, add tags, have code get them, bla etc

lunar sleet
#

What’s that got to do with not being able to use actors

desert briar
#

I'm looking for a way to not write code for this

#

One should mean the engine supports that use case

#

I could write code

#

but do I really need to

lunar sleet
#

Maybe I’m confused by what you’re aiming for. You just want to reuse an asset for a static mesh?

desert briar
#

i think questioning the use case doesnt make sense

#

could be anything

#

lets say you have a level part that has ... turrets

#

level partS that have turrets

#

you'd like to reuse the same turret everywhere, but would like to adjust the range or something for each level part

lunar sleet
#

Change variables

desert briar
#

so i'd expect to go in each level part blueprint, add a child turret component there, edit its properties

#

yes, but that's ass

lunar sleet
#

Use OOP

desert briar
#

that's also ass

#

is there an actual good way?

#

Not using it but I think even a garbage engine like Unity had nested prefabs

faint pasture
#

Hey we talking nested prefabs again?

desert briar
#

seems like it! let me search the channel

thin panther
#

Prefabricator is what you're looking for in this regard

#

Unreal's support for this kind of stuff is shockingly lacking

remote meteor
#

huh

#

level instance/packed level instance is pretty much prefabs though

true zealot
# twin path Does anyone have a tutorial on triggering events with a stream deck? Activating ...

I think this depends on how you want to do that....
I have a loupedeck so I'm not sure if stream decks specifically have an API or anything....
but I've done in this past by triggered json events that hit an HTTP listen server from built in loupedeck commands and then have also just done this with hotkeys.
You also might be able to use OSC to do it. I think your best bet is to figure out what/how you want to do this, and then zone in on a tutorial that targets that method from there

dark drum
# desert briar is there an actual good way?

Using your turret example, what I would do is setup the turret but use a data asset (or something similiar) that it gets its default variables from. That way you can create presets for the turrets. You can then place them where you want and just select the relevant data assets.

dark drum
twin path
faint pasture
#

I'm doing modular vehicles and I do one part as one actor, and I just attached them at run time.

#

My game has a vehicle editor so if I want to pre-make vehicles, I just use that.

true zealot
# twin path I would like to trigger a niagara fx 🙂

so my guess is you'd want to make a command that sends a web request, or presses a hotkey, and then in unreal you'd want to listen for that request or hotkey combination and then activate the effects from a BP how you normally would once that event is received 😮
Sorry I don't know any more of the specifics

orchid spoke
#

im a bit confused about the animation blueprint here.. I added a notification in the animation to indicate when the character can start its attack. However, in the blueprint this notification is nowhere to be found. I've tried all 4 abps that come with my template, and searching for others in my content folder there doesn't seem to be one. (i also have a sword animations pack downloaded). I suppose it's recommended i make my own blueprint? It's just weird the blueprint doesn't exist with already fully functioning animations. Or is there some other issue here? Thanks
Maybe the issue is my sword animations use a different skeleton than the one used in the animation blueprint? But i can't seem to edit what skeleton is used in the preview.

radiant imp
desert briar
# dark drum Using your turret example, what I would do is setup the turret but use a data as...

No, clunky for my use case. I spawn the turrets alongside my level parts, so it's convenient if they're part of the level blueprint. I can use child actor components for that. I'm tweaking the turrets a lot, pretty much for each level part. But for tweaking variables per turret I now have to use blueprint in each level part (because child actor components don't expose properties), and also can't debug the child actor turrets in the editor

I could also set some variables in the level part blueprint, spawn turrets as actual actors on runtime, bla. Everything is possible, it's just inconvenient. I'm I was looking for a workflow-friendly solution

radiant imp
# radiant imp

What could be the reason for world location to be 0,0,0 even thou i have a valid player controller?

#

Or what causes the return value to be 0?

dark drum
dark drum
desert briar
#

Sorry, I managed to make progress here with the answer of @thin panther (thanks a lot), there's no value in discussing my use case further, need to work on my game

grizzled sparrow
#

there's a way to make the arm of the default dummy follow the mouse while pointing at it?

dark drum
radiant imp
remote meteor
#

tfw we have Actor Pallete and Level Instancing and we are still lacking

dark drum
radiant imp
dark drum
# radiant imp Yes exactly

Well from my understanding (I could be wrong) there's only ever one cursor which I would imagine the first player would get so anything other than index 0 would probably return 0,0,0.

orchid spoke
ruby cobalt
#

as "cast to skeletalmeshactor" expensive? like should I avoid running it at event tick?

#

i could easily cast as skeletal mesh before event tick and use a branch somewhere to run the static mesh version or the skeletal mesh version of my thing

dark drum
orchid spoke
#

ah so it is as i thought.. Is there some way to easily find what bp is used for this skeleton?

remote meteor
dark drum
ruby cobalt
radiant imp
orchid spoke
dark drum
dark drum
orchid spoke
dark drum
ruby cobalt
# dark drum Personally, I would avoid casting on tick as its an extra check. I would need to...

makes sense.. I have the same "situation" for 2 functions so I feel like this might be quite generalized..

I want to be able to set either a static mesh or a skeletal mesh as a target or parent.. but I only care about the bone if it's a skeletal mesh.
Suppose I need the location of my target.. if it's skeletal, I want to use a specific bone.. if it's static.. I can't use a bone.
That's the system I'm trying to build.. make it compatible with eithe rstatic or skeletal

dark drum
ruby cobalt
#

okay in one of those function.. I want to focus my camera on either target 1 or target 2.. either target can be either static or a skeletal (for which I specify a bone)

I then have a crossfader to let me change my focus from target 1 to target 2. so On tick, I get the location of both targets.. and pick the value that would be either on one of them or somewher ein between

#

let me clean up the BP and screenshot

dark drum
ruby cobalt
#

oh that's a good idea

#

thanks

#

i have another kind of dumber question. here,s the system that only cares about a static mesh (no bone nothing)

Is it worth it here to use the branches? or should I just use the lerp way at the end?

#

(this thing runs at event tick)

radiant imp
#

It's working perfectly now 👍

dark drum
ruby cobalt
#

great

#

and now to make it care about possible bones.. I'd add this in there instead of the basic "get actor location"

dark drum
radiant imp
ruby cobalt
ruby cobalt
radiant imp
#

cool

dark drum
ruby cobalt
#

maybe i care too much about optimisation

remote meteor
ruby cobalt
#

yeah I see.. but considering the new code replacing "get actor location" would be heavier.. it makes sense to not get the location of actor 2 unless i need it no?

remote meteor
#

at the cost of checking 1~2 floats equal to something and a branch though

dark drum
remote meteor
#

anyway, indeed its overthinking about optimization at this point

ruby cobalt
#

yeah probably

remote meteor
#

if we are that focused on every tiny bit, might as well do it in cpp

ruby cobalt
#

but I think it's worth it to learn things the proper way on the long run

#

I've been able to do weird stuff with tech without being a programmer because I care about optimization.

lunar sleet
#

It’s a fine line

remote meteor
#

if i remember correctly

lunar sleet
#

Premature optimization is just as bad tbh

remote meteor
#

comparisons are kinda slow compared to straight forward operations

#

cus of cpu branch prediction yada yada, idk how true is that these days

#

if branch predictino misses then pre-fetched cache is wasted kinda stuff

ruby cobalt
#

during play, I won't change those actors.. so in theory, if I check at begin play and use a simpler branch at event tick.. things would be lighter?

#

I know in practice it migh tnot make a difference

remote meteor
#

i would suggest not to take away flexibility too much though

#

if the code only runs this part, it works perfectly fine

#

the only question i would ask is whether if it needed to be on tick

ruby cobalt
#

good advice

#

well.. actors can and will move

#

and I need the focus point to stick to them

remote meteor
#

if actor A and B are constantly moving target

#

then now the question is what is the use of focus point?

#

camera focus point?

ruby cobalt
#

yes i want my camera focus to follow a bone.. but then be able to crossfade that point of focus over to a 2nd bone or actor

#

i use very short depth of field too.. so it makes a big difference

remote meteor
#

is the camera component on the focus point or a separate actor?

ruby cobalt
#

they are seperate.. this code runs within my custom cine camera bp.. the focus actor that I move around is a basic sphere thing that I usually hide

remote meteor
#

because when it comes to game engine level, the stuff about branch prediction yada yada i mentioned is probably ignorable

#

needing to update the transform and the scene of focus point actor is probably 10x heavier than some variable checks

#

because if its just the location that you need to know, it doesnt need to be a whole actor

#

the camera can figure out where it should point at by knowing the location of the 2 actors and the crossfade variable

#

the camera on tick, would still do the lerp between their location, and project from location to where it should be, to be able to look at the point

ruby cobalt
#

here the first screenshot checks at begin play

#

and this would run at event tick

ruby cobalt
remote meteor
#

if both actor are supposed to have a "watch point" for the camera

#

i would make an interface for the actors to return a location, GetCameraWatchLocation() or something

ruby cobalt
#

ah wait.. that's why I've been doing it this way..

So I'd need to change it to manual I believe?

remote meteor
#

the actor itself will know whether it is a static mesh or a skeletal mesh

#

the camera doesnt need to check every tick whether if you are static or skeletal

ruby cobalt
#

so you'd set that "watch point" in the actor itself?

remote meteor
#

the actor will return the correct watch point that it should have

remote meteor
ruby cobalt
#

a believe manual works with a distance from the camera..

remote meteor
#

that works

ruby cobalt
#

true

remote meteor
#

you can figure out the distance between the camera and the watch point

cosmic storm
#

Someone could help me understand this program in detail, especially the get player controller and the Subsystem :

ruby cobalt
#

and even offset it.. and then move a visual debug focus dot there if I need later

remote meteor
#

yeah but then 😅 all these work probably doesnt really improve performance that much though

#

one less scene update

#

thats about it

ruby cobalt
#

yeah I see

#

but on the long run.. if I learn good tricks now.. this will carry over to thousands of little things

remote meteor
#

yeah good to have arsernals of tools

#

i would probably take it as exploring the possibility

ruby cobalt
#

yeah

#

it's a matter of having the time to invest

remote meteor
#

though in production, it doesnt make anysense to do such premature optimization

#

having unlimited time is always the best

#

🥲

faint pasture
ruby cobalt
#

yeah I'm actually somewhat short on time

thin panther
#

It doesn't make much sense in bp. Your biggest performance game would be writing this in C++.
Make the thing and then profile it to see if it needs to be optimized

faint pasture
#

Yeah you'll see about a 100x speedup going from BP to C++. If it's that important, do it

#

Trying to go branchless and playing nice with the predictor in BP is a fool's errand. Although it still makes sense to keep certain performance considerations in mind like not putting unnecessary stuff on tick etc.

thin panther
#

Yeah, a good sensible practice from the getgo is very importantly not a premature optimization, but things like this is, when you have much lower hanging fruit

terse trout
#

hey folks, i'm creating a dynamic material instance here and using it to set parameters right away. but the MI Level Badge is not valid after being created. any idea why this would happen?

lunar sleet
#

Does it just always go to invalid? Where is it being run? Is it possible you’re unsetting it somewhere else

terse trout
# lunar sleet Did you use breakpoints to see the code flow?

i've been following my logs every step of the way (i have to test this in build, the functionality doesn't work in editor). i create the dynamic material instance on widget preconstruct and i check it later here in the function i posted above. it always goes to invalid, attempts to create a dynamic mat again, and when i use it to set a parameter -- it's still invalid

lunar sleet
#

Idk about creating it preconstruct, you can’t save an instance before runtime

terse trout
lunar sleet
terse trout
wet sonnet
#

heyo, new to Unreal here. I'm trying to make a widget that has 4 custom slider inputs on it. When one changes value, the other 3 adjust their values so that they always total 1, or 100%.

to do this, I'm listening to their onvaluechanged events from the parent blueprint, and invoking a NormalizeSliders function, passing in the index of the slider to adjust the others relative to.

However i'm having trouble understanding the limitations of Events and Event dispatchers.. I would like to say "When slider 0 emits its onvaluechanged, call NormalizeSliders(0). When slider 1 emits its onvaluechanged, call NormalizeSliders(1). When slider 2 emits its onvaluechanged, call NormalizeSliders(2), etc." But i can't seem to find a way to execute arbitrary code (i.e. invoke NormalizeSliders with some value) in response to an event emitted by the slider objects. All i can do is bind events to events, and their signatures *must* match, so there's no opportunity to insert that contextual slider index.

here's the rough shape of what I want. (but without needing a separate customevent for every child slider)

pulsar pulsar
#

whats the best way to save inventory related stuff? I'm trying to stay away from tutorials as it's just do this do that and I feel i'd learn more by´trying to figure it out

frosty heron
#

You should look at how others implement such system if you have no experience at all

pulsar pulsar
#

so

finite maple
#

the tile/platform itself has no blueprint of its own, i just refrenced it in the button blueprint with an object reference variable

frosty heron
#

I can't recommend any tutorials from YouTube for actual system

frosty heron
#

If you target a component with no parent then it has no relative transform imo

dark drum
dark drum
frosty heron
pulsar pulsar
frosty heron
#

Want to see the hierachy

frosty heron
frosty heron
#

But you said earlier the platform has no bp?

#

@finite maple

wet sonnet
# dark drum You can bind an event to a function. If you use the 'create event' node, you can...

that's the thing. the dispatcher (which is the event the child sliders emit) doesn't know its index within the list of sliders, so it cannot include the index in its signature. therefore a matching signature would be lacking a variable i need (the index). ALSO, making a separate function or event for each slider seems... unideal? like shouldn't i just be able to get a control pin out of the "OnValueChanged" itself and use that to do whatever I want? let me know if i am not making sense haha

frosty heron
#

You can have payloads when calling dispatcher

finite maple
#

srry

frosty heron
#

@finite maple so which one is the platform? The box or the static mesh

finite maple
#

the static mesh

#

the box is a collision box

dark drum
frosty heron
#

One way to do it is to cast the object ref to your bpfloor tile, get the static mesh from there and set the static mesh relative location

#

@finite maple

#

If you don't want to cast then there is get component by class route

#

Tldr you want to update the relative location of the static mesh

finite maple
wet sonnet
frosty heron
#

You need to cast to bp floor tile

wet sonnet
#

it's just such a mess. like there's no way this is the right way to do this. no way this is canonical blueprints

frosty heron
#

Then from the blue pin you can drag and get static mesh

finite maple
#

ohh i see

frosty heron
#

If you need the custom progress bar to have index, you should just have a variable called index inside the custom progress bar and make it instance editable

#

Then in your main widget, select each progress bar and assign the index accordingly

#

You can also make dispatcher that return it's reference, index and value. And call it on slider on value changed

dark drum
wet sonnet
dark drum
frosty heron
#

@finite maple your platformtoactivate variable

frosty heron
wet sonnet
#

also yeah, the sliders actually already are custom wrapper widgets that contain functionality - i just wasn't satisfied with the "give them their index onconstruct and emit the index with the value changed dispatcher" solution, because it's a similar amount of mess but more compartmentalized, as well as because it's coupling the custom slider widget with this one specific use case which shouldn't be necessary, as well as because it's distributing concerns across multiple classes instead of the one class that actually cares about this behaviour.

if I could just say "when slider 0 emits this event, do this", this whole thing would be significantly easier to code and to understand. So i was hoping there was a better way. And i still yearn to this day

frosty heron
#

From the blue pin drag and type get static mesh. Then from that static mesh you got, drag the blueprint and type set relative location

pulsar pulsar
finite maple
#

thank you

frosty heron
#

No worries but your code will only work with bp floor tile since you cast

#

If you want to make it more ambiguous, you can use get component by class

finite maple
#

because it's not my intention

#

but i'll keep it in mind anyways

frosty heron
#

You should contain the logic for the activation in the bp floor tile if that's the case

#

Then from your gameplay manager bp you can just activate any platform you like

frigid swallow
#

how do I change a character's animation based on what they're holding? For example, when holding a sword, it plays a different running animation.

frosty heron
#

You can create enum that hold the state of your character.

Eg short sword, long sword, spear, etc

#

In your anim instance, you can have various blend spaces that will get played according to the enum

#

Jump to blend posses by enum

lunar sleet
#

I’d no idea that existed

#

I haven’t really touched animation tho 😅

frosty heron
#

Just another thing I picked up from dynamic combat system 🐋

lunar sleet
tight pollen
#

what do you think about storing widget references in Data Asset? I know that's not how it's done, but if at the beginning of the game I cleared the arrays of references and loaded them from SaveGameObject and put them back into the DataAsset?

#

then I can easily access a given widget from any widget, I don't have to do Cast To or create a variable with a reference

stone field
tight pollen
#

I would use Map variable

#

each widget would have its own unique ID

#

DataAsset is only for Client side?

lunar sleet
#

Widgets are client side tho afaik

ruby cobalt
#

Here is a workflow question.

I need to cover a few cases using parent and child classes)

BP_driver (lets me move the actor manually in smart ways using pivot)
BP_physicsControl (let me use physics control so attach and move the actor)

Some actors would need both classes, and physics should be the child of driver.
Some actors only need physicsControl as their parent..

How do I organize this to be able to pick one or the other or both?

#

I think I could change it so PhysicsControl wouldn't need to be the child of driver.. but I don't think physicsCOntrol should be the parent of everything

lunar sleet
ruby cobalt
#

maybe I don't know what that means

#

they kind of are interdependent (physics control's child that I attach to various actors, is the pivot I'm using in BP_driver)

#

I have a video example where I built both physics and driver in the same parent class to attach a camera to a skeletal mesh.. maybe that would make more sense

#

I'm looking for ways to make this more modular because I feel like driver and physics both in the same class is a lot of stuff and not modular enough

#

https://www.youtube.com/shorts/h6aZphAkW3g

Here the camera is a child in orbit around a pivot (using bp_driver stuff)
The pivot is then attached to the hand using Physics.

The idea is to have a cam smoothly follow a moving target, not just pan around to point at it. Smoothness can be adjusted too.

I also retain control of the camera in orbit around the pivot. You can see when I enable the pivot mesh preview. It’s the pivot that is tied to the hand, not the camera itself, so the manual orbit adjustment is always s...

▶ Play video
lunar sleet
#

They’re pieces of logic you can attach to actors dynamically

ruby cobalt
#

i'm watching the wadstein video on the subject.. hopefully I can figure out how to adapt to it

#

ahh I see.. damn this is a lot of work to plan all of that out

surreal juniper
#

I have some collision boxes set up for ledge grabbing purposes. The ones circled in green work, collide with the line trace and all that. The rest just don't. The two that work were also the first two I set down and every subsequent one I set up doesn't work (copy+paste, drag from content drawer, doesn't matter) and they are all the exact same actor. Do I have too many? what do I do to fix this?

lunar sleet
snow skiff
#

Hey! Is there a way to SetRelativeLocation only for one axis?

lunar sleet
#

Break the input pin

surreal juniper
#

They all share the same collision settings because they're all the same actor?

lunar sleet
#

Feed the existing vectors into the other 2^

snow skiff
#

Okay so if i leave them unconneted they just refer to the number on the node?

lunar sleet
#

If you want current, get relative location, break output, plug the ones you don’t want to change

snow skiff
#

Okay i get it now it works thank you

surreal juniper
lunar sleet
#

Show

surreal juniper
lunar sleet
#

🤔 Maybe your trace is too short ?

#

You can also use show collision console command

surreal juniper
#

I don't think it's an issue with the trace. The boxes are all aligned exactly the same with the geometry, and it works fine for the two green circled boxes

#

this is the working one

lunar sleet
surreal juniper
#

starts slightly in front of the model and ends same distance from model but down on the z axis

lunar sleet
#

Why

surreal juniper
#

to catch a box in front

lunar sleet
#

I thought the boxes are above?

surreal juniper
#

as they're falling

#

so the boxes would not necessarily be above

#

I can change it if I need to but it's not really an issue

#

just a number change

lunar sleet
#

Maybe you should use an overlap instead

lunar sleet
surreal juniper
#

But it does work

#

Do you think the issue is with the line trace?

#

Why would it be working with some but not other collisions

#

I'm not saying you're wrong, I just want to understand

lunar sleet
faint pasture
#

Explain your algorithm for finding the edge of something

surreal juniper
surreal juniper
lunar sleet
#

So it’s not hitting

#

Which we’ve established

surreal juniper
#

Yes

lunar sleet
#

I’d try a collision box in front of your char and use onComponentBeginOverlap

surreal juniper
lunar sleet
#

But maybe a diff trace algorithm would work too

surreal juniper
lunar sleet
#

Maybe that too

#

If you do switch to overlap, rmbr to adjust settings from block to ovelrap

#

But if you want precision to make sure it’s facing the right way, then yeah better to keep trace

surreal juniper
#

I think the issue with box collision is it could hit multiple boxes

lunar sleet
#

Also pls show line trace code just for sanity check

surreal juniper
lunar sleet
surreal juniper
#

that's the print

#

But I'm sorry! The line trace wasn't colliding with any of the boxes at all

#

Apologies

oak fable
#

hey there i need some help with setting up my animations
im making a combo system and its working fine but i get a glitch in the anim montages
which is i have anim notify for resetting the state of my attacks and others for saving them so now if i play one anim montage but something interrupts it like doing left hand attack or maybe change the to other movement state it wont reset so how can i check if im in attack state but no animations playing for like 5s and then it should reset the state

surreal juniper
#

I'm sorry 😭 I will try to troubleshoot

#

Thank you for help although it was an impossible task

lunar sleet
lunar sleet
oak fable
oak fable
oak fable
lunar sleet
#

I saw anim notify that’s why I asked, those are a bit diff but it looks like it’s something else

oak fable
#

im kinda not good at explaning what i need XD

lunar sleet
#

If I understand this correctly, you want to not be able to do something while an animation is playing?

oak fable
#

or at least until one of the notify hits

lunar sleet
#

How about settting an isAnimating bool to True and back to False when the notify hits. And only allow the new one to go through if that bool is false

#

This way you don’t have to worry about precise time which involves dealing with frame dependency etc

oak fable
#

how excatly i can set that up

#

it should be false in the anim notify or the function inside it ?

#

and when to set it to true

lunar sleet
lunar sleet
#

Call what, the branch?

oak fable
#

the isAnimating bool

lunar sleet
#

You can’t call a bool, if you mean the branch that checks if it’s False, you put that right before attempting to do the other attack or w/e it is

#

And even before the same action so you can’t interrupt it by pressing the same button

oak fable
lunar sleet
oak fable
#

it will be true when i start the animation and when it end i should set it back to false

#

looks like i got the idea thanks ❤️

lunar sleet
lunar sleet
#

Wait, didn’t we go over this yesterday ?

wet sonnet
#

I have a group of sliders in a widget. When one slider's value is changed by the user, i am modifying the values of the other sliders. This causes an infinite loop of OnSliderValueChanged events. Is there a way to set a slider value without triggering that event, or to distinguish between the two sources of the event?

lunar sleet
#

Yeah we did, I rmbr you pointing at the wrong node when we told you it’s Set Health that’s the issue

#

Might have been two days ago but it looks like you just skipped our replies

wet sonnet
#
  1. user mouse-drags a slider, which is part of a custom widget wrapper.

  2. the onvaluechanged event of the slider triggers an event dispatcher from the child widget.

  3. that eventdispatcher is observed by the parent widget, and invokes a function that adjusts the other sliders in response to the user's input.

  4. at the end of a bunch of irrelevant math, the adjustment function calls [CustomSliderWidget].SetValue, which in turn calls Slider.SetValue inside the child widget.

(4) is triggering (1), causing an infinite loop.

#

lol i hit enter early

#

1 sec

#

okay there

#

i EITHER need a way to check if (1) was triggered by the user or by my code

#

OR a way to set a slider value without triggering its OnValueChanged

faint pasture
wet sonnet
#

could you be more specific? there's a few parts here i might call an "UpdateSliders event"

faint pasture
#

Act as if there's no such thing as OnValueChanged and make your own function

#

then you can only manually call it when you want to

#

Or try this

wet sonnet
#

if I want it to trigger when the user changes the slider, i have to use Slider.OnValueChanged, right?

faint pasture
#

set some bool in SliderValueChanged, some bool that would be gettable from everywhere that cares about it

wet sonnet
#

so it doesn't matter if i wrap it in another layer of abstraction

faint pasture
#

Branch on the bool, set it false, do your math, set it true

#

do that branch in all bindings. A trigger of the OnValueChanged should be blocked until the end of the initial update logic.

#

that should block your on value changed stuff from running until the end of the update/modification code

wet sonnet
#

okay, that works. Is there really no way to set a slider value without triggering the event?

#

feeling like unreal BP is 95% working around weird limitations like this but i can endure

#

thanks though!

oak fable
#

it only play the animation once

lunar sleet
oak fable
#

yeah it should be

#

i dont why but when i set it to false it works

upper jackal
#

Quick question, have any of yall had the issue with input actions dissapearring after you reopen the project in the editor? I've saved the blueprint and the project several times and it doesn't save it

surreal juniper
#

I had a player blueprint that was working fine until I changed absolutely nothing. Now, I'm pretty sure it's saying it doesn't exist. When I start the game, the model is missing, I can't move anything except the camera, and when I quit the game it shows me a billion error messages.

#

Really frustrating because I didn't change anything. I've restarted the editor a couple times

lofty rapids
oak fable
#

i set it to false using the notify

lofty rapids
#

AN_ResetState ?

oak fable
#

yeah

#

also tried to make one for it

#

but not working

lofty rapids
#

did you check to see if the event was even firing ?

#

that you had the right node

oak fable
#

yeah it fires but still dont know why its not working

lofty rapids
#

is the cast failing ?

oak fable
#

idk

lofty rapids
#

drag out from the cast failed and do a print string

oak fable
#

but seems like it

lofty rapids
#

see if that shows up

oak fable
#

okay one sec

lofty rapids
#

i would of started with a print string out of the event too

#

just to be sure

shy canyon
#

how can I rotate something but use a custom reference as my pivot?

fringe junco
#

does anyone know much about how these Add Local Navigation Grid for Points nodes work?

#

i can set them up but they dont seem to do much lol

oak fable
lofty rapids
oak fable
#

nah

lofty rapids
#

you put a print string comming right out of the event ?

oak fable
#

yeb

lofty rapids
#

what is reset state ?

oak fable
#

what i found is i need to have it more away from the save attack anim notify and i would need to click real fast to be able to do the next attack

oak fable
thin panther
surreal juniper
#

In the details panel? it is blank

thin panther
#

thought so

#

You've run into the super fun and not at all annoying engine bug of 5.3 known as "why did my character just delete itself"

surreal juniper
#

guh

#

yes the skeleton mesh is also gone

thin panther
#

so you have a couple of options here.
1 - roll back in source control (if you aren't using it, set it up now)
2 - check to see if you have any previous autosaves
3 - remake the character

surreal juniper
#

What is source control?

#

I did check for previous autosaves. No such luck

thin panther
#

basically version control on steroids

#

you keep submitting your changes, and at any point you can roll back to a previous change

#

you can also branch off into multiple avenues of the project and seamlessly switch between them,
source control has a lot more use for code, but for any project its a nice just-in-case

#

oh if you set up the engine integration you can also "diff" blueprints, which is seeing the difference between your file, and the same file at any other point in time

#

#ue5-general has a great guide on setting it up in the pins. Ignore the bit about GitHub though, that's not a good host, you want to use the bits that mention Azure DevOps

surreal juniper
#

Okay thank you

#

I'm going to have to remake the character

#

Is this a common bug?

thin panther
#

i wouldn't say it's common, but I ahve dealt with 3 other users with the exact same issue, who also did nothing to trigger it

#

not that anything you could trigger should do this

#

you can't just delete all the properties of a c++ component

#

so rare, but frustratingly so

surreal juniper
#

I hope the next update comes soon

#

This bug was devastating to my morale!!

lunar musk
#

Any idea why vfx look like this?

hardy fable
noble ledge
#

Inventory Widget Ref is a UUserWidget. How is it able to call a interface function?

dawn gazelle
noble ledge
#

hmm ok

dawn gazelle
#

What that node does is basically check if the reference passed in implements the interface, and if so, would return the array as defined in the reference's implementation of that interface.

noble ledge
#

Yeah I was just confused because its a default UE type and its calling a interface function and I couldn't see any connection.

dawn gazelle
#

Yeah that's the beauty of interfaces. It's a means of predefining functions and letting other classes handle their implementation of those functions, so even if you use a generic reference, like AActor or UUserWidget, if the actual class of the reference implements the interface, it will properly execute it as it was defined to do.

noble ledge
#

What if it was a widget that did not implement that function?

dawn gazelle
#

Then it would still attempt to execute it, but in this case, the array would return empty.

#

You can use a "Implements Interface" check before attempting to access if you want to make sure you know your reference does utilize the interface.

noble ledge
#

Oh ok cool. Thanks for the help

dense badger
#

I'm having an issue with my character camera / spring arm. I have a pretty standard 3rd person camera setup with a camera on a spring arm with some camera lag. It's also set to affect the players control rotation. The issue is when I teleport the player I can't seem to find a way to reset its rotation to match that of the player. All attempts to manipulate the camera post teleport seem to fail.

tough atlas
#

I just started building an object grabbing system, but am stumped trying to getting the PhysicsHandle to release the target if it gets to far away from the player, any iteas?

hardy mango
#

for whatever reason i'm not marrying this logic here.... i'm trying to setup a spline (ultimately splinemesh) to draw from this TargetActor (has a hit detection to ground - END POS) back to the character (Yellow DebugSphere). I cant get the position to go to the character for the life of me.... What am I missing?

frank sundial
#

Hey so I made a sprint feature ealier today ( I was tryin make a slide) and i was wondering if I could copy most of it, add some nodes and get a slidign feature out of it. Would anybody know what i would need to add?

rapid helm
#

hey y'all i'm havin a lil trouble with this, which node do i connect this with?

hardy mango
rapid helm
#

It's a collision blueprint

hardy mango
#

Do you not have an object reference?

I"ll assume by picture its the CubeCollision ?

rapid helm
#

It is Ya

hardy mango
#

why are you casting to it then?

Where is this code located? In the bluepring WITH the cubecollision?

rapid helm
hardy mango
#

do you have an object (or expect to have one) in the world of type AreaWithEnemies ?

rapid helm
#

there should be albeit that's the problem because I have no idea how to get the reference

#

I don't understand lots rn

hardy mango
#

GetActorsOfClass(AreaWithEnemies)

Will return an array. Iterate that array (ForLoop) AND MAKE SURE you do a validated get first - otherwise you're prone to crashes

#

that is of course - if you cannot get a direct reference to the exact one you're wanting to obtain.

rapid helm
#

I'll try it out

#

Thanks brother

hardy mango
frosty heron
# lunar sleet How much did that cost ?

Like 50 bucks 🫠can't say it's a really good one but it was very valuable to me as It can be picked up and used by people whom are learning.

There are things like input buffer, inventory system, skills, buffs, combat system including block and parry.

lunar sleet
#

Nice

oak fable
#

im trying to make a dodge based on the direction so all the other directions works find but the backward doesn't
is the values right ? or im mistaken

spark steppe
#

is it possible that some of the other conditions also fulfill the condition for backwards?

oak fable
spark steppe
#

it would be more readable if you used in range at least for the ones which don't flip over

#

yeah, but does it play no montage at all or another one?

oak fable
#

no montage at all

#

that means the calcs of the direction isn't right

spark steppe
#

the animation is assigned to the variable?

oak fable
#

yeb

spark steppe
#

then i have no idea

oak fable
#

what is the angle for the backward

#

or backleft to backright

spark steppe
#

that depends on where you take the sample, e.g. if the character can face any direction in a 3D world and you take the character rotation, then backwards will always be another value

#

eventually you want something like the dot product of forward vector and 0,0,0 and work with that (nvm that wont give you the left/right direction)

oak fable
#

so the forward always 0

#

back always 180

spark steppe
#

well then the range is correct for your backwards dash

oak fable
#

then why its not playing
when i debug it
it stops right on the branch

spark steppe
#

with which value for Dodge Direction?

oak fable
#

thats mean the direction i have which was 173 isn't true
for the branch

oak fable
spark steppe
#

oh

#

you have a condition which can never be true actually

oak fable
#

why

spark steppe
#

it can't be >135 AND <-135

oak fable
#

oh i see

#

i used the or before but that didnt work for the left and right

spark steppe
#

screw it, too late for math 😄

oak fable
#

that worked

oak fable
#

but i have to learn

spark steppe
#

but that's also true for all other dashs

spark steppe
#

nvm

ancient basalt
#

i have i problem in passing an vector value from an weapon component to a controller bluprint using interface and casting

#

the vector value in controller blueprint is 0 0 0

oak fable
#

that should work

spark steppe
#

no i think in your case the OR is fine

oak fable
oak fable
spark steppe
#

also i would change a bit of that code

#

to cover all values, currently there are small dead zones of 1deg if i'm not wrong (again)

#

unless you want it like that

oak fable
#

there is not dead zones i believe

#

from 0 to 45, 46 to 134 and 135 to 180

spark steppe
#

45-46 are dead tho

oak fable
#

how

spark steppe
#

their range isn't covered!?

#

e.g. 45.5 will never trigger a dash

oak fable
#

got what you mean

spark steppe
#

that CAN be desired tho, but in a fast game i guess a wrong dash is better than no dash

oak fable
#

Xd

#

will try to fix it

spark steppe
#

use >45 AND < 135 for right dodge

#

and < -45 AND > -135 for left dodge

#

that will solve it without overlap

oak fable
spark steppe
#

no if you use < and > instead of <= and >= for the left/right

oak fable
#

thank you for the info

halcyon oracle
#

nopelol

warped swift
#

hey 🙂 can someone point me to the right direction? learning ue5 and trying to figure out movement in topDown starter content and I'm trying to change that only certain place in level should be clickable -> in screenshot, with default movement, I'm clicking on the top of the pillar and I want it to change to the position behind the pillar, i.e. certain meshes in level like this pillar should not be clickable..

how would you approach this?

gentle urchin
#

Set pillar to ignore mouse trace channel

#

Or easier - create a new trace channel for the mouse, and activate it on the actors you want to block it

#

And set it as the mouse' trace channel

warped swift
#

I cant say I understand, but I will figure it out based on the tips, thank you! 🙂

gentle urchin
#

In the PlayerController theres a trace channel for the mouse

#

And creating new channels is done in the Project Settings

loud bridge
#

hey all - new to UE - i was hoping to have add navmeshboundvolume's around a spline in it's constructor, the best I can do is Add Child Actor Component and select NavMeshBoundVolume as the class. It does show up in the outliner, but doesn't show up in the editor, and it has no details page when selecting it in the outliner. Is there something fundamentally wrong with what I'm doing here? Should I go about this another way?

gentle urchin
#

I wouldnt add it to a spline in the first place

loud bridge
#

why's that?

gentle urchin
#

Especially not as a CAC

#

Question is whats the intent.. what do you wanna achieve

loud bridge
#

i want to achieve a navmesh that follows a spline that i can adjust on the fly

gentle urchin
#

Well the navmesh doesnt bend at all

#

So youd need hundreds of them to resemble a spline

loud bridge
#

right, i was gonna have to deal with that at some point lol

#

could i instead have some invisible walls spawn aroudn the spline that would act to block navmesh path finding?

gentle urchin
#

Yes

#

Easiest i found to work reliably was using isms

#

Theres been an update or two for thensplinemesh since the last time i did this, but atleast ismc work

#

Maybe spline mesh works today aswell,idk

#

Was huge issues with collision

loud bridge
#

never heard of isms but you may have given me enough to start reading - thanks!

gentle urchin
#

Instanced static mesh components

#

Pretty cheap mesh copying kinda thing

loud bridge
#

sweet sweet, thank you for the insight

edgy forum
#

just wanted to share an example of how helpful chatgpt is for learning blueprints! i've been using it for a month coupled with youtube tutorials.

gentle urchin
#

Ask it about using event tick

red berry
#

Does getcomponentsbyclass return a child of the specified class? The other similar functions seem to do, e.g. GetComponentsByClass/Interface/Tag but they return an array.
Edit: I think it does even though it doesn't say

frosty heron
red berry
frosty heron
#

depends on what you want to do. if you need to get specific component, you can add tag to it and just loop through the array and get the one with matching tag

#

if you know ur bp only contain one of the comp u searched then it's probably safe to get the first one it found

#

would be an issue if you want to scale tho

#

Another alternative is to use interface

#

which is more clean imo

red berry
#

GetComponentByInterface is more cleaner? Would that even be needed if there's just 1 of the component?

frosty heron
#

at the end of the day is about knowing which tool to pick

#

which depend on the scope of what you want to do

gentle urchin
#

A child is an extension of parent

#

And thus also a parent

#

A child class is also a parent class. But a parent class is not a child class 🙂

#

Id just get component by class personally

#

Components are like interfaces with state capability

#

Interface is more for when you have a bunch of very different actors that you want to share some functionality with

#

Interaction being a common one

manic hamlet
#

Not really a 100% blueprint question, but is there a way to easily copy something thats in a folder in the outliner?
E.g. I made a city with 5houses,put them in a folder Town01, now I need these 5 houses in a folder in Town02......Back in unity i dupliacte the folder and it would make it just like that, unreal cant ....or im not aware of how to 🙂

gentle urchin
#

Drag assets over -> copy to here

boreal valley
#

Guys can someone help me? I have 3 levels in my game and when i am in my 3rd level, I created a box which if i go through, it gives my character 100,000 score. But when i die to the boss, i respawn into the 2nd level instead of the 3rd level

manic hamlet
gentle urchin
manic hamlet
#

I marked them....started dragging ontop of "town2" and theres no menu or so, if i let lose it will just move them.

gentle urchin
#

Ohhhh

#

You want to duplicate them ?

#

Group

#

Hold ctrl

#

Drag

#

Get a grouped copy

#

Move to folder

#

Ungroup

#

I thought u were in contenct browser not the outliner 😅 mb not reading

manic hamlet
gentle urchin
manic hamlet
#

still getting the "move into town2" thing

gentle urchin
#

Ctrl and drag in viewport

#

Not in outliner..

#

Just like you dupe instances regularly
Could be shift or Alt instead, not at editor so cant verify

modern radish
#

I'm trying to make an asset move when something triggers it, I was instructed to try VINTERP, but it doesn't seem to work, any ideas?

manic hamlet
# gentle urchin Ctrl and drag in viewport

ah okay, Yeah ive been actually doing it(without the grouping) you proposed(its alt-drag^^) I assumed it would be as easy as in Unity and just ctrl+d or so.... well okay, finally can say i found one thing thats worse in unreal than in unity after almost 10month of learning UE 😄

gentle urchin
#

Group -> copy -> move in folder -> ungroup?

#

Probably some shortcut for direct duplicate aswell that im not aware of^^

#

Mayje ctrl c + ctrl v works in outliner? Dunno

manic hamlet
# gentle urchin Was this so bad?^^

Well in Unity its literally...click on folder...ctrl+d and everything is copy pasted 1click +2presses of a button 🙂
Unreal way is at least 15+ actions so its worse 🙂 Ofc it aint the end of the world, just saying thats worse in UE than Unity ^^

manic hamlet
manic hamlet
#

I assume there would be something like that.

gentle urchin
#

Anyways

#

Not something i use often (ever)

manic hamlet
# gentle urchin 15+? 😂

Ye.... right-click folder->click "select all descendants"->group->copy->make new folder->ungroup etc 😄

#

aight more closer to 6 actions i guess ^^

gentle urchin
#

😆😅

#

10 if every click counts

manic hamlet
#

either way, worse than ctrl+d..thats my point

gentle urchin
#

Ye i guess

#

Could check shortcuts list

#

To see if theres some magic buttons

#

It may even be just not bound

manic hamlet
#

I dont use it often either.... I just made a "small town"-template and made a "big town template" and just put them in the world as placeholders for now. so that I can map out the open world were creating

#

I didnt want to just use block/rectangular blocked white things there, I like it if it looks nice already ^^

wild crater
#

I feel like structs in BP aren't super user friendly, or at least I'm less inclined to make a struct when working in BP than when working in C++. To get one variable you have to split the entire struct. Do you guys add getters to structs or use data assets in stead sometimes?

gentle urchin
#

Grouping also helps for this^^

gentle urchin
#

Risks entire project

modern radish
#

Is there a way to Make a Material node DistanceToNearestSurface ignore a specific mesh? If I understand correctly that relies on a mesh distance field, but how can I disable a mesh do that it's not picked up by that node at runtime?

frosty heron
wild crater
frosty heron
#

bp struct can corrupt your project easily. Does a lot of nasty stuff

wild crater
frosty heron
#

declare them in C++ and you are good

gentle urchin
#

Ton of internal voodoo that can be corrupted

wild crater
modern radish
frosty heron
#

means struct that is made in blueprint

#

instead declaring it in C++

wild crater
#

That's also what I meant

#

But regardless of that. Getting data from it in BP remains a bit cumbersome.

gentle urchin
#

Yepp

modern radish
#

okay, but Structure Assets are fine?

wild crater
#

And setting by ref

frosty heron
#

@modern radish This stuff is super cursed

#

no project should have it ever

modern radish
#

shit my game relies a lot on this now

gentle urchin
#

But then theres replication

wild crater
# manic hamlet

Ah okay maybe the break node offers more options than when it's an output pin on a function!

modern radish
wild crater
#

well that's a good adjustment I could make already

manic hamlet
frosty heron
wild crater
frosty heron
#

Blueprint struct is probably the most hot topic when it comes to bugs

#

there are people not being able to package or have their defaults reset almost on a weekly basis

modern radish
frosty heron
#

what you need to avoid is BP structs

#

structs that are made in BP instead declaring it in CPP

wild crater
#

How can they be so different though?

frosty heron
#

a quick google will show you countless people crying over bp struct

manic hamlet
#

I mostly have issues with structs in WidgetBlueprints though.... each time I start the engine it tells me 2or3 "lost their connection" and i gotta "redo them" (simple refresh node does it though^^)

frosty heron
#

you just haven't hit the minefield yet

manic hamlet
frosty heron
#

and I consider you unlucky for not stepping into it earlier

wild crater
frosty heron
#

because I been a victim and I don;'t want to be a victim anymore

gentle urchin
modern radish
#

but all I'm doing is storing variables on Structs, and reading them inside BPs

manic hamlet
#

gotta learn another way in the future then, for now I go with it as were still pre-Prototype 😄

frosty heron
#

it's been a decade

frosty heron
#

and still the same issue

modern radish
#

My structs are created dynamically every time the game launches

frosty heron
wild crater
frosty heron
#

Unknown struct error is one of the common error

wild crater
#

it's also the first time I hear of it

modern radish
#

Same here

frosty heron
#

🤷‍♂️

wild crater
#

Maybe you're misusing structs somehow? But for base use cases they never let me down

versed sun
#

Same here, untill it did....

wild crater
#

Besides the fact that it's a bit cumbersome to create an asset for a simple struct

wild crater
modern radish
#

Okay, but I think it depends a lot what you do with Structs then? Apparently adding variables to them while they are being used can cause issues, from some google research? But in my case I have the Bp Structs setup, it's empty, and they are populated at runtime. and I only ever read data from them

#

I can't see how it could go wrong

versed sun
#

Ooo, my struct needs a bool, annnnd its broke

gentle urchin
#

Instanciated by the engine

frosty heron
#

You can stick using it and risk corrupting your project but don't say you are not warned

wild crater
gentle urchin
#

Right but its just one datasset

#

Unless you instanciate it yourself

#

Which kinda defeats the purpose ?

wild crater
#

Oh like that

tough atlas
#

I'm using the Physics Handle component in my game and am trying to stop players from prop surfing, my current idea is to freeze the player for a split second if their movement exceeds the sprint speed.

Anyone know how I can use Character movement velocity x y to calculate a speed?

wild crater
#

I haven't really looked at how it works under the hood

#

But it does what I want it to

gentle urchin
#

So if you alter the data, it will be altered on all references to that DA

wild crater
gentle urchin
#

Unless you manually instanciate it

wild crater
#

Not sure if you'd need the singleton pattern to achieve this

tough atlas
#

Not sure how to get it

wild crater
#

In fact it sounds rather cumbersome because that implies it would need to generate code? Rather than just generating an instance of an object containing whatever data is in the asset and having everything refer to it.

frosty heron
#

Character Movement Component -> Get Velocity
That's your speed

wild crater
tough atlas
#

figured it out alg

#

thanks

gentle urchin
#

And since its just a single asset (uobject), its not suitable as a mutable set of variables...

#

Unless you obv wanna share it (which i do in one project)

#

Structs are initialized when they're decleared in bp as its own instance and can thus be mutated related to its owner ....

#

Dunno if i make any sense at all

#

But bottom line is, unless you instanciate the data-asset yourself, its not a suitable replacement for a struct

frosty heron
#

make perfect sense, Data asset is not a replacement to struct by any means. You can create many instances of the struct each holding their own set of values.
try to do that with a Data Asset lol

gentle urchin
#

You can prob construct object from dataasset class to do the same

#

But its very meh

#

Would be the same with uobjects aswell. Its very meh.

torpid juniper
#

So just reading what has been said. Structs in BP are bad? Is there an easy way to change them all to c++?

gentle urchin
#

No easy way, just the 'do the work' way

torpid juniper
#

ah, fair

#

Also, how do i even make c++ scripts when the project is in bp?

gentle urchin
#

Its not exclusive

#

You can at any point add (another) c++ class to the project

frosty heron
#

Tip to help with declaring the struct in cpp

torpid juniper
#

as right clicking doesn't show any option to make script

gentle urchin
#

File -> new c++ class?

#

I cant recall were we do it initially.. not at pc

tough atlas
#

@wild crater So I set this up and the issue is that while I'm prop surfing the velocity is coming out as 0, even though im moving at thousands of speed units

gentle urchin
#

(As my typing clearly shows )

torpid juniper
#

ha ha, fair. Thanks. will look

frosty heron
#

Tools -> new c++ class

tough atlas
torpid juniper
#

Wait, can you make an instance of a data asset?

#

Like if i have a data asset for an item that is a chest and i want it to hold items

gentle urchin
#

I believe you can yes

#

But you gotta manage that one yourself

torpid juniper
#

Or whats the best way to go about doing that. As currently my plan was to have data assets for each different item in the game based on what they are. So i have a primary data asset which is furniture and then one under that called storage which has some extra variables for num storage slots. And all those data assets are of type item

#

So my inventory says i have 3 of a reference to "chest item" and when i place it, i want it to then be able to have its functions and stuff from the data asset and be able to look after itself and have storage and stuff

gentle urchin
#

That's where the issues come in

torpid juniper
#

Or is it better to create actors and add components to them in the process of placing

#

And give it any details it needs to know about being a chest?

gentle urchin
#

as it's singular, unless you've instanciated it yourself (which still wont give it physical rep), it can't really hold any state

torpid juniper
#

Yeah. Sweet

gentle urchin
#

To get around this, and keep data assets what they are, static data lookup,

torpid juniper
#

time to look that up 😅

gentle urchin
#

It's not a good idea x)

torpid juniper
#

static data lookup isn't?

gentle urchin
#

That part is

torpid juniper
#

Would the actor thing be better?

gentle urchin
#

but when you'd spawn it, it has to be an actor

#

that actor can have a ref to the data asset,

#

but the data asset cant , and shouldn't, really manage any state holding what so ever

#

that's the actors job

torpid juniper
#

Yeah, sweet

#

I'll have it so when you "place" the item that it will spawn an actor and give it components it needs to be a storage container and pass the values from the data asset

gentle urchin
#

(or pass the data asset)

#

instead of the values

#

as that's far more effective

torpid juniper
#

and have a ref to the item it is so when you break it, you know what data asset to pick up

gentle urchin
#

if we care about that in bp world

torpid juniper
#

ha ha ha

#

true

gentle urchin
#

Im doing some of the same stuff for my quest system

#

QuestBase is dataasset

#

thats static data

torpid juniper
#

Yeah, so that will contain the rewards, who you have to talk to and such?

gentle urchin
#

QuestInstance is an instance of a quest, with QuestBase reference, and whatever i need to track its states

torpid juniper
#

all the text for it?

#

Yeah, i probs need to remember how to code in c++ again as its been a while

gentle urchin
#

so whatever setup im doing is done in the data asset

#

it has its own uobjects with the fancy EditInlineNew / Instanced property

#

In theory you should be able to do something similar for your furnitures and whatnot

torpid juniper
#

That picture is from the data asset right?

gentle urchin
#

Where you have a main Item Definition, and Item fragments, which expands on the base item, and adds further functionality

gentle urchin
torpid juniper
#

Yeah, ok

#

My current plan is for the data assets to contain their own recipes as well if they have any

gentle urchin
#

multiple?

torpid juniper
#

So will have some sort of layering like that

gentle urchin
#

that would also be a uobject

torpid juniper
#

Undecided

gentle urchin
#

'recipe'

#

just like my rewards

#

since i dont know what a reward is at this point, i've just made the base class extendible with blueprints

#

keeps it flexible for whoever wants to use this