#blueprint
1 messages ยท Page 133 of 1
ok,, so from everything dicussed, which would be the best approach
to make a child, to use component,... which one?
Proper inheritance imo. But somewhat depends on what you want to adjust.
The component might be fine if it's quite drastic changes
I started a project with a friend, friend was just guiding me in the beginning as he have more experience with blueprints
I was following his instructions
this image correspond to the content of the PlayerState as he guided me (is a 2d fighting game)
now, I am on my own as I learned more from bps, and I am implementing ai, which works in a normal thirdpersonmap but not here
so I need to debug what is missing
starting with spawning not my custom BP for the fighter but just the ThirdpersonChar that works
I have seen better code, but also worse.
the player state is spawning the BP_Fighter
this setup is working
but I need to debug why the ai doesnt, the blackboard triggers but doesnt move, who knows why
so, in other words, this is why I want just to keep my PS that works, and start to deconstruct a duplicated PS
AI don't have PlayerStates by default
In case that's not clear
A PlayerController spawns a PlayerState by default. An AIController doesn't. If your spawning happens in the PlayerState that would mean your AIs get no Character.
Character spawning should theoretically also only be handled by the GameMode for that kind of gameplay.
On top I would suggest simply destructing the PlayerState you have to debug. With the big assumption that you are sane enough to use #source-control instead of hoping the project never breaks
at least I am a freak control, so I am using Perforce, with streams etc so I can fuck it up without worrying to much
my concerns is just to save me time
But then you have a copy via source control so just slash away at the PlayerState and revert later
Or shelve the taken apart one to go back and forth
is there any reason for
"Character spawning should theoretically also only be handled by the GameMode for that kind of gameplay."
to happen as I show, maybe for multiplayer in mind?
I also now find it weird to spawn from the PS instead GM
But I seems like your issue might be the AIController and PlayerState part
I wouldn't say so. I would have spawning in the GameMode and in most cases even via the DefaultPawnClass. And then for respawning I would just call RestartPlayer on the Controller who's character died.
I also now find it weird to spawn from the PS instead GM
I mean now that I know more about bps, but I learned through my friend and tutorials so I am not sure 100% always what is right or not
ok first I think I will move the spawning to the GM
You can spawn there if it works, it's just not the general go to location for that code
Does your AI need a PlayerState
A reason for it to need a PlayerState is if you have some arena game where people get kills and deaths that are in the PlayerState and the AI should also have that
I tried to set "isBot?" as true or false in my player state
this is working triggering the Behavior tree
but bot doesnt move
but in the 3rdperson map with the 3rd person character it works
it could be the playerstate, the controller or the AnimBP
for example with my approach, where bot doesnt move but Behaviour tree triggers
the bot can jump it I set "Jump" node
in a task
the problem is the MoveTo node in the Trigger
or the Ai MoveTo in a task
My point is that you might want to check if your AIController BP has bWantsPlayerState set to true to begin with
this doesnt works for my case
Hm
It sounded like your AI isn't getting a character from the first stuff you wrote
but it jumps, being "Jump" node in a task of the Behavior Tree
even to play a Montage
and the Behavior Tree works with even a sequence from Task to Wait
is reading the distance
only thing is the Ai MoveTo node in a task doesnt work
or the MoveTo node of the Behavior Tree doesnt work
Simple MoveTo also works
make think is a specific problem with the AnimBP or the Controller
Hi people - Hope you all are well.
Does anyone know how to make player start follow an actor?
I am currently making a space station that orbits a planet, where players can spawn onto. Since the station is orbiting earth, it is constantly moving, thus moving away from the player start. I would have hoped for a component, i could have slapped onto my space station blueprint, but alas....
Does anyone know of a solution for a scenario like this?
a Gravity System?
A gravity system? I just want a player start to follow my space station? ๐ Or am i missing something here?
hmm
player walk inside your space station
and, follows it like a normal person in a sci fi movie would do
I never did it, but, I can imagine either gravity system
or they just walk normally inside the station
or the station it has a vehicle setup
hi, so lets say i have 2 buttons for 2 maps i want so that u select a map and when u press start u spawn in that map
if a player walk over a moving platform, like your space station, the player follows
problem is that, when platform moves and player jumps, player gets behind
so then maybe you need a gravity system setup
Could be. Right now i do not have the issue where if i jump on the orbiting station, player gets left behind, hoewever, i was thinking that i maybe could make some kind of custom player start, the could be used as a component, and be attached to the blueprint?
๐ฅฒ I was this morning exatcly finding out about components just here
I feel, unless a more experienced dev here say the opposite, you could give a look onto this
https://www.youtube.com/watch?v=nHxN9W4rQ44
any character follows by default the platform (station) they are, problem is jumping or physics in objects, throwing them etc, even the space ship taking off or landing will be complicated
with gravity I think that all this would be solved
I really didnt do that tutorial, I just check it more or less, is even interesting to play with the "3rd body problem"
there are a lot more of tutorials that play with the idea of jumping from one planet to another or landing in a planet from space
you will find something that fits you, but I think has to be with gravity
You could just parent the PlayerStart to the Station Actor
(they really dont follow, they are just there and there is friction that avoids they to gets behind)
Either via code if spawned runtime, or by just dragging it onto whatever your space station is in the Outliner
Or wait
player start
Or PlayerStart
if character jumps would fine then?
and any projectile or physics objects would needs the same, right?
I think I misread
But the problem is usually solved already by the CharacterMovementComponent having BasedMovement
That's how Platforms that move make the Character move with them
Let me turn on my pc, it's time to solve this son of a gun
Yeah so i have based my cmc, and that works as intended, now i just need the playerStart to follow the station - the problem is that one can't parent the PlayerStart to a movable actor. And i do not know how to change the PlayerStart to movable.
So that was actually a questiona bout PlayerStart. Why can't you parent it?
You would need to set it to also be Movable
Either select the one in the scene, and check the Details Panel for it
Or make a Child Class of it and change it in there
And the root?
Or instance or whatever it's called
Otherwise just make your own Child BP of it
And replace it
right guys, got a basic issue that's breaking my brain. this blueprint lets a character walk left and right, but if walking up and down, it retains the direction you are facing. like old beat em ups (streets of rage, etc). Problem is, id like enemy pawns to do the same, but i cant figure out how to replicate it in, say, animation bp. am i being stupid or is this a weirdly difficult task?
Hello, is there a way to copy all values from a blueprint struct node and paste it into a variable?
Not really
Ok, thanks for the answer.
Wdym by into a variable?
To another struct of the same type?
?
Yeah but how would i change the default PlayerStart? Can't change it in GameMode
It's an actor in the scene
Remove the one that is there and put your own out
Just make sure it inherits from PlayerStart as Parent/Base Class
Yes, but if you inherit from the PlayerStart baseclass, you would still get the Capsule Component that is static by default which can't be deleted for some reason.
But in the BP Asset itself you should be able to change it to movable or not?
It can't be deleted cause it's the root that is iniherted from the parent
Negative
Hm, so the GameMode has a FindPlayerStart function that returns an Actor.
You can in theory override that and return your own custom Actor (not PlayerStart inherited)
That would be the next thing I would try
Yeah i saw that post on UE forum, however my knowledge fo UE isn't there to do it (Coming from Unity recently) So i am not familiar with it.
So i would think, that i would do the following, but feel free to correct me,
Find the gameModebase c++ -> Create c++ class derived from the base -> Open it in IDE - > use some kind of c++ vodoo Override function ๐
You don't need C++ for this
You can override that function in your BP version of the GameMode
I would also always suggest using GameMode and GameState and not the Base versions
The Base versions are for very simple games and lack a lot.
The none Base versions are for more complex stuff and multiplayer, but there is no real reason to use the Base versions imo
you lost me XD
If you mix Base and none-base you get problems. It even annoyes you in the logs then
GameMode/Base defines the classes the GameMode uses
Which GameState, Pawn/Character, PlayerController, PlayerState etc.
If you use a GameMode and for the GameStateClass a GameStateBase child, it will break stuff.
Same the other way round
That's just a headsup though
For your PlayerStart issue, hover the FUNCTIONS tab inside your GameMode Blueprint
It should show an Override dropdown on the right of the FUNCTIONS tab header
a bit hidden sadly
There you can select the FindPlayerStart function
For testing I would suggest you simply remove the APlayerStart from the Scene and make a custom BP_PlayerStart that inherits from AActor.
And place that into the scene
And then use a GetActorOfClass(BP_PlayerStart) and return that in FindPlayerStart function
See if that gives you want you need
Before i do anything, i just have to say thank you for taking your time... UE can be quite complex, coming from a different GE, now back to work ๐
No worries. We all started somewhere.
Yesterday someone took somewhat around 3 hours to explain me something that they didn't have to. They shared code, solutions and explained things multiple times (I'm a bit slow atm in terms of following cause of being ill).
I always think that helping others opens doors for receiving help. If everyone keeps their knowledge to themselves it would be quite the sad industry.
Its a very helpfull community by enlarge
Man.... Big W for you... i really really appreciate it.... I am nailing the basics in UE, and i really like it so far, however now i am beginning to do more advanced stuff, and that is where you really bump your head into stuff that isn't well explained online cuz of the custom behaviours ๐
Yeah it can be very overwhelming. But it's also somewhat needed to get used to it.
I've been doing this for somewhat around 10 years now and I still have those moments with new stuff I never worked with. It of course helps to have a good base understanding.
Amen to that!
idk if it helps, but my Multiplayer Compendium has a section about the Game Framework that explains the classes a bit. If you filter redundant Multiplayer info from it, it might give you a bit of an overview. of what GameMode etc. is and does
It's mostly a write-up of what you could find via google, but on one page fwiw
Some samples to look at helps aswell
I'll have a look at it ๐ Where do i find it?
Merci! ๐
It is focused on Multiplayer, but the general info should also count for Singleplayer
Well i am that kind of dev, that REALLY hates my life, so i love to tangle myself in the enjoyment of only doing multiplayer stuff, cuz then i can make myself believe that someone might play it with me one day..... lulz
Yeah, that's basically story of my life. That's why I wrote that compendium all those years ago to make it easier for beginners.
If you want to at some point learn Multiplayer with UE (unless you already do), then this is def something you should read
Without wanting to do self-advertisement here
Dude... Advertise all you want... I need tha compendium! ๐
So i made a new actor called ps_spacestation, and i suppose in the gamemode blueprint, you want me to do something like this?
Years of xp densed down to a few pages
Yeah it's still surreal to this date. My company got contracted by a larger studio since a few weeks ago that are working on a bigger MP title and the compendium is linked in multiple places of their Confluence.
I can't escape it anymore haha
Brother.... CONGRATZ!
Yeah it's an idea
I haven't tested it but that is what usually runs the code to find APlayerStart in C++
I did something similar at my job, and clearly theres a lack of those sort of compendiums.
I wrote a lot of info for them down about NPP and Mover.
I will have to ask them if I can put that into my page eventually. In theory nothing stops me cause it's my knowledge, but well.
What mostly stops me is the lack of auto deployment of my docusaurus page.
My wife said she would set that up for me on our servers, but she's playing Hearts of Iron the whole day ;_;
Id be surprised if they said no, given how they themself gained from your original one...
๐ thats an ok excuse
Hope she gets it done asap tho!
So it works as intended, however whenever i play as a client now, i just get a black screen, but on the server it runs
Everyone would benefit from some auto deployment of your knowledge
So, this could be cause you are only using one of those Actors (and your code is only returning one). The PlayerStart setup has the Capsule for a reason, to check if the Start is occupied and what not.
So you might need to place a second PlayerStart_SpaceStation and change the function to return a random one.
You can use GetAllActorsOfClass which returns an array containing both.
This is also one of the few times I find that node to be a valid choice.
If that works in some cases, you can then expand on that and add collision to your custom PlayerStart.
Then instead of grabbing a random one you can loop over them and take the first that is not overlapping a player.
I'm sure the coding logic isn't too lost on you given you worked with Unity in C#
I really isn't + i have been a dev for 10 years beside my Unity experience, So i just have to commit to learning the UE c++
SO it is kinda wierd that when i place my playerStart as a child of my BP in the scene, it dosn't follow the Bp location/ parent location
Could it be missing colllision, that causes this?
As long as the actual PlayerStart UE class is locked to Static instead of Movable that won't change I assume
Or what do you mean?
Oh you mean your custom PlayerStart_SpaceStation as a child of the SpaceStation BP
So the inital problem were that i couldn't make the playerstart root movable, and then set it as a child of my space station BP in the outliner. So i created the custom one, and i can make that one movable now and set it under the Bp in the outliner. And i have set it to movable, but it dosn't follow the location of the spacestation
Hm, I have to say that I never attached something this way and actually expected it to move together runtime. It should though in theory.
The only other option you would have is let the BP_SpaceStation spawn the PS_SpaceStation in its ConstructionScript and call AttachTo on it to manually attach it to the SpaceStation. But that's a bit annoying to handle.
The Location to spawn the PS_SpaceStation on could be a Socket on the SpaceStationMesh for example. Not sure how that Actor looks like
I guess a child PS with just a spawnVector wouldnt suffice?
Another option is to have an InstanceEditable Pointer to the PlayerStart (that would even work with the normal PlayerStart) on the BP_SpaceStation.
You can set that in the DetailsPanel then to the PlayerStart that is in the scene
And then you can update the location on Tick manually
Or attach it on BeginPlay fwiw
I would need to actively try that to give a clearer working solution, but I won't open UE today
The onyl thing I would not do is listen to anyone trying to suggest using a ChildActorComponent, cause those are pretty buggy
Ah nvm, mine wont directly work as it needs an actor to grab the spawn location from
you'd also need to override the OnHandleStartingNewPlayer or whatever the event is
I MEAN, there are lots of ways
You can also handle spawning fully yourself
And just grab a location that you define as part of the BP_SpaceStation
You'd remove the DefaultPawnClass from the GameMode
ANd use the Node Squize posted to call SpawnActor with the Character/Pawn class yourself
Feeding in whatever Transform (location, rotation, scale) you need
Get well soon ๐
That is what i really want, i just thought it would be easier to manipulate the player start to move with an actor ๐
so usually it loops through them and if you've specified a string, it looks for that in the starttag
pretty straight forward really
I'm usually more for utilizing UEs existing functions
Because those have a lot of additional support
Like calling RestartPlayer to just trigger the process again
But nothing keeps you from doing your own thing, to some degree at least
You still want to use the "right" event to kick it all off
And maybe think a bit about turning some stuff into function. Like spawning sounds like something you gotta call by hand too
I want the function that is most battletested, As my old professor told me, someone have propably already build it, and tested it way beyond what you could have thought of.... That was in regards to handling security, HOWEVER... I might apply to this aswell XD
The same logic can be applied to third party libs to some degree ๐
Ah, it would not be too sticky to that
No reason to reinvent the weel and trouble yourself with battleproofing it when SomeThirdpartyLib is tested by 400 000 users and likely as many usecases ๐
There is A LOT in the Engine
And that lot has made a lot of assumptions
That aren't true for all games
UE gives you a lot of freedom
Man I can't listen to whoever is talking to me in voice and type. What the hell is "freeding"
So i think the problem is that when i initially spawn, i have no collision, for some reason and are falling thorugh my space station ๐
But that wasn't a problem before... tf
Keep in mind you spawn where the actor location is
With the other PlayerStart, that's in the center of the Capsule
If you place yours to the floor, you spawn with half the character in the floor
Lift it a bit @undone wolf
wondering if somone could help ive started my first project and this cast is failing when i try to interact with a container to display its inventory and i cant figure out why
We can only repeat what was told to you yesterday already
The cast fails cause the PlayerController is not a "MyController"
Which is usually the case if you don't set "MyController" as the PlayerController in your GameMode
But you know all of that cause Adriel told you already
yes but i dont know how to change that sorry
yes i have read it but i dont know where to set my GameMode only been using ue5 for a few days and mostly been following tutorials
Game mode is set per level, look into your world settings
I mean, that's fact
ok ill try googling sorry for asking
Its ok to ask
don't be sorry for asking but if you are adviced to read some material, it is done with the best intention
So @surreal peak I made the PS have a collision capsule, and when something is isnide it, it flips a bool. then in my GM at the FindPlayerStart overrided function, i made something like this
And when i play as client the first Client correctly spawn in, however the second one is just black, i can get a print screen, but it's like its not rendering anything?
No worries its not hard at all to say:
You can go in the world settings and override the gamemode with a new one made by you (as you create a normal blueprint class, just select gamemode and inside it you can change the playercharacter, the player controller etcโฆ), each level must override the gamemode you need
thanks i figured it out now but now ive lost movement so im trying to google how to do that now
Iโve been in your situation and even if its basic people might not know that and what to search, so no worries
Your input is in the mycontroller or character?
Check if it actually spawned a Character for it
In that case check of you also set your character blueprint in the gamemode
Would be shown in the outliner on the server, right?
Yes
Do you see character spawned?
I dont know what you actually do there, but if the for loop doesnt find anything it returns nothing on the completed, might be that?
Negative
Also doesnt the for loop recall himself?
ive been looking i dont know how to check
So I delelted the basic shapes
I didnt save, still applied ๐
Anybody know how to get them back?
Wanna hop on a channel?
If it's from the starter content, you can just import it again
How
You have to open the gamemode or override it in the world settings
I can help you in a call if you need, im in train though
No call
I mean fluffy
sure i dont mind
@proven sigil share the screen i cant hear you
running into bit of issue doing some coding in unreal, created target actor for this test placed in world and am trying to get it do predict profile path between player character and target actor in world and draw the path but its not working this is my code. I am getting all actors of class target actor in array then doing a for each loop to get the actor world location of target actor and world location of player character and subtracting the values to get the number then doing a normalize on the return output then multiplying by a constant for projectile thrust.. but when I run its not generating the path. what am I doing wrong?
No sometimes i just CAN'T wrap my head around the visual coding in UE XD
not always that clear when macros do things under the hood ๐
Confirmed:P
and they're not always straight forward to read either
Sequence here is what makes it loop automatically
yikes XD
@surreal peak So you said that my new player start capsule would need to be lifted a little, because the player wouldn't spawn from the center of the capsule. how would i change the spawn position to be in the center of the capsule?
If the capsule is the root component, its center is automatically the center of the actor
And the actor location should be used to spawn the character
@undone wolf
Guys, why my For Each Loop only prints zero? My item is in Index 1 and the loop searches only in 0 index ๐ฆ
so it only logs index 0, i'm guessing the array length is 1
check it's length before you foreach
Hey! I've 8 indexes. You mean the Length node?
thats not the log in the image ?
are you trying to return the last index ?
hmm, my bp has to search for the "Remedy" name in all the 8 indexes, but the for each goes only zero
well it looks like your logging the index plus some other information
it's not the log from the code you posted
Yep, this log is from other Function, to check all information
Oh, I solved it right now! Tnx anyway!
So i got it to work with the capsule being the root - thanks!
Could you detail what location i should use to spawn the player?
Does anyone know what the issue here is? (For reference, I have added pictures of the related BPs)
i think get player controller is not working correctly and is return an empty value
How should I fix it?
does anyone know of a way that i can get the bone name of where the damage was taken and then say to dismember that limb. I know i could do it through where the line trace is happening for the weapon but if theres a way to do it through the enemy thatd be nice.
Hello again
Question about main menu, i made a hud
there is a button in it that loads the level and i suspect that it is also reloading the main menu
how can i break the loop ?
tried this but no avail
where is this begin play ?
i don't think remove from parent will work after you load the level, i'm thinking you want to remove from parent first if you want to try that
remove from parent, then open level
but if that beginplay is in your character it's going to load again
tried, same thing it reloads the level and the meni
would do once node do any good somewhere ?
Nothing to do
U prob simply failed to open the level
its in a firstpersonhudbp
chatgpt, dont kill me
so if you have the same hud in your other level, it will load up again
so i need two levels ?
your trying to open the same level your on ?
yeah i only have one game level bassically was just trying to create a menu
Make a map for main menu
Then make map for all other maps
From main menu load other map
I don't get what u r doing then
so the easiest way to do that is make a level that is the main menu
then you load level, your level your going to play on click
you don't use the same level, if you do use the same level i would use seperate pawn and posess it as the main menu
i see what you both mean i think, only way to break the loop would to have two containers, and not everything in the same whatever map/level
idk about containers
but levels for sure
one level is your main menu, you set that to your default in project settings
so now your loaded on the main menu level
then you just click and load the game level
but i would use seperate hud if you are doing stuff in the hud on beginplay for the main menu
i am reloading the level & the main menu i created with a loop triggering by the begin play which loads the same level that loop
clear ! will try that now
ARIGATO
u are simply opening the same map with the same code
Just make a map for the main menu
And make new map for other maps
From your main menu level, load the map u want
Worked ! thank you both โค๏ธ
Hello! I'm working on a UE5 horror game and i'm using a Nav Link Proxy as a child actor for a door. My goal is to deactivate/activate the link based on the value of a boolean("Enable") to avoid having the AI monster destroy certain doors. The problem is that disabling when is active works, but not the opposite. This used to work 3 months ago, and i can't wrap my head around to understand where's the problem. Thank you soo much for your time!
Is boolean default value true or false?
or is there a way to set that default value
cant find under details
not sure if this was asked before, but how do I set parameter type of an bp interface to delegate?
This (first screenshot, the function) only works by dragging it onto the function node, but when searching for the paramter type there is no type "delegate" :/
the default value is false.
you can set the default value for the variable, not the default for when you create a variable
but once created you can "default" it to true/false
are you trying to get the event pin ? idk about delegate but isn't that basically an event ?
yes, the event pin
Yep thanks guys
Hey guys, small problem, I am making a one way runner, but when I strafe left/right the X speed which should be constant gets reduced by I think half, any solutions?
but not for interfaces..
thats legit what I was saying before...
o i c
^
interfaces can't have events ?
hmmm :/
Gun is not attach to player any soln. gun is not attach player arm when is play game (i am new in UE5)
Not possible
Feels like the functiom being able to was a blip ๐
hm feels bad
Yes
gotta do it via c++ then?
Is there a way to convert an array to another type? I'm using get all children and that returns an array of panel widgets although they're all textblocks. Since it returns panel widgets though I'm unable to change the text as it only works with text box types
Cast
Must cast individually tho
Alternatively, you set it up so they text boxes (wrapped in a UserWidget) can listen for array element changes
And react themself ๐
so what is self ? and what is the error saying ?
This is my camera movement pawn graph, it lets player rotate the camera around globe (sphere), kinda like in google earth and maps. Any idea if I had the coordinates in a datatable, how to make an animated move from current (whatever) position to a certain position (to a certain country)? I know I need to use a timeline, but I don't know what to connect to what as when I print current camera's Y and Z cords, it gives me X, Y, Z for each for some reason.
the error is that there's no target connected since they're of two different types, The get all children returned an array of panel widgets but the text box requires textbox widgets
you can interp on tick instead of timeline
and the text boxes are in the panel widgets ?
maybe an array of the textboxes where you match the indexes
How to use the select node to set predefined resolutions using the set resolution node?
if you were to interp on tick you could just set a location and it will goto it
I'm trying to make an array of them with get all children, the issue is that the variable types aren't compatiable
oh i'll try that, thx
actor variable should be allow
is it a globe or a map ?
probably timeline then with a curve idk much about that
It's a matter of the reference you're attempting to get isn't valid when you're trying to get it, which means where you may be calling the "Get LCS Hud" function may be before the player controller even exists.
you could use vectors and just split it
im not sure what you mean
here is a better screenshot
the struct
make it an AActor of type
i mean when you hover over it it says you can't do it right ?
so i'm guessing your f'd
thats wack
maybe there is a workaround but looks like it doesn't allow it
im just trying to reference an actor blueprint
you would probably have to set it dynamically
so when i take from the data table it knows what to spawn
what if i do class reference
that should still work right
because it doesnt give me errors there but idk if it still makes sense
brb
my favorite is the let me google it for you
thanks for the idea, i fond other way to work around with it while keeping your idea in mind
what do all these numbers do????
will set resolution in the struct
I think you just need 4 points
if i choose 0 in the combo box, the 0x and 0y will be a new resolution
i would check if the index is valid, but easy way to store them
combo box is already an array of indexes in my case
i will hard code the resolutions in the select node
Hi! Does anyone know if it's possible to use the line trace by channel as trajectory for a projectile? I want to do something like a laser beam that reflects itself on certain surfaces only, except the laser beam is a projectile
i hope this is not a bad practice ๐
yes it will be the same
In that case, would making a direct reference fix that? Or is there something else i could do to call the player controller first?
#worst way of doing it lol
it works at least ๐
sure
anybody know any functions that for an object that has a random float spawn it give it a greater chance to spawn around a certain area.
you have to make that function on your own..
yup
Is this a spawn point placed in your world or what
no, the spawn point is for the left and right borders
they always follow the player so that he doesnt go out of bounds
one way runner ๐
a level might have different limits sooooo
Cast is a type check, you feed it a reference to said object and it checks if itโs of the class you want, and lets you access its insides. You can learn more about it in the bp comms live training near the bottom of the pins
oke
is it on the player ? or they are seperate just following it ?
separate
also spawns without being placed by the dev
oke idk what refference to feed it
what is the type of point of spawn?
get actor of class most likely
open the class, click class settings and check from what it derived? or show screen shot
idk, what do u mean by derived
probably instead of cast get actor(s) of class
or you could put them in array at runtime
so you have both
or they are different class ?
it says it can be pretty expensive but i have not found one offs to really be that much
Hello! How I can unfocus input from text box after sending message back to the game?
Just now input can be recieved after sending message only after clicking somewhere by mouse...
depends on how crazy your hierarchy is
I saw a basic tutorial about a door and a key a few weeks back, she talked about refferences, I will rewatch it
that makes sense, and how far up the classes you go ?
Thx
yea, every UObject is kept in a class specific hashmap which gets looped through when get all actors of class is called, the other get all actors nodes like the one utilizing tags are much worse.
can you have multiple game modes that are switched via bp?
the biggest concern is when you have many classes deriving from the class you're trying to get
then it'll have to loop through all those too
I rewatched the tutorial
I didnt know that u could get the variables also by making a refference variable
No cast needed
Theyโre tied to the level
that's just caching the return of the cast
No, thatโs dumb
Discard that tutorial
Why
Because itโs obviously teaching you stupid things
Making a variable of a certain class does not give you the instance of that class
It just creates an empty seat for such var to be filled in
then the next question is if you load a level within the game will the gamemode switch to the new levels gm or is it whatever gm is loaded first
Yes
when you have say an overlap event, you only know that the other object is an actor
as such you cannot treat it as anything more specific than that
Bruh
when you have an empty reference that's meant to keep an instance of a certain class you can act upon it knowing that it's that class
but to populate that reference you will still need your type check
What you need is to understand how casting works and what it does. Despite its name, itโs not a magical wand that gets you the ref. Many of us thought that at some point, hence why I mentioned that bp comms training
one point to keep in mind that helps understand this, is that the only way for one of your BPs to know about another is if both are loaded into memory
and you only want what is necessary in the current context to be in the memory
Ok.
You usually get the ref through some form of interaction, or in some cases you can use get actors of class but at that point you donโt need the cast anymore and that function should not be abused
yea get actor of class checks for a specific class and returns a reference of its type, we know what we're dealing with so we can access all the things specific to it
on the other hand that also means that class is now a dependency, if it's gone the class that accesses it won't compile and it will need to be loaded into memory along with it
this is a hard reference
...
get actor of class only returns one instance
like this?
and there is no really reliable way to tell which one if there is more than one
read more.
so use get all actors of class if there's 2
Actorssss
Both the point of spawn and border r only 1
that's fine then
So get actor of class
It's helpful to think of type information as data that's separate from the object. You got the object instance, then you have what you KNOW about that object in the current context. Casting is obviously a way to GET that information, but it's useful to understand how it can be LOST too.
This little bit of code gets a typed reference to my BaseShip class, but then calls another function which JUST has an actor as the input type, and now it's lost that type info
That TypeDestroyer event is a different context, and everything we knew about that actor from the previous context is gone. We just know it's an actor, because thats all we're checking for.
Thanks
ok
OH MY 3D TORUS. I will grab popcorn
so i have a level select that loads otherlevels but i dont want a default pawn to be loaded until i load in the next level what can i do for the pawn that loads in the level select
set it in the game override of the level ?
it will be whatever pawn you set for whatever level
create a new game mode base class and override it, then you can set the default pawn
you can make it different in the level select level, and whatever you want in the other levels
you override it in world settings
so whatever level you are on will have world settings
ahhhhh
now it works lol
so close to having something that functions is a neat feeliong
You're using the wrong interface event @flat coral
You want the message kind. Not the direct BPI kind . That rrquires you to cast to the BPI type.
So your statement is wrong. Nothing is lost when there's nothing to lose.
Hey, anyone got experience in setting up FSR? im a bit confused.. im trying to set it up so the player can choose the option from a settings menu so i dont want it enabled by default because the player also has the option of DLSS as well, i call 'r.FidelityFX.FSR3.Enabled 1' which does do something but then calling any of the quality modes with 'r.FidelityFX.FSR3.QualityMode 0/1/2/3/4' doesn't seem to do anything? am i supposed to set the screen percentage myself by command cause calling 'r.FidelityFX.FSR3.QualityMode' doesn't seem to set screen percentage?
hey so I have a cone vision system in my game, I am curious if anyone knows how I could make my enemies invisible when out of the cone of focus? I currently have them in a cuistom stencil but can only make them a color. any idea how to make them "transparent"?
I want to have the world somewhat visible around you but make the enemies completely trasnparent when not in field of view
Can you not add a visibility variable to the skeleton mesh? @cursive wigeon
I'm assuming that the light uses pawn sensing so just set it so that the mesh is visible on see on off when its not seen
the vision system is an ISM @bold cypress
used as a mask in a post process
pretty simple
Purely aesthetic problem, but has anyone found a way to make tall vertical stacks of nodes like this a little less spaghetti?
reroute nodes
Where? This is hardly better, and it'll fall apart with one more row
i like to drag the stuff on the right a little higher and out a bit so the other one is sort of centered
about as good as you'll get it
The more rows you add you'll just have to keep moving them up and centering it
You can also collapse more shit into functions so its not all over the place too
I created this in a blueprint, If i call Get Actor of class, and I put that blueprint, will it return me the room?
you could swap this huge block of blueprints with one Select node :v
@bold cypress maybe I could do a overlapping actor setup to set the visibilty with my Vision ISM?
I don;t know how performant that would be
I don't know anything besides that man. I just started programming about 2 months ago lol
Hello, does anyone know whether it's possible to make a custom version of "select" for gameplay tags? I have gameplay tags for game difficulty, and I would like to select a color based on a tag. It's annoying to create 5~ branches (I have that many difficulties in my game) every time I need to get a value for a particular difficulty
No worries!
I want "Index" to be a gameplay tag, and somehow specify all the tags I want to be as an option
If generic Select node doesn't work here, you could try using a Map for creating pairs of Tags and Colors. Not sure if this gonna work for your case though
Definitely feeling like a map would work there though.
On the other hand. I would also recommend making your difficulties a definition of their own with their names, associated colors, icons, etc.
Yeah, I know about the map workaround, but it's annoying to have gigantic expressions like that. I was wondering whether it's possible to make some custom node for that even using C++, so that details panel would have a list of gameplay tags that would make part of the select
It could be an option, but colors is just an example. I have more cases where a definition is not necessary
possible to disable/enable Static Lighting from UMG?
Maybe a custom DataTable or Data-only Asset?
My point is that I would like to have a very fast setup for a select using arbitrary gameplay tags. For now it's difficulties, but later on I have game phases, game modes, and so on. Creating data tables, maps, or anything like that is extra work I want to avoid, as it either decouples the task in multiple places, or makes it too big in terms of node width/height and their amount (note the MakeMap size and an adjacent Find, also there is no Default case, so NotFound should be handled as well)
Well I'm not entirely sure what exactly you're planning here, but creating new generic node and dealing with whole K2Node API would probably take you way more time than using some more Data-driven approach. Take a look at the links below, maybe you'll find something useful:
- https://benui.ca/unreal/data-driven-design/
- https://dev.epicgames.com/documentation/en-us/unreal-engine/data-driven-gameplay-elements-in-unreal-engine
Blueprints are a bit limiting when it comes to solving such problems.
I'm fine with dealing with creating my own nodes in C++ for this task. I am aware of data driven design and all that stuff, but I'm asking if anyone could shed some light on the actual implementation of what I'm looking for, I'm not trying to solve the problem in a way, I want to solve it following the way I have in mind. I want to have this node for dynamic things that can change easily (in terms of drag and drop to the graph without thinking much about other stuff), and I want to apply it in many different places that not necessarily should are complex enough to have external data structures to query data from
the answer is NO.
make your own node
or don't
there is no built-in Select node that has a gameplay tag in the index pin
as for how to build your own version in #cpp try that channel
Welcome back ๐
oh didn't even notice. wb @maiden wadi ๐
bet you didn't miss some of these "questions" lol
https://www.unrealengine.com/marketplace/en-US/product/gameplay-tag-select
Looks like someone's already made it. But if you wanted to do it yourself, then it's largely the same thing. It's just a custom k2 node.
Something like this might get you started, I didn't read through all of it.
https://www.gamedev.net/tutorials/programming/engines-and-middleware/improving-ue4-blueprint-usability-with-custom-nodes-r5694/
Does anyone have any idea about why that this sphere trace doesn't detect my enemy pawn?
Perfect, that is exactly what I was looking for. Thank you ๐
wb Auth!
sure it's not just hitting self first?
ah cool, Auth is back
Might not be the right answer but you can do a for each loop on an enum, just do type for each e (enum file name) and itโll loop through the enum, then just add these into an array and then compare the incoming value ? That way if you ever add any more enum to it itโll auto update, just make sure to clear the array before running the loop each time. Just an idea
You could try increasing the radius or changing the end location
well your start and end is just the socket location, your just checking that one position ?
Anyone ever seen an issue with saving a blueprint after zipping the project and unzipping it?
It seems random. I just get save errors.
It still requires some setup. I would need to make an enum, build an array with it, foreach through all the elements - too much ๐
why are you zipping and unzipping? this sounds like you're unaware of source control
It is to an extent, but generally not the right solution. It's all going to depend on what you're doing. Look up inheritance, and function libraries
I am because it is not a one time thing it gets repeated in the animation notify state
is it hitting anything?
you need to figure out if the problem is that it's not hitting anything, or that it's not hitting what it should be
I know but when i run the game it legit hits the enemy and does not turn green
I thought I remember sphere traces not liking a distance of 0 but I might be mistaken
its not hitting anything
try end at start + tiny vector
what are those ?
add a tiny vector to the start pos to make the end pos
it litteraly going through it but not turning green
er wtf its backwards
yeah i had them backwards
But why isnt it hitting
show collision settings for capsule and mesh
I'd expect that to hit self tbh
try make it really big, 500 radius
That does not help
have you made it so start and end are not the same spot yet?
no but i can
that doesnt help either
show the collision settings
lmao
there is no collision capsule or anything
uh
Sorry for taking your time
you're not based on Character?
wdym
Sounds like you
what class is the enemy based on, pawn or character
re using a pawn
not a character
Just by looking at it character would probably suit your needs better
using pawn is fine if you don't need character and want to make your own movement system
I am using a pawn but should i switch to a character
Is your character meant to be a humanoid that behavies like...well...a humanoid? Walks, runs, etc..
I will add a behavior tree so yeah
Like for example, i worked on a project where the character was a snowball, and moved using physics, so i used a pawn and custom coded the movement, but characters that are human like will typically be fine as a character. The character class has a lot of movement logic built right into it
and btw I added the collider but it still doesn't take damage
The collision profile of the collider has to be set to "pawn"
cause you're tracing for pawns
Where do I change that?
So i could be mistaken, its been a while since I was deep in ai, but if you're using a pawn, pretty sure behavior tree nodes such as "move to" and the like wont work
uhh one sec, ill take a screen shot
its in the details pannel but you have to scroll down
so on my screen where it says overlap all dynamic
youll change that to custom
no sorry
change it to pawn
thatll do it
ok I did as you said and it worked thanks a lot
The greyed out dropdown that says "object type" needs to be pawn
You have to zip the project to publish it.
but now I am dealing to much damage how can I limit that
Totally going to depend on your code
Unreal engines built in damage system is pretty good tbh
oh nevermind i found the logical error
I am dealing damage at the end of my function which i call on animation tick
but i can call it at the end of the tick
where are you trying to publish, and are you zipping the entire source project, or a build
marketplace.
The entire project folder using "Zip Project" in Unreal.
i would just zip the folder outside of ue
see if that works
i zip builds all the time np, idk about folders but it should be fine
ya I normally don't have any issues (Using both in unreal and out) but for some reason I'm getting random save errors on random blueprints.
I uploaded to the marketplace a whillleee ago and remember having to do this. In my case I was uploading it as "add to project" so im pretty sure i had to use the built in zip function to zip up just the folder with the relevant content in it
Save errors? What do they say?
dumb question,
is the project opened twice?
Nope. That was the only solution I could find online as well ๐
but I double checked, just once
Thats the only time i've ever seen that error
Well, If you're trying to zip the whole project, and dont mind doing it outside of the editor, why not just close the editor and zip it
I did, same issue. But seemingly random in which blueprint it does it to. Which is what's so odd haha
Huh? How are you getting that error while zipping if the editor is closed
are you trying to open the project from within the zipped folder?
sorry, I zip it, then unzip it, then run it. Get the error
oh
ok
That is interesting indeed. Usually an error like this pertains to write permissions, or a file being unwritable because its open
gl, wish i could have been more help lol
for some reason, at beginplay i cant add instances in a instances static mesh component
the code is located in a actor component
if i move the code in construction script it works
Are you able to show your code from begin play to the point where you are trying to add instances?
this doesnt work
(calling in actor comp)
this works
(calling from owning actor)
this works
(owning actor)
maybe a actor comp cant do that ?
It may need to wait until the next frame after adding the ISM component to the actor.
didnt work
Put that after the Add Instanced Static Mesh Component.
Is it for sure adding the ISM? Are there any errors in your log at all?
no errors
code is called
i guess i'll give up today and see bck tmrw
im getting tired
if anyone has idea im all ears
Still need help with this! #blueprint message
I was able to do it without any problems. Tested with a placed actor in the level, gave it the component. On Begin Play it added the instance, so I'm not sure what the problem could be. (It flew off because BP_Potato is a physics thing, but that's the cube stuck there in the wall)
maybe its multiplayer related
but its running on server and all is replicated
nothing changes between the begin play of actor and beginplay of AC
ookay its MP related
when removing the switch on authority the mesh is spawned
You'll have a hard time with this purely in shaders. Mostly due to the fact that most shaders on characters are not translucent. Your vision system should have a way to detect if things are in it's cone and if yes set the actor's full visibility to true, and set it to false by default. And then set it to false when leaving the cone.
ok will play with it
Is there a way to have an Exec function with an optional param that uses a default value if you don't pass one in from console?
Like this?
https://www.youtube.com/watch?v=7Q1gqpf2JhU
this is badass
I use masking.
How are you visualizing your field of view right now?
still working on this project?
It's on the back burner but the FOV system is one of my currently in-dev plugins
it's really simple
The best results I've found are to use a render target.
CPU stuff -> draw FOV to render target.
Masked things -> sample render target for opacity
Post process -> sample render target for FOV visualization
here's another version of it, same basic idea though
I want to do this in blueprint:
VectorName.Rotation().Yaw```
However I am not sure what node to use
I am generating a 360 array of ISMs from my character and then clamping that mask in an MF(that uses the ism as a render mask) and using that as a mask in the post process
make rotator node?
will it be free or are you gonna do a tutorial on it?
do you just want an axis value from a rotation?
ah nevermind
Investigate using a render target
you somehow get triangles
then just draw them to render target
and sample that in shaders
You can do all sorts of wild stuff with it, here I was playing with a decay time thing
Yes free, you can look at it as it is right now on Github but I don't think it'll have any of the shader side in it right now
I tried doing a triangles to render traget system.
Yeah you want a render target to be the thing that the triangles get written to for sampling in shaders
So you did it through a visibilty bool on teh enemies?
no
enemy material is masked
opacity comes from pixel world space -> math -> render target sample
can u show the post process code pls
I don't have it right this second but it's the same, post process is just
pixel world space -> math -> render target sample -> tint/darken etc
the keys are the pixel world space coords and the render target sample
if render target is meant to be centered on player position then you'll need a material parameter collection that you feed the player position into
this is what I landed on https://hippowombat.medium.com/tutorial-line-of-sight-visualizer-for-unreal-engine-f32113b1f6f3
exactly
I just skip the ISM part and go directly from traces to triangles
just sample the render target the same way to act as an enemy opacity mask
in BP only this will have very bad performance as the amount of traces gets higher and higher
in C++ several thousand traces is no problem
Ok cheers I will play around with the way i am makign my mask
show your post process material
thats kinda why i went with th ISM. its like a 1 degree slice ISM that I make 360 times
you're still doing a lot of math in BP which is where the slowness is
This is my plugin as-is and this is a video of the traces it does right now. Nowhere near done but it's fast.
https://github.com/AdrielKinnunen/SpectrelightPlugins/tree/main/Plugins/SLVision/Source/SLVision
image 2 and 3 are the mf insides
thats juicy af!
just plug that into opacity for your enemies
The key difference is I used math to distribute the traces at equal end distance isntead of equal angle
like put the mf in the enemy materials?
you don't need many behind you
yes, the absolute world position -> render target -> saturate thing
plug that into opacity for your enemies
that'll output 1 when visible and 0 when not
This exact same setup with the exact same inputs has different results depending on if it's a macro or a function in my widget blueprint.
I copied the same nodes just needed it as a macro because I need the async loading for soft references later on in the code
With the function, it does work as intended and gets me the button that was pressed
with the macro, the "basic button" is also correct, the button array is complete as well and the only problem is, that it somehow gives out equal i.e. the branch is true for always the last button in the array and not the one that was pressed although a print string after the branch would show a different reference for the Basic Button
as a function it does work like I have said with the exact same setup
Holy shit it works!
Thanks you!!! @faint pasture So I guess I can just make a master enemy mat now aye?
same inputs
Oddly, this seems to be a BP limitation. I just tested this out with some cheat manager functions. Using BP, even with a default value set, I can't seem to call the function without inputs. In C++, if I write the same function with default value specified, it runs just fine without needing inputs in the command line.
And for proof, here as well the same nodes for the function that give an entirely different result.
So everything is the same, just one is macro and one is function
and it still doesn't work
@short ivy What is this for?
this is in my widget bp. It's a customization system where you press buttons and thus the character changes clothes
and it works as intended as a function although it is setup the same. The only reason I am trying to do it inside a macro is because I want to use async load asset to not have everything in memory right away and the function didn't support that node
IMO I would just do this off of an event. Button click should set some state about what mesh you're trying to load. Then it can call a separate function that has the async load function. After the Async load function, it'll check if the loaded mesh is the same as the last button press, else ignore it. That way you don't get desyncs in your button press.
functions don't have the async loading node and I am handling this with an On click event of the button basically
Now i put it all just into the event and it doesn't work as well. With the function it does though :/
To be fair, loading the Mesh only when the button is pressed might also be a bit overkill.
It's probably enough to put that AsyncLoad into the Button itself, or before creating it.
But even if you want to do that, it should be enough to just load it in the EventGraph.
Not sure what is wrong:
One thing that is very strange about your setup is the need for the For Loop
I want to get the red arrow to point to where the mouse is pointing, however it rotates on the wrong axis
It should be as simple as this, mostly.
Yeah
It's all a modular setup so the meshes for the buttons are not hard coded. They are given over exposed array variables
Yeah but just give the Button the Mesh
I see okay
And then get the Mesh from the Button
What Authaer showed
That removes finding the Button again
Gonna try that what Authaer showed then
Yeah that looks wrong
What you want to do is to take the result of the "Minus" and call "Make Rot from X" on it, and if you want to only affect the YAW, null Pitch and Roll before setting it on the Arrow.
+- maybe normalizing the result of the Minus first, but not sure that's needed for the Rot From X.
why x?
There's also just the FindLookAtRotation node that'll do all of that for you from two world space points.
the odd part is that I understand the vector math needed and was able get it to work in c++ however blueprint appears to be very confusing
Has to do with the Matrix stuff they actually do
You can open the function in C++ if you are curious
It's the same in C++. You'll get the same from all three of these.
(Target-ActorLocation).GetSafeNormal().Rotation()
quick question, would this work if one of them are Null/None at the time of binding
Define "work".
i.e. i update one of the variables and then it'd delegate or whatever the restarted event from that one
Btw I found the fix. Apparently I had to store the selected mesh in a variable because it gets lost until the async asset is loaded or such idk
No, it only binds to the Instance you pass in. If the Instance is Invalid (null) or a different one later on, the Delegate will not magically bind to the new Instance.
It's your responsibility to Bind and Unbind when that Instance changes.
ah that's what i needed to know, thanks
I can explain that to you
The For Loop does not wait on the Async Node
I would love to know that. I am new to soft references and that honestly was the first time I used it
The For Loop finishes that very frame
The Node might still have something saved in the Pins
Ah I see. But the game kinda memorizes that it had something to finish still and then gets back to it later on?
And when you later call Get on the Array, when the Loading is done, it might grab the last entry
Also check after the completed pin that it's the same picked mesh still. Or you can end up with cases where you click two buttons and end up with the first mesh picked instead of the second one.
Smart. Didn't think of that, thanks
It's mostly how nodes are implemented
They are actual Objects in Code
A lot different than what C++ does
and that's what it always did. Good to know why, thank you!
what is the normalization used for?
Similar issues are when people have like a BeginOverlap Node, and they use the "OtherActor" pin "later"
If something else overlaps in the meantime, that pin changes reference
Whenever you do something latent you gotta save what you were working with
Changes the directional vector from the length of the distance between the two to a length of 1.
Not sure that normalize is needed though, is it?
I questioned myself there earlier already
I will keep that in mind
Just want to point out that your fix only works cause you only expect this to call exactly once. If that loop would be loading multiple entries, it would override the saved variable a bunch of times, and only the last one would be in there
Might not be necessary. Just habit to normalize directional vectors I guess. ๐
This appears to work, the set world rotaiton has a lot of useful entry connections
the zeroing out of the unwated parts is built in sort of
Small note: Try to keep your graphs clean and lines straight. If you double click a line you get re-route nodes too.
Makes it more readable. Future you, people here needing to help you and people working on your project will thank you
And possibly refrain from finding where you live to slap you
Thanks, I actually feel like doing vector math in c++ instead however because the way you can write it appears easier
Yeah, C++ makes this easier mostly due to how easy it is to work with Structs and References
It does work as intended but if you spam buttons then it doesn't actually change the mesh with every button you press. But so far it didn't swap it with a wrong one
no matter how fast I tried to spam different buttons
Yeah cause you aren't gating the buttons from being unavailable until the mesh loaded and set
That's also why I wouldn't do what you are doing
my aim is to create a game prototype, then port the code into c++ from blueprint, because I thought blueprint is easier than c++, however i just learned it can be harder than c++ sometimes
And just load the meshes all for that UI
They will be unloaded despite the selected ones once you close the UI again anyway
for example I spent half an hour trying to get a stupid cast to work:
I got so desperate I just threw random casting nodes into it to see which one works.
I would probably either load the Mesh and save it properly in the Button on Construct. So give the Button the SoftRef, let it load the info and then enable it once it loaded.
Or load all of the meshes and then create the UI, showing a Loading Throbber in teh meantime.
When the buttons are removed there is no reference to the Meshes, despite the ones you set, and they will be cleared again by the GC
the same code in c++ is easier to understand:
void ATank::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (PlayerControllerRef)
{
FHitResult HitResult;
PlayerControllerRef->GetHitResultUnderCursor(
ECollisionChannel::ECC_Visibility,
false,
HitResult);
RotateTurret(HitResult.ImpactPoint);
}
}```
I am already using the common ui and stuff so that this widget only gets activated when actually being the top layer but trying to keep it as optimized as possible. But yea I will change it to one of your suggestions probably
I am going to store the selected meshes in a save game
I get that, we did similar stuff for an RTS like game. But ultimately, the user experience suffers for minimal gain. So many people have 16-32GB of RAM by now. The meshes won't be the reason your game has low FPS
I didn't try it yet, but I assume that would work with replication if the bp is inititally the same but different players selected different meshes
I think an average gpu can handle many polygons
yea true
And you aren't releasing on ass old Xbox consoles anyway
We shipped The Ascent on the older gen, and trust me that thing was not soft reffing the meshes until the button was clicked.
On a side note to this. I strongly recommend making this a little more agnostic. You should use the FocalPoint stuff in AI code. That way your player controlled tank(which would still have an AI controller) and an AI controlled tank both use the same aiming code and just need a target point.
Alright alright, I will load them right away then ๐
But now I know how soft referencing works (at least a bit)
is there a way to rotate the parent/root of this blueprint?
What we use a lot, in case that interests you, are PrimaryDataAssets.
And not just the literal PrimaryDataAsset class, but also just any BP Asset (even BP classes, like Buildings you can build in an RTS).
thats very useful advice thanks, I have not worked with AI yet
Needs a small bit of C++, but then the AssetManager can simply load these on command by asking to load the AssetTag
I know about primary data assets. I did quite some work with mods and stuff
but didn't know they had a use case within these things
We just do "LoadAssets(StructureTag)" and it gives us a list of our BP_Structures that were previously not loaded
Very simplistic case
Or it's PrimaryAssetID or whatever they call that Id/tag thing
Basically just a Category:UniqueID combination.
Structure:Blacksmith
With a bit more C++ you can even expose data to the AssetRegistry that you need available without loading the Asset.
We used that to export a Category so we can sort the Buildings without having to load them and then only load them if the UI for the SubCategory is opened
If you are into optimization in that kind of way, this should be quite interesting for you
Oh this definitely does sound interesting but I am tending towards that it's too overkill for a character customization
Not really.
The root is the root. it's meant to the origin, 0,0,0
I will copy and paste that into my things to learn/try though!
If the mesh is rotated wrong, then either put a nother root above it and rotate the original root then.
Or fix the mesh when exporing/importing in your 3D software
Understood. Thanks
It's generally overkill, until you learn how quickly that is to setup. Takes a few minutes.
You just gotta learn it once and have a bit of C++ knowledge. The C++ part is really just 2-3 lines of code.
Hi everyone, completely new to the server and Unreal 5, just started a couple weeks ago.
I've been trying to do everything from scratch to get a feel for the engine, so I created my own game mode/PC/pawn/level/etc. I'm currently working on a widget interface and I've added a widget switcher and added buttons with an onPressed event to change the active index. However, when I click the buttons after pressing play in the viewport, nothing happens (though if I change the active index myself it updates correctly). I'm not sure what the problem is and was looking for some insight.
I wasn't sure if I needed to manually add mouse clicking functionality? I only have button press inputs right now, so maybe I can't even click anything in the game?
Is that workflow you described a well known one that can be looked up online somewhere or was it developed/discorvered in house?
// Header of your Class
/// Required
virtual FPrimaryAssetId GetPrimaryAssetId() const override;
/// Optional
virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const override;
// Cpp of your Class
/// Required
FPrimaryAssetId ACH_Structure::GetPrimaryAssetId() const
{
// StructureTag is an FGameplayTag that can be set in the BP children. Should be unique.
return FPrimaryAssetId(FPrimaryAssetType(TEXT("Structure")), StructureTag.GetTagName());
}
/// Optional
void ACH_Structure::GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const
{
Super::GetAssetRegistryTags(OutTags);
// Category is an FGameplayTag
OutTags.Add(FAssetRegistryTag(GET_MEMBER_NAME_CHECKED(ACH_Structure, Category), Category.ToString(), FAssetRegistryTag::TT_Alphabetical));
}
Funnily enough, those AssetRegistryTag stuff can even be seen in the AssetAudit in the Editor. Pretty cool stuff.
You can maybe find something, but I think a lot of people who use it don't have the time to write about it.
Me included.
So it's advanced stuff
I guess that can also be used in-game to load places on the map and stuff?
dynamically
Yea, alright gonna try it out. Thank you
You'd need to share your code. Also how did you confirm that pressing actually works beyond the Switcher not working?
possibly set input mode to game and ui
You mean InputMode
or just ui while your using it
yes lol thanks
Setting InputMode from different places can quickly break stuff if those places don't know about each other.
Input mode won't matter for button clicks. Unless they're on GameOnly and have no mouse.
Either use CommonUI to handle this stuff for you.
Or handle the InputMode in a place where all UI is known.
E.g. PlayerController.
But yes, if the InputMode would be Game, the mouse would be gone I guess
It's probably good to see some code and to also ask them to put some print strings in
It's late here so I'm gonna head off
the asset manager insights were really useful even for lurkers like me, thanks and gn!
Well pressing doesn't work, changing the active widget index is the only thing that works for displaying the right tab. I'll link some code real quick
I don't actually have anyhting within the button/checkbox/image its linking to, but it shows the outline which I was just doing to test if it worked correctly
they don't work no matter how many times you click ?
Nope
some print string on the events see if it's firing
nope string isn't printing either
I'm thinking maybe its due to my custom player controller? That I can't actually click anything? What would be a good way to test string print on mouse click, would I do that inside player controller?
Are you actually seeing the button's click visual? The little indent.
this is a good clue for whether or not you have the correct input mode set up
I'm half sure, even if the InputMode is Game, if you get the Mouse in the Editor you could click at least once.
Would start at the widget reflector then.
It shouldn't stop the click to go through
But I would also use the WidgetReflector
And see if you have another widget overlaying
I missed it earlier, but did you have the correct input mode setup?
(lets try adding input mode game+UI and show mouse cursor set to true on playercontroller beginplay to see the difference?)
Input mode won't affect being able to click on buttons at all. Input mode GameOnly will hide the mouse entirely. GameAndUI or UIOnly would show the mouse and neither affects button clickability, they only affect whether or not your inputs get passed to the player controller for inputs through actors.
Hmm how would I go about checking this in the reflector?
Click this Pick Hit-Testable Widgets button.
When hovering your button, normally you'll see it outline in green.
You'll want to do it at runtime to test.
aaah gotcha
If you see the green outline like this, that means something is in front of your button, blocking it.
it does not highlight during runtime
it actually doesn't highlight any of the widget, just outlines the viewport window
You see the SPIEViewport highlighted when hovering the button, like this?
Sounds like button visibility is set to something other than visible.
just checked, they are set to visible. I do not see the SPIEViewport though
Could one of it's hierarchy parents be set to Not Hit-Testable(Self & All Children)?
they are all set to not hit-testable(self) by default, hadn't messed with that setting
Can you switch your pick test to find painted widgets and find the button that way in the hierarchy view?
That should get you something like this.
I'm not entirely sure how to use this reflector, but this is all I'm getting,
Can you expand it a bit and screenshot the visibility list?
Ah, that
This overlay looks like it's a hierarchy parent of the buttons? If it is, this will make them not hit testable as it will affect all children.
This overlay here, that you have selected in this screen is your culprit I'm pretty sure. You'll want to change it's visibility to Self Only
oh motherrrrrr i thought i checked that one too for self
lemme try
you're my hero
it worked
I was stuck on that for far longer than I should have been ๐ฎโ๐จ
It happens. ๐ There's a reason I know where to look for those issues.