#blueprint
1 messages ยท Page 229 of 1
Its a getter and setter in single node
Personally not a fan of this 'style' at all
Wouldn't even call it a style tbqh, just intentionally confusing
me neither, but its good to know, especially after some years of learning UE that this is possible too
well, thanks for clarification!
can I make one of these editor notification appear from a blueprint construction function?
EG. Top and bottom are identical
Right, but what I need in my case is a string check (team == white for example) and a float as output
the execution pins kind of forces me to duplicate code
in c++ this would be 1 inline if
I'm not sure I follow? Why does a team == have a float output? O.o
Ah ๐
still limited though, but for now its enough
problem is I cant make a library function without execution pin right?
maybe with c++?
ah OK I can use the "pure" option, wasnt aware
Select with wildcard is also relatively limited
Wish it just straight up had the same options as switch
Select on gameplaytag โค๏ธ
Looks like itโs something about the canvas slot. But it also looks like youโre reinventing tooltips. Have you tried using the built in functionality first?
So I split it up to try it out. SpecialBuilding is now pretty empty, I created two childs that contain the meshes I need them to. How do I make "other actor" now spawn one of the childs based on a name without linking them and increasing the sizemap of OtherActor again?
SoftClassPtrs. Load it, cast it to the more empty parent class, spawnactor.
Uhm, I don't know what that means ๐ How do I need to adjust this part to achieve what you mean? Or do you have some reference material I could check it (documentaiton or video) to clarify your sentence ๐
Sticking with my earlier classes of the AnimalBase and B_Chicken. Say I want to make a spawner which will randomly spawn some random animal. I have an actor here with an array of B_AnimalBase type as softclass.
Pick one from the array. Load. Cast it back to the parent. Or Actor class, doesn't matter unless you have ExposeOnSpawn properties in the parent. Then spawn it.
And the spawner ends up no bigger than the parent class reference since it softrefs the five child classes.
Hello, I ve been encountering this problem - I have a character created and an animation in blockbench to it, but when i export it as an FBX and put it to UE5, it will somewhy create so many static meshes. Thats why i export it in GLTF everytime, then i put it to Blender and from there export it as an FBX. When i put this FBX into UE5, the model is okay but when i do the same thing with animated FBX (FBX with animations), meshes of the model are broken.
I sent a video but it had to be shortened because of discords upload size limit
Hello, does anyone know why my character gets affected by physics interactions while in air?
I have enabled physics interaction to be false, but for some reason when a physics object hits me while I am dashing into it in air, I receive a speed boost from it
Yay, it worked. Much appreciated!
I'll see how far I'll get on my own with the rework. This is a great help though, cheers!
Hi, I'm not sure if my questions is for this channel, but I have a cube that has sequencer transform animation and an actor that i control that uses impulse to push away objects.
How can I make the impulse affect the object in the sequencer? Right now it doesn't affect it and the cube just follows the keyframed transform animation in the sequencer.
y'all i've tried messing with lighting channels but i can't get my players arm and gun to only self shadow (even using self shadow) and NOT cast a shadow on the ground. i don't particularly wanna do a full body in the fps ๐ฆ Any help?
I'm looking for a plugin or tutorial on changing audio input and output devices in versin 5.4.
There's a few free "menu" plugins/blueprints on the marketplace. I can't remember which ones will give ya that, but i know some will
i have yet to find out that lets me change the device, maybe im searching wrong idk
Very good point. Testing that function out.
Hi there! I have a game that uses the playerโs microphone and Iโm wondering how you can change which audio input device itโs using. I see that you can do this for output devices: Swap Audio Output Device | Unreal Engine Documentation And also that you can get a list of all input devices: Get Available Audio Input Devices | Unreal Engine 5.2 D...
Think you can just call/run the "Set Timer by Event" node again. And do it with a new "Time" interval.
yeah that my "workaround" but just wanted to know if u could minipulate tha ttimer somehow
Huh?
Ah. Yes
Hello, I have a 3D spaceship with aiming, but whenever I rotate the spaceship around, the controls get flipped upside down because the spaceship is now upside down. how do I keep the spaceship always facing up? here is video to demonstrate of my problem: https://www.youtube.com/watch?v=iMc6LA7ogCs https://blueprintue.com/blueprint/hisi5pyt/ I added the pastebin of the code if that helps
anyone have a website where I can paste UE code that someone else can then see ?
rahter then be doing screenshots and trying to fit it all in
is there a way I can share the blueprint for someone else to open without them having to log in to the website ?
you give them the link
but also note that bpUE is barely useable on mobile
screenshots are usually best, if it's for help in this discord anyways
i'm helping someone thats not in this server but also where doing screenshots but just thought if they were able to look around the BP without trying to squint into a screenshot
then yeah bpUE is probably fine
hello,
Does someone know why my AnimNotify here never gets triggered ? I want to reload the weapon based on its animation
Hello, I am making my first multiplayer game and I am stuck at this very simple problem.
This should simply teleport all players (I'm testing with 4 players) to the same location. But when I activate it as Player 1, it teleports me, and player 4 only. Skipping over Player 2 and Player 3. Any idea why?
I'm a bit surprised it teleports anything more than player 4
Hi guys - would this do nothing or set the mesh to none?
You're misunderstanding ForEach loops. It isn't a multiplayer issue.
StartLoop
- Iteration1: RequestDelay
- Iteration2: RequestDelay
- Iteration3: RequestDelay
- Iteration4: RequestDelay
LoopEnd
1 second later
- Delay fires, loop is holding last value so it teleports that one.
Sorry if this is stupid but I'm a little confused. Should I just remove the delay then? I'm still new to the For Each Loop nodes as this is only like my 3rd time ever using them.
should this not call the event ?
does someone have any idea ๐
You have to use the "Set Timer By Event Name" and connect it to the SpawnSling
@trim matrix yeah but i wanna call it 3 times as a "sepereat event"
You either need to delay before getting the actors and looping over them or remove it entirely I would say. That'll solve part of it. But I'm still not sure how you're logically moving two things. This code you have should only move the last one.
cuz i have delays in it and calling it again will breake it
Yea this is the whole Blueprint right now.
The intial teleport at the top is for the player who activated it, and then I would assume the For Each Loop would get each player and teleport them. I know it also would teleport the player who intially called it twice, but thats ok for now.
But for whatever reason its skipping over Player 2 and Player 3 and just only teleporting
Technically you don't need a serverRPC here. The overlap will happen on the server too, you can just add an IsServer check right after the overlap and then call StartGame, and make StartGame not a ServerRPC
If that doesn't work, try moving them after this runs. I have vague memories that there was a client side issue with teleports where sometimes the client doesn't update until it tries moving?
Gotcha, changed that. As far as the client not updating until they move, they didn't seem to work. I really just can't find an issue here so I'm at a standstill.
i draw a path on my character... but i cant replicate this
i make event run on server ....then event multicast... the pat draw only on 1 client -.-
Fixed it by making my own loop... Assuming its just a problem with For Each Loop
Print string on the notify node, see if it get run at all before the cast. Also its very strange that you tied it to player 0 pawn by design.
Should just be the owner of the anim. Try to make things generic whenever you can.
I changed the logic to be in the anim blueprint of my fps character, do you think its better ? I made it working also
You are not required to dump that into the anim bp
You can still use the anim notify class
You need to use montage and have a valid anim bp with a montage slot however.
but in the screenshot here, with a debug on the notify node it was never called
Show if you are playing montage with the notify
Show if you have montage slot in your anim bp
Show if your mesh use the target anim bp
Show the print string result after the anim notify
hum okk, thank you for the tips I will try that
What's default tick rate ?
0.02 is it ?
Just cause I'm helping someone with something and they have it set to 0.0 which I'm sure would be super fast tick rate
It should be 0
You don't really want to change the value without a good reason
Reminder, people that replace tick with timer end up with more damage to them self
0 just mean the tick will run every frame, as it should.
It's very questionable if you want to use tick at this point
If you set it at 1
You use tick for something that needs to be evaluated every frame.
Like movement, physics, or anything that needs to be smooth.
Ohh
getting this error even I dont have function like this any ideas why ? :d
If you click the magnifying icon, what would happend?
Never seen that error, maybe re create the variable again.
thats funny, nothing
its opening nothing
like it does not exists
Repnotify variables have a function automatically created for them that runs whenever the value changes.
find path to location synchronously... why i cant replicate this?
Hey so I'm revisiting my health bar on my player to be neater and I was just messing with it to use interfaces, I have it working in the sense of It will display in the world but I want it just on the players screen like a HUD but when I change it to screen from world it just does not pop up, any ideas?
Am I wrong to use an interface to make a player health bar?
Is this going to potentially get two different items from array?
like will it call next random twice or only once?
I need help with a bit of code that keeps returning Unknown/not Valid
I've tried this patchy way of re-doing this variable until it sticks, but there should be a better way to do this surely:
RandomArrayItem is a pure function, so it'll get called for each connected output (ie: it gets called twice).
Thanks, so I do need to set a variable to hold the value
Yup!
This doesn't help you in the short-term, but I think Epic added support to toggle pure->impure for 5.5. I can't find the post, but someone had mentioned that a while back.
Oh dang, I see, so that is what the Pure means.
if I don't check I get only one print, if I check I get like 4 prints. Got it thanks for the info.
So I am safe if I hide it behind a function and not check pure
Super valid info right there!
Your health bar should be a component.
The usage of interface is actually very minimal (don't look at youtube, look at proper code base like content examples).
Mostly only used as a simple getters and no more than few lines.
Use components for health, stats , attributes, etc.
You can use interface when you need to communicate between classes that does not share the same base class for something not overtly complex.
E.g. teams/faction
Okay, ya gameplaytag nerds - if I have Ancestry.Dwarf, and then I have Ancestry.Dwarf.Hill, Ancestry.Dwarf.Forge, Ancestry.Dwarf.Mountain (etc) - how can I grab all the sub tags under Ancestry.Dwarf in BP?
put them in a container somewhere? that seems like such an ugly option
this is where my enums came in handy, and where people told me enums were vastly outshined by tags, and I can't extrapolate out
oh i might could make it work with switch on gameplay tag
Last time we go over it with delimiter
Where you get an array of strings
You can grab anything you want with the index
Still not sure how enum can be used in this situation.
Hey, I'm trying to play a sound when my character steps on a specific physical surface. I was hoping to pull from a keypair list. Would I use a datatable for that?
key being an enum
@autumn pulsar you can but a Map should suffice. Depending on what you are doing.
If it's just key (enum) value (array of sounds) then a map should be enough
I had to tell it which tags to go looking for, which I fixed with hasanytag and just set it to index 1
Wasn't sure if there was a blueprint implementation of map
There's a variable for map
I ended up just using the construction script to assign stuff to it from a datatable
Is there a way to generically cast to an animation blueprint?
I was wanting to reuse pawn logic at some point and it's a bit annoying to have to have such a specific connection
There is, create a variable, change the type to map
What class need to cast to anim bp? This sound very strange, the anim bp should just read and nothing else should care about it. Your pawn shouldn't need to access anim bp at all.
For the foot steps, just trace down from the foot.
Check the hit physic material, look through the map with the physic material as the key, the value will be an array of sounds.
Just pick a random sound and play it.
anim bp should access its pawn owner not the other way around afaik
Yeah anim bp should read from its owner
If an actor need to reach the anim bp, that is alarming imo.
how do I add cvars like stat fps to automatically run at startup? I can't find a proper answer on Google and ChatGPT's just hallucinating stuff as usual
Just like widgets, their job is to just read, not storing gameplay related values.
gotcha, wasn't really sure what the "proper" way to do things was
that's what I ended up doing
not sure if there's a better way to do this
The way I do it, I trace from the actual foot
That way I can spawn special effects too according to the physical material
Like dust for wood, or water splash for puddle of water
Yeah I might end up doing it, just need to figure out a good way to figure out which foot it is. I guess just make a seperate event per foot
maybe at some point I can implement actual combat, but for now I'm just goofing around
Is there a way to cull triangles per bone?
I was trying to make a full body first person, and I was wanting to see if I could cull the arms without making a whole new mesh to manage
as well as the head
For path of least resistance just make a duplicate of the mesh in your 3d program and delete the polygons you don't want manually.
So you will have a fps mesh and a tps mesh
yeah was afraid of that lol
man, making a first third person camera system is awful lol
do you need multiple input actions to have separate pressed and released triggers?
Is there a way to edit the functionality of the Jump function? or do I need to edit the CPP code?
What exactly do you want to do?
The settings are located in character movement comp
Was wanting to add a forward velocity to the jump
ended up just doing this which seems to work
I would use the cmc settings before falling back to something like that.
it didn't have anything
only upwards velocity, not lateral. So I just take the velocity and add my lateral to it then put it back
kind of wish the jump function was exposed, it feels bad to use
need that goldsrc airstrafe
Is there a way to get the total distance a "Simple move to location" node will take based on actor current location and end location before it fires? (with blueprints)
subtract start vector from end vector, get vector length of the result, then run it through an absolute node
that would work if it would take a strait path, but if its a maze for example...
oh I see, you mean the length of the path it takes to get there?
yep, thats what im trying to find out if you can calculate that, but i dont think you can
at least with nodes
Maybe im wrong though
it probably calculates it when determining it, but I don't know if it gets exposed
might be something you need to drop down to C++ for
Alright, last question is, is there a more efficient way to do this :
probably something you could do in a for each loop on an array
then just make your variables into fixed arrays
Use an enumerator or gameplay tags instead of individual booleans and then you can select on them instead of switching
yeah making an enum would be good too if you plan to constantly reference them
Currently trying to make a behavior tree where a selector is decided by a random integer (this example the integer is 1 or 2) but my code only works when I set the default value of the integer in blackboard to be a valid integer, after that initial run of the code where it always outputs that value, the randomization works perfectly fine after. When I have the default value of that integer set to 0 in the blackboard, the code following that decision on the tree fails. Ideally, I want to be able to change the integer to whatever I want and not have to worry about what default value I plug in
Not at my computer right now but if it helps I am using a service in the selector to randomize the blackboard int value
Are you using random integer in range?
Wouldnt you set the default value to one that you would use?
the default I dont want to use, otherwise the default will always play
like for example if i set default to 1, it will always do the 1 behavior before starting randomization
I'll post the code when I am able to get back to my computer tomorrow, idk if this is a simple/common problem lmao
Yeah seeing the code might help a tad ๐
You can afaik
๐ฎ
Im using a node that check if the path is reachable at all
At work tho, so can't check.
Probably want to look at EQS or navmesh
I was able to made a code that can check if its reachable with a simple move to, but I have no idea how to go about calculating path it will take and get length
TYVM!
what happens if you use random int in range and the number is higher than the total pin outputs? Does it break or auto select the highest pin?
i mean, easy is relative. Its not the hardest thing in the world but I'm putting together a pretty crazy equiation and there isnt really a place to just shove it in, so I thought I would ask. I guess I could just assign a debug key
๐คท
I mean like use a smaller example (range & pins)
the smaller example would be a key for debugging which i'm about to try
I have a pretty unconventional setup so its sort of a pain in the ass for me to test ๐
but from the looks of it I'm assuming it breaks. which is fine I guess because I can just set a condition for when it goes over
total pin output? huh
im unsure what this means
are you talking about using it in a select node?
siwtch on int node
it goes to default
i tested and it seems like it breaks
oh shit
thats super useful and makes sense
thanks!
then you just push a print string
"I was out of range [value]"
this goes for all switches
yea that totally makes sense as to why the default option is there. not sure why I didnt think of it. I appreciate the info!
just make sure you put in enough info so you know where to find it
handy when prototyping
yea, your answer made sense and was what I was looking for. Very appreciated!
is this error suggesting there is no index 1 in the array, and that's why it's mad
That's not what the error suggest.
I mean yes, there is no index 1
In an array with 1 length
The error msg is correct
@copper chasm what's the index of the first element of an array?
0
ohhhh
length 1 implies it's only got element 0, right right
i just sat down this morning, i haven't had even a sip of coffee D:
Implies it only have 1 item, so yes index 0
If you need the last index, instead of length - 1 you can drag from the array and type last index.
was pruned because its Exec pin is not connected, the connected value is not available and will instead be read as default
I don't know how blueprint works so what does this means??
I made a static get function and called it in animation blueprint
I don't have a start or end pin nodes to connect to!!!
That's not gonna work, function goes to anin graph, not your state machines
How can I access a static variable in a class here then! is there a way to get one without a pin? like Locomotion State which is a local variable?
at least non-pure ones. but yes, save your variable in the event graph and read value here
What static variable?
C++
Does this look correct-ish? I have a gameplay tag container with all the tags I need to convert to text, I pull that text and add it to an array, I then make an array of all the buttons I need to update, and match up each button in the button array with the text in the text array
UFUNCTION(BlueprintCallable)
static const FName& GetJump() { return Jump; }```
Static = from singleton?
Not sure how that would be any use in the context of anim instance
You normally should just read properties from its owner
Which is an instance
i'm using it as global variable
I've made a BP that updates values in a data table then saves the table, it's for an editor thing not for game play, sometimes when I save then close and reopen the editor the changes are gone? any one know why?
an alternative to enumeration
I don't see how
If it's some editor utility stuff, you'll probably need to create a transaction when modifying the table, dirty it and save the asset when done.
I'll give that a try, this whole thing i've built is going to drive me mental I want to just throw it out a window lol
I've never done editor utility for datatables, but for other stuff these solved any issues of modifications not getting saved
what does transact do?
huh that's neat
thanks
I was wondering if its something like that like it's not marking it dirty/saving properly I have a function here that checks it out an saves but i'll add that too it and see if that helps ๐
let me know how it goes and if it solved the issue c:
@daring merlin Seem's to work thanks so much! I have to redesign this whole damn tool eventually but i'll keep patching it together for now ๐ ๐
Awesome c: Good luck!
I fear I'm overcomplicating setting button text ๐ stupid ui
I found a fix, to get rid of the pins make it a BlueprintPure function instead of callable! i just learned about the difference
Anim blueprint job is to read from its owner. It sound like a code smell that you are not reading from an instance
Probably want to ask others if what you are doing is okay
I need a single global variable that can be use as enum
any way i just thought to share a fix incase anyone had similar issue
I'd say it really just depends on what is in that "get jump" function - you probably won't run into any issues making that specific function pure, but it isn't a practice I'd say you should lean on too heavily
So I also have an actor that has 7 different "types" I currently do this by setting the static mesh and the material of that mesh to one of the types (but this makes the sizemap obviously pretty big because of 7 meshes and 7 materials. Should I create a parent, 7 childs and then handle it the same as this one instead?
I will get 2 things, first I rarely use blueprint, so my animation code is in C++, so I can use the global variable directly to set specific locomotion, as if I am using Enum, second I can the same names in state tree, then let the state tree define the current animation
hi, how can i fix this camera clipping? using the 3rd person template
making progress (I hate it)
I am unsure why it's not putting each text in the text array on its own button, but that's probably just a coffee issue
Do you use all of those types consistently with each other? If yes, then it's probably not worth the effort cause they'll be loaded anyhow. If not, then probably just make children with their specific settings and load/spawn them as needed.
what glaring issue am i not seeing in this code? Do I need to match the indicies of the text array to the buttons array?
I literally just did something similar with pictures, I'm not sure what I'm missing
something know "find path to location synchronously"???
Not sure what it's supposed to do but it seems kinda of non sensical with how it loops through the Buttons Array, it assigns every button with every input, then the one you will see is just the last input? ๐คทโโ๏ธ
Iโm trying to assign each individual index in the text array to its own text widget on each individual button array ๐ญ
I donโt have time for my second cup of coffee, I thought I could do this before my dr appointment but apparently I woke up bereft of any knowledge of for each loops
The second for each loop isn't needed, get element from array using the array index of the first loop.
How will it know which button to set the text to?
Using the array index from the first, Nevermind ๐
Coffee coffee, dingle dingle
i love how right in front of my face these solutions are, thanks @fiery moon @dark drum
now i just have to go back and refactor it to only make the number of buttons I need for the elements in the text array so it's not ugly
Can anyone help me with getting a SceneCapture2D to line up with my player camera?
Currently this is generating the SceneCapture on BeginPlay using the camera's FOV and attaching it to the camera component, and it's generating a Render Target with the exact dimensions of the Viewport.
It almost works, but as you can see the further away objects are from the camera, the more they end up slightly different in each, and so the UI widgets don't line up for the Render Target.
looks like it is off the same amount as the white border
I'm getting to a point where I need to think about localization soon (probably should have done it early if I had experience)
As far as I can tell there are 2 options:
- Open the localization tool and "gather text" from folders I specify (with other options for gathering too).
- Create a string table, and create Keys with associated text everywhere that I write some text.
Is this correctly understood and are the two mutually exclusive (or used so for practicality)?
And is one better than the other depending on purpose?
I have very minimal dialogue or longer texts. But I have a lot of stats used again and again, just with different numbers. (Like: Increase damage by 5%, Increase damage by 7%)
I also import text from a Google sheets for a bunch of stat explanations etc.
I would like to export a sheet or something with all the text I need translated so I can hire someone for that in the end.
What would a good approach be? ๐
Hi, how can I hide or filtering after adding child widget from data struct value. If I click button A I want all red color hided/unhided button B hide/unhide color yellow etc.
Unfortunately that's not fixed it. Would have been brilliant if it had!
It looks like you're scene capture is a little forward compared to the camera. Perhaps it needs moving back slightly.
Well, the issues I'm facing are still there and I still have no idea what to do. Currently :
I need to have a laser to interact ONLY with a specific blueprint, currently it interacts with everything that has a collision
I need to make that pressing a button on the controller ONLY while grabbing an object makes a specific sound
Yes I watched the Blueprint Communication video and no I'm not looking for anyone to make the code for me. But rn the video didn't help and I simply don't know what to do now, so I can't do much except just aksing what should I do now.
Looks like find path fails, so replicate it by trying to find a path to invalid location maybe?
You absolute genius! It's ever-so-slightly imperfect but barely noticeable now!
It will bug me that I've got a magic number I can't account for, but adding a relative offset of -50 in the view direction after snapping the scene capture to the camera component has fixed it.
Maybe it's a difference between the view location and the world camera location?
Am I correct in assuming that this explosion will clean itself up, in-game as well as in memory? (I read somewhere that destroyed assets will go to garbagecollection)
First time poster- apologies but thereโs no section for struct/data. I donโt suppose any of you know of any resources for creating a league table that stores wins, losses, draws etc ?
So far Iโve set up a struct_league that holds-
Season ID
Team name
Games played
Wins
Draws
Losses
Goals for
Goals against
Goal difference
Points
Then I have 2 data tables set up that use this struct
Data_leagueA
Data_leagueB
I have a widget blueprint that calls up a single row that binds to each column (e.g struct break assign games played to column 1, team name to column 2 etc)
Then I have a league widget blueprint and Iโve assigned the user created row 10 times and binding each cell individually. Seems to be calling up the info but I have no way of then sorting the rows by points, gd, gf etc
Plus having to do that for every single league seems very time consuming ๐
(The season ID idea was so when I do a fixture list I could randomise team id vs team id for each game week)
Iโve just got a very sus feeling thatโs not the best way to do it ๐
hi all, i struggle a little with the Inventory System. I used this as a base: https://forums.unrealengine.com/t/tutorial-simple-inventory-system/1316560 but i cant figure out how to switch the weapons and keep the Inventory the same. Right now im removing the slot in the UI_Itemslot but if i remove the code the item keeps stacking what not should happen -> Here u can finde the code didnt want to use a screenshot bc of readability^^' https://blueprintue.com/blueprint/4t1batgz/
Hello and welcome to my Inventory system tutorial. This guide will walk you through the steps on how to make a simple Inventory system. I will split this tutorial in 2 different guides: super Simple System and a bit more Complex System. Letโs start! I will use UE 5.2, Third Person template. Part 1. Simple System. Step 1. Preparation. Firs...
Is there a way to increase the size of collision box without it snapping. i turned off "Object Snapping" but it still keeps spanning.
First question would be, why does this go in datatables?
Would that not be the best way to hold the data such as teams, wins, losses goals etc ?
Datatables and DataAssets are static. You aren't meant to change them as the game goes on.
Youโd just update your struct as time goes on, no?
My bad, shouldโve mentioned itโs a single player FIFA/PES style table Iโm looking for
Would that be possible to update for each team individually via the struct ?
Has anyone who worked in VR figured out how to do "grab and pull" locomotion? It is like climbing but you grab 'mid air' and pull toward it.
Is there a code that deletes the intersecting parts of the lights so that the lights are more optimized. when I enter the light complexty, my screen is painted white
Hello I want to implement a function for my quest log that allows the player to select their active quest in the quest log. The active quest should be visible through a checkbox. However, as soon as the player selects another quest, the checkbox for the previous quest should be unchecked. How can I do that? Itยดs within a widget.
Realistically, you need keys. You should have a few structs.
LeagueData
- Array of TeamData
TeamData
- Array of TeamStat
TeamStat
- Key
- Value
LeagueData saves with two entries of TeamData.
Each TeamData just houses an array of it's stats.
In one widget you iterate over LeagueData to display the Teams and pass in the TeamData for it to display.
Second widget that takes in TeamData iterates over it's array of TeamStats and creates a widget or places a new stat in the grid via it's key and value.
Maybe also a key in Team and League data, to look them back up easily or name. them too. ๐คทโโ๏ธ
Massive help that thank you ! Think Iโve got some learning of arrays to catch up on ! Cheers guys
So that also means that for example if I have two actors that are always in the level I could just hard reference eachother because they are loaded anyway? I'm trying to understand where I need soft references and stuff. Additionally are interfaces also a tool to reduce sizemaps? ๐ค
So, I've seen that if you put a user parameter for the color, you can then get to change a niagara vfx in BP using SetNiagaraVariable, but atm all I have is the color from the user parameter, it doesn't change afterward although the variables are recognized.
I ain't too sure if it's something in the BP or if it's just directly the user parameter (gave it white, red color or just no color at all but nothing so far).
Yes, if the two actors would always be loaded a hard ref wouldn't be an issue. This goes for anything referencing something that would always be loaded. It can however be good to reduce an actors dependancy on other actors where possible though.
It is possible to use interfaces to reduce the size map but it's not their intended purpose. Adding to that, you can actually make things worse if you do so incorrectly. Be careful not to over use interfaces as they can become a pain to work with as you're project gets bigger.
I have an array of 9 buttons that I set the text on via an array, and I'm trying to hide the buttons that don't have any text to set. Should I scrap the button array and just create a button for each index of the text array? I think that might be easier in the long run than trying to hide the buttons that already exist
My only concern with creating the buttons as needed is destroying them, as the player can go back and forth and if they change to another ancestry (which will load a new set of text in the array) I'll have to destroy all the previous buttons and re-create however many need to exist
I answered my own question, creating the buttons on click was infinitely easier to make them, now I've just got to destroy them in between iterations
Can anyone whoโs got free time help my team with BPs? Dm me
You could just post your issue here.
Hello Sourcers... I need help with an Advanced Camera component I'm creating. How do I refer to the Cameras and CameraBoom in the Player's CharacterBP itself so that the character can connect to a custom event within the component? This is how I set the component up so far
All the solutions I've tried failed, getting errors like this.
The error messages don't seem to be related to what you've shown above.
It's related to the attempts I made within the component
The BP itself compiled with no error but still doesn't communicate with the player's character
'Player Character Ref' and 'Character Ref' are different. You set 'Character Ref' on begin play but use 'Player Character Ref'.
I've tried but still failed, tried several solutions
Are these nodes made to override the already existing color for a niagara system ?
Start by using the correct variable and then share any new error messages.
Is there a reason this isn't just deleting all of the widgets that were added to the vertical box named "button box"
I'm calling that before I call the code that will create more children - the children are created and slot underneath the previous children, which should be destroyed by the above
and Idk why it isn't destroying them
cast them back before removal maybe? that doesn't feel necessary but will try
yeah not only does it not work, it shuffles them up somehow - maybe it's generating them again after the removal?
how is it possible that actors that are spawned at runtime (ai character plus ai controller) remain in the level after ending PIE session?
as i understand it, that seems to be some chtulhu level bug?
Is it possible to get a name/string/current enum ect. from a structure variable on the actor with a line trace?
u mean object name? thats an actor function so just print that?
otherwise either hard card or get via an interface if hard cast isnt acceptable
Split the struct pin on the output, and then drag out the name/whatever variable from the struct
How do I change the color of a vfx in a blueprint ? What I tried before isn't currently working.
Tried both solutions. Still getting failed communication errors.
When sending error messages it should be as you have it setup. Those error messages could be because you don't have the actor ref from the cast to the set ref node. ๐คท
Put it back to how it was when I first responded and make the fix I recommend. If it still errors, show the errors at that point. Otherwise we'll get nowhere with helping you resolve it.
No not the object name, a name from a structure
Then I guess I'm not getting what I'm supposed to do. All the connections I'm trying to do at that point are all failing
How do I return that on a line trace?
offhand, whatever you're hitting with the trace, you should be able to pull the structure variable off of the hit actor? or something
Not seeing it
You've not yet shown it setup correctly (without obvious mistakes) with corresponding errors messages.
Where's the structure? On the hit actor?
Yes
Make sure the variable you set after the cast and the variable you're using to call functions are the same variable, that was the glaring problem with your first set of screenshots
Cast to actor type (using hit actor as target) and get it.
baby steps - I figured out that my "Button Box" (Vertical Box variable) is not storing the children when I create them this way, so the "Remove From Parent" has nothing to go on. Unfortunately, I'm not sure how this information helps me
Ty, not exactly what I was looking for but I can use this
This is what was giving me no errors... errors started when trying to find a solution to make those connections work. I really don't understand why it does work on Capsule, Mesh and Movement Component but not those related to the Camera {like shown in this screenshot}. Doesn't make any sense to me.
The problem is I'm not managing to connect/make accessible those variables
Maybe try to get player character instead of owner? (no idea if it will work for you)
I really wish there was an example somewhere I could look at, to find out what to exactly I'm supposed to do but haven't found any. Custom component something I've been struggling since I started using them a couple of years ago.
Using simple capsul collision component is more efficiecn than using static mesh even if it has simple colision set?
what do you mea invalid location?
That was the first thing I've tried but gives me that Note and the errors
whats the note say
that's might not working if you're making a multiplayer game
Camera boom isn't on 'character' which is why it doesn't work. That's specific to the third person character.
Try casting to the character blueprint that you want
So if @gentle parcel just dragged the node without the cast to the boom one, it should work?
No, he'll need to cast to the third person character.
oh, I assumed the player character WAS the third person character, I'll keep my nose out of it ๐
why isn't my vertical box showing its children when I set a breakpoint?
I hate that I keep running into these very basic level roadblocks, it's so silly
I guess I should have made clear my intentions behind making a component like this. I don't want to cast to a specific player's character because I don't want to modify the component each time I need to use it of a different CharacterBP. Else wouldn't have any reason why making the component. The point of making a component was for me to edit the component only when adding features, not each time I use a different CharacterBP with a different name, which would break the component.
you should be using a base character, any different characters u make should be a child of that base character, that way when u ref ur base character it will still work with like basecharacterV3 for example
I WASN'T CLEARING THE TEXT ARRAY BEFORE PUTTING NEW THINGS IN THE TEXT ARRAY IT HAD NOTHING TO DO WITH THE BUTTONS ๐ญ ๐ค
Is there any reason I wouldn't want to call garbage collection at the end of clearing the buttons and the array?
I realize eventually it will run, but when troubleshooting I was checking the number of widgets on tick and they don't go away very fast if someone is jumping back and forth a lot, can get really high
You probably want to look at using the 'Get Component by Class' node. This allows you to get a component (if it exists) from the target.
In BP you shouldn't normally need to manually call GC. Unless you know what you're doing, it's best to leave UE to handle it when it feels is best.
In those use cases it's best looking at reusing widgets instead of creating new ones.
I was racking up ~100 widgets and only showing 5-9 on screen at a time, sometimes duplicating ones I had cleared
Right now I'm dynamically generating sub-race buttons based on character race selection, to future proof down the line when I add more playable races, if I was reusing the widgets I'd have to create each panel as I add, no?
In a multiplayer game I'm trying to check if a missile hits any player's blade. I have an array of all classes that are a blade. Is there a way for me to "GET ALL"? Or do I need to for each loop? If I for each... how would I do that?
How does the UI currently look with the buttons?
Have all blades extend from a base 'Blade' class and just check if the class is a child of that class.
So you click the race, and then click heritage, and it lists all the heritages for that race - if you go back to ancestry and pick a different one, it clears the vertical box with the heritages listed, and generates a new one from a DT
So if you keep clicking back and forth, without the garbage collection at the end of clearing the box, the widgets just hang out for idk how long
why not use a diff widget altogether
You can set the widgets to collapsed so they're not visible and take up no space. When you need to readd some, just update the button and set it's visibility back to visible. If there's not enough buttons, create a new one.
I was trying that originally, I had set up 9 buttons (the max number of possible heritages) but I couldn't figure out assigning the buttons
I realize that sounds silly from where I'm at
I couldn't figure out how to get the max number of heritages and hide all buttons after that index in the button array
If I had a widget for each ancestry's heritages, I'd need to go back and make a new subwidget each time I added a new race, no?
This way, once I add to the DT, it will just grab the text from the tags and make the buttons on the fly
Sub widget for what? The buttons?
That's what I'm assuming you mean? Like, in the heritage panel widget with the buttons, just have 9 blank buttons and change the text?
Yea.
Give me a second to set something up, because if you would humor me with a question on THAT end, I don't know how to hide only the ones that don't have content
Okay, so I set it up so there are 9 buttons, on heritage call it fills in with what it's given from the array
how would I make those TEMPTEXT buttons collapsed based on the size of the array?
That's where I got hung up this morning and just said screw it, I'll delete and recreate as needed
I figure this is for character creation, there won't be much else going on during this time, it's not going to bog anything down
whats the problem with how u have it set up now?
I don't know, they just said don't do it that way ๐
I reckon it's a learning opportunity, if nothing else
i cant understand why u would want to use blank buttons, id think looping through the list then creating a button for each one would be good, thats how im currently doing my crafting systems UI and it works just fine
I mean I'll likely end up leaving it, since it works and the other way doesn't, but if there's some valid array-comparison-wizardry to be learned here I'm all for it
same here, if im missing something i deff wanna know but it just seems like more of a headache, especially when u want to add another race or something
removing / collapsing buttons should be easy
for each button -> GetHeritage -> !IsValid -> Collapse
Iโm mad at how easy that is and how hard I was making it
Is there any reason Iโd want to collapse as opposed to delete?
I'd say meh
Wonโt need to garbage collect if I collapse them, but they wonโt exist if I donโt need them, I reckon itโs a horse a piece
Like most things, Iโm finding out
9 buttons is nothing to worry about at all
they only exist while the widget exist
and if the widget's lifetime is game wide, then the buttons deserve to aswell ๐
hello, can someone help me for this little code ? This a code from my BP_SMG wich represent a weapon in my game. It inherits from the BP_Weapon parent class. When the player is shooting I call the Fire event from an interface BPI_Fire. But I am stuck when playing the arms animation when firing the weapon. How can I have a reference to my Arms skeletal mesh on wich the animation should be played ?
Before doing this, I had the code in my Character BP but I had to make an Enum Switch on the current Weapon name each time the player is shooting to get the correct animation and I think its not good practice, thats why I am trying to move it into the Weapon Blueprint.
Thank you !!
the right part of the code is for the recoil management
ok so I think I already got it working, I've found this conversion from "target" to "FPS Arms" wich is my SM, is it how I should do it ? found it by pure hasard tbh
Yea, not great to use casting after using an interface, kinda ruins the point of using an interface.
You could modify your interface to pass along a reference to the skeletal mesh and when you call the interface you'd pass in the skeletal mesh, or alternatively from your Get Player Pawn you use "Get Components With Tag" so it can try to retrieve it itself and then make sure you put a tag on the mesh you want to use.
oh yes you're right. I also tought of setting a variable reference to my character BP and set it in the begin play, but I think its better to add an input in my interface
why i cant replicate "find path to location synchronously"... why the replikation didtn work for it?
I've got a gameplay tag with a space in it, and I'm trying to convert to a name to look it up in a DataTable, would I be better off just putting a dash or period in the tag
you'd suffer less pain, yes
an ounce of prevention, I suppose
I can always do some format-magic to take the dash out or something
I have an object moving, a missile. I have it rebound in the opposite direction when it hits something - I want to Add Impulse to that object... what do I do? I assume I check velocity change but where do I add the impulse? It could be going in any direction. I "get" what from the object.
oh my god I cant believe it works, took me nearly a dang week
I did run into a snag where I can't reference the buttons until they exist, so I'm having to ponder my way through that
How can I Add Impulse to an object that has Physics turn off?
I want to permanently increase the speed of a moving object whose physics is turned off.
Manually calculate it I reckon
What is the space for? Why would you care if there's a space there?
because I'm converting the tag to a fname for DT row matching
I mean the tag itself though. Why can't the space just be removed? InFavorOfThisInstead
NewVelocity = OldVelocity + Impulse / Mass
now if you actually want to hook into the physics interface such that it'll let you call Add Impulse on it that's a different matter
Oh, because some tags are proper noun sorts and have a space in them
and I'm using the same code that makes the fnames to also make text that goes in the UI
Localization is going to eat you alive later.
bold of you to assume I'll have to worry about localization, but I appreciate the vote of confidence ๐
The tag should just be a key. Treated like a named number basically. The name is just for you as a dev to clarify things. You can use the tag to look up a name to display via a datatable or map somewhere. ๐ Same as you're doing in the table you're already using pretty much.
That way you can link that to a real FText value that gets localized. So it'll display in any language.
Sorry I'm daft. Is this correct? How do I add a float to this or am I doing it wrong?
I was told using tags would allow me to do essentially what I am doing, thus bypassing the need to hook everything into a map ๐ฆ
I mean, could I not just insert a variable in here for localization purposes?
Add Impulse won't work here
Eh. Not sure who said that but they also haven't dealt with localization. But as a UI specialist, I can tell you they're wrong. ๐
But you already have a data set there for the tag. You're pulling an icon and info text. Just put the name/title there too and pull it same as the other two things and you're good.
An impulse is a vector
Velocity = Velocity + Impulse / Mass
I made a whole (3 function) blueprint library to convert the tags to names and the names to text D:
what a waste of effort
yeah u should have the name in the DT
Has anyone faced different values for input when PIE vs Standalone? Iโm using add yaw rotation and the sensitivity is a lot smoother in pie than standalone
Haha, it happens. ๐ But yeah, Tags are just FNames. And FNames are just Dev named integers. So essentially a GameplayTag is just a specially named number to use for comparison. Allows you to make lists of keys to data without making them specifically numbers like old games do. You know like they have the cheats SpawnItem 417
What kind of input? Only thought there is framerate difference.
Iโm wondering if thereโs any enhanced input setting to equalize pie standalone sensitivity or will I have to make a if standalone for the value
You shouldn't be doing that. Can you show the input code and what you're doing with it?
sure, but it's very basic standard tps character bp
basically this
Pie Yaw Sensitivity is Fine but Standalone really bad
Would I calculate direction so I know what to add impulse to (x, y, or z)? Because I want to add impulse to the current direction of the object.
Keyboard or mouse input? And is Standalone rotating faster?
both keyborad and yes, standalone is waaay faster
Probably for the best to start over anyway, I hit another snag trying to do another button layer lol
Your X needs to be framerate limited. Cause it's a keyboard input and it'll be 0 or 1. In PIE you get a certain amount of frames. Say 60 a second. That means 60 degrees a second. In STandalone you probably get more, lets assume 120. So you move at 120 degrees per second.
I recall there was a modifier for this in EI? If not it's as simple as multiplying the X by delta time and then multiplying it by a sensitivity setting.
Question: im trying to enter a "ragdoll state" with my first person character by setting the capsule component to simulate physics at the press of a button, but it doesn't seem to actually do anything. Whats the correct way to achieve this?
nevermind, figured it out immediately lmao
hmmm interesting, I'm searching about that over EI, didnt want to mess with replication using deltatime, but I'll give it a try, thanks for the tips
Direction would be a vector.
Impulse = Object.Direction * SomeFloat
That would say how much velocity to add.
Say you wanted to go 100 units/second faster in the direction you're facing:
Velocity = Velocity + Thing.ForwardVector * 100
Gamedev is a bunch of brickwalls closing in on you
delta time multiply worked out, thank you!
I'm running out of clever names for these projects, but the good news is I keep cleaning up the code a little bit at a time as I transfer it from one dead-end to the next
I'm saving up money for some synty packs so I don't have to color cubes to represent different ancestries anyway, I better not get too far ahead to where I need those assets ๐
I'm doing the Barenaked Ladies discography as project titles
Is there anyway to do this without physics enabled? If I have physics enabled I have to turn off collision. (You absolutely rule for tolerating this!)
Hey so im using an interface to display a health bar widget, I want this to work like any other game HUD for health would but it seems its in the world attached the the player rather than part of there screen how might I fix this? (atm its only visable when looking down)
I have this mechanic where I can simulate the physics of the capsule component of my first person character, but the camera sort of stays facing straight forward. How can I get the camera to rotate with the capsule when its in this state?
Ark: Survival Evolved still has ShooterGame.exe. Which is the original Lyra. So I don't think you have to care until release. ๐
I may have it - I set up a collision volume
And honestly, renaming projects is easy. Just a few lines to replace if you really care about the executable name.
to this day i still have core redirects from renaming my project months ago...
and i'm sure smth will break if i remove them
AFAIK the modules don't matter. It's mostly the UPROJECT and such. So you shouldn't really need to do redirects?
I always rename my primary module anyhow. I hate it being the same as the project name. At the very least I usually add Gameplay to it.
If you save everything referencing the redirect, and then remove it, it should be fine.
Shouldโข๏ธ
Source control. ๐
yea, just save everything ๐
there's even a commandlet which is supposed to do that, but it failed me
Like everything in Unreal, it's just a pathname. So if the thing referencing it is updated to the new one instead of the redirector, the redirector isn't needed anymore.
Hi, I'm trying to sort out my interaction system properly, I need to make it so it selects one actor that the player can interact with when the conditions of interaction are met (overlapping and facing the actor) so they can never interact with more than one actor at a time, is this the correct way to do it?
Step 1: Confirm you can change the velocity of the thing, whatever that means.
Step 2: Do the math I showed and change the velocity that way.
Step 3: ???
Step 4: Profit.
Looks good enough at first glance
That should probably be a function though, call it ChooseActorToInteractWith or whatever
Then BestActorToInteractWith can just be a local variable and not pollute the global space of the actor.
if I have my health bar added as a component how might I make that display on the players screen rather than being connected to my body
WHERE do you want it to be on the players screen?
Should it have anything to do at all with where the player's pawn is in the world or just be in the screen like a HUD
Maybe I set it up wrong, but it displays in the world based on pawns postion, I want it like a Screen hud like you said at the bottem of the screen
ok so what you have is a Widget Component which displays a Widget somewhere in the world
you need to instead put that same healthbar widget inside another one (to represent the whole screen)
hmm, sorry how might I go about that?
I can change velocity. Here is where I change it (I checked with a breakpoint). But I can't use Add Impulse unless I turn on 'simulate physics'. I don't want to do that because I want the missile to move back and forth rather than bouncing around. I simulate physics and it bounces. I don't know if this is possible. I might need to use a spline and conform to that? For now, I'm just not going to increase velocity.
Don't use add impulse
just do the math yourself
Add Impulse is a property of physics
This is the math. Instead of calling AddImpulse, just do this
Event ThingHappened -> Velocity = Velocity + Direction * SomeNumber -> ??? -> Profit
so do I delete the Healthbar widget component I made?
Yes but keep the widget blueprint
a widget component is just a container for a widget
then use this?
you made a healthbar widget
That will do something for sure
but you presumably don't want your stamina bar to fill your entire screen I'm guessing
I have the canvas set up already
Sure if it works it works
a better setup would be to have some canvas that represents your entire screen, which you would put a hp bar and a stamina bar and a score counter and whatever else inside of
You'd just make a WBP_MyProgressBar and your WBP_EntireScreen would contain multiple of those and other things
thats what im working towards atm, I had this all working but I wanted it cleaner, plus if I set max health to 90 the hp bar would not be full
which I assumed this would help fix that bc
Looks like it works thanks, I figured it was simple like that lol
your progress bar should probably be set up to just be fed a number and maxnumber, rely on whatever owns it to feed it the right numbers
the WBC meant to represent your entire HUD can do the binding to make sure ProgressBar1 gets Stamina and MaxStamina and is yellow, and ProgressBar2 gets HP and MaxHP and is green, etc
its working how I wanted now
ah alright
Nice one, is Current Interactable Actor alright being set on tick like that? I also need to get it to display/hide the interaction widget but ideally I need it in a way where its only updating the widgets based on changes to Current Interactable Actor, not every tick so displaying and hiding widgets is only called when the player meets/no longer meets interaction conditions, do you know how i can go about that at all? or a different way?
Sure but maybe throw it on a timer
Tick/Timer -> Function -> if CurrentlySelectedThing != FunctionOutput -> set CurrentlySelectedThing = FunctionOutput -> update display
I think I know my problem. Maybe.
It stays at 700, never increasing.
that math aint mathing
when this is triggered, what do you want to have happen?
Each time it is deflected I want the velocity to increase by some amount.
by how much
let's say 50 units.
so where's the 50 in your math?
In that, I should be multiplying it by 2, right?
no
add 50 x Forward
If you want "When this happens, I want it to reverse directon and be going 50 faster"
then it'd be like
Velocity = (Velocity + 50 x ForwardDirection) * -1
I tried adding +50 to the velocity as both an integer and float.
I also tried this
You need to multiply it by -1, not subtract -1.
DUH
But the first one. Even if multiply it by -1 (which will reverse it), the velocity coming out of the addition (velocity + 50) is still returning 50, -300, 50. Is that offset by multiplying it by the forward vector? [trying in a few]
all 3 of your math nodes have the right numbers and the wrong operations
forward TIMES 50
velocity PLUS forward times 50
ENTIRE THING TIMES NEGATIVE ONE
Is this what Concord did to its playerbase?
-1 x 0 = 0
This is nuts. Velocity is 0,0,0. Forward Vector * 50 is 50, 0, 0. Adding them together you get ... 50, -350, 0
๐ซฅ
You are a saint. A true hero. Thank you so much for tolerating me and this!
am I dumb or is this not flip flopping
Hey I am building an AR app in Unreal 5.3, currently testing with an android device so running it through ARCore. The App works well and starts an ARsession with image tracking but when I pause or stop a session then try and start another again I receive a fatal Error through the ARSession Status and it doesnt work again. My only work around for this is to either restart the app or restart the current level the app is playing through, which is crappy to say the least.
Checking online this seems to be a persistent bug through many versions of Unreal and I was wondering if there is a fix for this or a more elegant way of handling a restart of an AR Session?
I hope in in the right location but I'm having a strange issue that i'm assuming is related to the floating point.
I have a masterball blueprint that spawns BP_Ball. BP_Ball is a physical sphere with gravity turned off. Free movement. In the first photo you will see the blueprint nodes that relate to spawning the BP_Ball. I get the location and rotation of masterball and used that as the transform to spawn the ball. After spawn I set the ball velocity to the masterballs forward vector multiplied by my ball speed variable. In the next photo you will see the event graph nodes for the interaction between BP_Ball and one of the four walls inside a box. I mentioned the BP_Ball was physical but for this specific interaction, it does not collide and uses overlay instead. Each side of the box has it's own cube mesh set to detect overlay from a BP Ball object i created in the project settings. After a BP_Ball overalys a wall, depending on the wall, it will invert either the x or y velocity. This way it appears to bounce without ever coming in contact with the wall and while maintaining it's velocity so it can bounce ~forever. Here is where the issue reveals itself. After one or two bounces off the walls, the balls begin to deviate in location while maintaining the exact same velocity and forward vector. The difference is small but very obvious. You will see this behavior in the screenshot provided. In addition to that, the balls appear to get closer or father apart from other balls even though they are spawned the same timeframe apart and traveling the same speed.
any clues or ideas would be amazing.
You're in a function. State in functions is reset each run.
yup that would be the reason
Hey guys, Im pretty new to unreal ive followed some courses. Im looking to make a FPS with a apex / titanfall style movement. what would you recommend me reading or watching if you have anything that would be massive thanks!
If anyone remembers this from yesterday I added images of the code and posted it to #gameplay-ai as it felt like a more appropriate place to put it
this issue is driving me insane lol
I'd recommend the Unreal Engine 5: Advanced Locomotion system ALS on udemy (Link: https://www.udemy.com/course/unreal-engine-5-advance-locomotion-system-als-intermediate/?couponCode=ST11MT91624A)- it won't teach you how to do exactly what you're doing, but it'll teach you a ton about game feel, animation blueprint and a ton of what it is I think you aim to achieve.
guys, a 5mb animation blueprint is too much big?
what to pass here in instigator?
nothing ?
do you need an instigator ?
there's no pawn assosiated with the enemy... the enemy IS the pawn
if u can go to #cpp and check my question this is actually causing my engine to crash i mean not the missing instigator
but I try to getController() in begin play CPP and that makes the engine crash
it's not the case when I place them tho instead of spawning them
have you set the AIcontroller to Auto Possess on spawnend aswell?
its a class setting
normally its set to placed in world, iirc
you want to swap it to PlacedInWorld OR Spawned
https://youtu.be/I7v_b5Q77xk hard equation BPs
Overview: After days of trial and error I could get the trajectory read
Description: When I was a child or teen 18 year old full of acne I had to make a project, it was to calculate the trajectory of a projectile, I remember I used delta 3d and while it was hard I learned a lot of coding and I recon that my project deserved bad score, but it is...
@dark drum I finally solved it, after several failing attempts. Dunno how clean things are this way but as someone would say... "it just works" now... ๐ Thanks for having dealt with my craziness!
It looks ok. It might be worth using a sequence before you do your check if it has the relevant tag so it can still go onto the next bit if there's no spring arm on the owner.
What happens if I remove variables from a Struct (through CPP) that I've used to create a Data table?
Will it just drop those columns from the Data table, or will I loose the entire data table? (spent time inputting stuff in it)
I'd export the DT to be safe ๐
Yeah, probably a good idea. Not sure I would be able to import it though after I changed the Struct.
Could maybe change the Struct back in that case.
*not taking responsibility for a potential damage*
The columns should be removed and DT otherwise remain intact. Never had issues with DTs.
You'd just remove the column in the CSV pre import
then it'd import fine to your new struct ๐
it may even just skip the column on import, i'm abit unsure
in all cases you can't go wrong with a backup
It'll just drop the column, however if you use the structure anywhere that used the data from said column, you'd have to go in and clean up.
Hi guys. One question what is the node to activate and deactivate the cine camera in unreal?
Thanks for the reply man, Yeah i Was actually looking at this last night thinking it mite help.
My mind has gone blank regarding gameplay tags. I have two gameplay tag containers (Container A and Container B) and I want to remove all tags in container A that don't match or are aren't child of the tags in container B. Does anyone have any suggestions?
for each tag in container A you're gonna have to iterate through every single tag in container B and check if they don't match or are aren't child of the tags in container B
so yes it will be a foreachloop connected to a foreachloop
If you're doing that in blueprints I hope your containers aren't going to be huge
if you have 5 elements in container A and 200 elements in container be, that's 5 x 200 iterations for a total of 1,000.
That's a relatively small number though what really matters is how complicated the condition is going to be to check, if it's something simple like just comparing if a few things are equal to eachother then 1,000 iterations is nothing
I know that TSet's have queries for this, but I don't know anything about XOR
Maybe?
kinda vitial, don't you think /jk
This is the root I ended up going. Not sure if its the 'Has Tag' or 'Matches Any Tag' I need. They might do the same thing. The descriptions confuse me to be honest haha.
yah, I'm foggy on it also, i 'think' the exact match bool will get your child tags
I think it's this. I guess I'll find out when I get to a point where I can test lol.
Do you guys foresee issues with a localization approach like this where I create a String Table and in the actual text I have "place holders" like "<#>" and "<%>".
Then I always have to run a function to replace those placeholders with an actual value, but it allows for just one translation?
Alternatively I could have more text elements in my Widgets to allow for the numbers, but this seems clean if I don't run into issues. Also not sure if some languages would put numbers in a different spot than last, so they could just move the place holders in that case?
A bit new to localization. Might be a stupid question.
Is there a way to clamp or smooth the movement of an effector on 2 bone IK or FABRIK nodes? In order to prevent tiny jitters and changes from happening
Hi all, hope one can help me. how do I get my AI to block incoming attacks from a other AI, now i play random montages when one of them is attacking. but i will play a block right montage when the other AI is attacking from left....... is there a way to bind attack animations to a block animation.
Have a Desired Location that you set when required and then another location that lerps to the Desired Location. You'd then use the lerped value instead of the desired on.
i know this is not most expensive function, but is it better to store it in variable or there is no benefit cause it is cached or something? I talk about Length
That depends how many times you use it.
2 or 3 times ;d
so first call is 200ns, and next call is 100ns but don't see readtime of my variables ๐คทโโ๏ธ so im unsure if there is slight benefit, or slight loss on read write memory
Personally, i wouldn't worry about it at this stage with that few. The difference would probably be negligible.
the array size is cached in cpp
so it's not really worth to cache it, unless you use it a ton of times
also that 100ns vs 200ns might be not 100% accurate and influenced by other factors
there's no reason that the 2nd call would be faster
graph looks like this
but I see what you say. but caching could be slighlty faster I think, maybe not twice, but slighlty ? maybe? thats too deep in c++
but yes, Editor will take some performance for checking and debugigng
now you've wasted minutes on non existent issue worth, potentially, nanoseconds
I wasted none by trying to lead you away from this unnecessary optimization
worry about ms, not ns
i call this function over 300 times
then move it to cpp
that will probably give you few microseconds
so big improvement over 100ns
okeok, good idea actyually
are blueprints still "nativized" in 5?
i probably should all stuff into C++, actor, function ,and rest of components ;d
I might be mistaken but wasnt the player health calculated with MaxHealth / CurrentHealth?
why am I getting a value of '1' then, given that the max is 1500 and current is 500?(float var)
Shouldn't that be the other way around?
1500 / 500 = 3
Anyone know why an object Implementation check fails for a Level that does in fact have a specific interface? I have this interface as a way to pass events to the Level BP via the BPI_LevelEvent, I added that interface to the level BP, but when I try to call it, the **DoesObjectImplementInterface **says that the level does NOT implement it?
If clamped, 1
for some reason this returns 1500 when you can see on left side its 500
after division it returns '1' too, thatswhy i started hesitating
okay thats my own issue nvm
this is the correct way to get it
Because the level object isn't the level BP. You can't get the level BP from anywhere (not in BP anyway) so you should treat it as one way. (from the level to other actors but not from other actors to the level BP)
๐ฑ I've just set a message to the level BP!!
I still wouldn't recommend it though haha
lol how?!
I ended up adding an EventDispatcher on the GameState which the Level BP binds to. So the caller (in my case a dialog choice), calls the GameState which then executes the delegate, so then the LevelBP can pick it up
What are you trying to do anyway? You're normally better off using an actor or actor component than the level BP.
When a player gives an NPC an item by clicking a dialog option, a gameplay event happens (some things move around the level)
I'd make a gameplay event manager with event objects. The event objects define what should happen and the manager handles it.
got a weird issue with a blueprint interface - the implementation is not saving, every time I close unreal it reverts to the empty/default. Why?
Hiya, I'm trying to fix a problem with my blueprint its been awhile since i've done some UE stuff and relearning stuff again.
I've started with something simple like a camera zoom, but wanted to use a timer instead of Tick (something new to me) to learn better practices. But at the moment i feel like i've done something wrong, the condition check sometimes doesnt match until i inspect the value in the editor, which updates it and then causes my timer to pause. But it doesn't happen naturally inside the game window unless i zoom right down to min value.
Maybe im just overlooking something or not understanding correctly, so a second pair of eyes would be welcomed.
As a standalone actor, or actor component?
Actor component for the manager, uobject for the event object. If you're not using C++ thought using uObjects can be a little tricky as they have not world context.
This sort of thing normally only happens because something wasn't saved before closing the editor (either the BPI or the actor that implements it) or there's a load order issue where the actor is loaded before the BPI.
I have tried it a few times, made sure to save, but same result, is there some way to resolve it? The BP implementing said interface is the game instance, so maybe it is loaded first but its got no problem with some other BPI's I'm using
For some reason my blueprint which moves a character will move them to complete different lengths depending what computer I'm using and even if I'm using PIE or Simulating....
What in the hell is going on?
You're probally not accounting for delta time. (frame rate related)
Is the BPI apart of a plugin?
I'll bet money I'm not, lookin at my BP it isn't listed anywhere... Sigh.
Thanks Pat
Is it your own plugin?
Yeah
You could try 'PreEarlyLoadingScreen'.
Just did, no luck unfortunately
It might be worth checking the logs after it's loaded the editor. There might be something in there that'll point to the issue.
Only reference I see to it is where its mounting the plugin, which looks to be done alongside all non engine plugins... weird. I should mention the BPI's that work are native to the project, which makes sense
That is odd. It might be worth asking in a different channel, someone in #plugin-dev might be able to shed some light on it.
Alright, thanks for the help ๐
The BPI is in a plugin and something you've implemented it on in the primary module of the game is losing it when you open the editor?
Timeline is usually good for linear interpolation like this -- any reason you opted for a Timer instead?
Otherwise I'd recommend using a Timeline.
Indeed. BPI exists in the plugin content folder, Implementing blueprint exists in the main project. Implementation is lost on loading editor
Does your primary module have that plugin as a dependency in it's build.cs or in your uplugin file?
Ah i was unsure as to what the best approach was and thought that it might have been easier to adjust or change in the future if i wanted to add something else to it, like tilting at a value.
Im kinda getting around the problem by doing a inrange
I usually give the timeline a float track that moves between 0-1, which you can then feed into whatever zoom function you want as an alpha value for Lerping.
at least the pause happens consistently now, im just probably hacking it up at the moment though.
No, though, is that needed if its all BP?
That way you don't need to manage timer handles or stuff like that, and you can easily play the timeline Fwd / Rev smoothly to animate the camera.
And if you want to add more to the zoom func. you can easily do it (inside whatever function you've defined for zooming).
Maybe not. But it's good habit to force loading order by dependencies.
I'll give it a try
On a side note. Don't just simply trade tick for a timer cause someone said tick is bad. Tick isn't bad. People's use of it is. If you need something to happen every frame like smooth movement, you need it to happen every frame.
Thanks for the feedback, the engines changed a lot, so ill do some digging into that and see how that works out, it was more about not putting unnecessary things into Event Tick, than the method to be honest.
No luck ๐ฆ
Yeah -- but this is a great use case for a Timeline at least, timers are better used when creating delays > 1s, not when conditionally performing something every tick.
But yeah, check it out!
Timeline is honestly my favourite BP thing :)
Just do Event Tick -> get actors of class Actor, Delay 1s, uninstall engine. ๐
Yeah i mean it works perfectly fine with tick i was just trying to not put what i thought shouldn't be needed in there. But thanks to both of you
That's odd. What kind of BP is the interface implementer? The TLDR is that this BP is getting loaded for some reason before that interface exists. Do you have some sort of early editor data initialization that is gathering up classes for something?
The only other way this happens is if you've somehow caused a loading loop. Which would be really hard in a plugin to the main module. But if the interface refs something, then that something refs the interface or something that refs the interface. BP will just randomly load one or the other first and it might not be the order you like. Circular dependencies.
Its a game instance, so I do expect it to be loaded really early on, but beyond that I've not done anything to mess with load order
The interface is really simple, just a getter for an object class defined in the same plugin
I can safely say I've never considered interfacing a game instance. Even still, the interface 'should' load first if it's in a dependent module. :/
Cant you add it to GI base class? In c++
I've heard that do wonders for load order issues
Yeah, C++ is a lot smarter about that.
I suspect GI coming up very very early in the loading process
I could, yeah, would probably solve it, but I was hoping not to need to require a cpp game instance just for this one little getter method
I would consider a GI Subsystem, honestly. First thing that came to mind the moment you mentioned an interface in the game instance. Should never really need an interface for a singleton.
yeah, that's fair, I wanted to have some kind of ability to compose stuff in the GI from plugins
So simple interfaces with adapter objects was the plan, but its not a huge problem if its not really viable, just woulda been nice
I'm a bit late to the party, but I've had exactly this issue myself without any plugins. I had an interface on my main character BP and it's implementation of a single function would delete every time I closed the editor. Other functions from the same interface would save was so odd! I fixed it by duplicating the function, giving it a slightly different name and reimplementing it then deleting the function from the interface and character that kept breaking. Terrible workaround, but might help you.
Hello, I want a projectile spawner, that I can move in a motion of a cut in half 3D sphere, how should I go about doing this?
im using this to set a target location for a turret to aim at, and while it does correctly fire ahead, when the target moves away it doesnt fire far ahead enough and when the target moves towards the turret it fires too far ahead. anybody know why?
because you're assuming a constant time of flight
if target is moving tangentially then you can assume it's the same distance from you the whole time
if it's moving towards or away, the distance you use to calculate time of flight is wrong
You're assuming distance / 8000 is how long itll take for the projectile to get there
but flight distance will change due to the movement of the target if it's going towards or away from you
good catch, i thought it should be fine since i did this on tick and it works fine with NPCs, but it doesnt make a lot of sense here
Say the target is 8000 away and moving at 1000 away from you, it won't take 1s to catch up, it'll take longer because in that 1s it moved further away
It'll take more like 1.125s + some
Your best bet will be to iterate.
- Determine time to hit (TimeToHit = distance / speed)
- Move aim point to where it'll be then. (AimPoint = Position + Velocity * TimeToHit)
- Determine new time to hit aim point. (NewTimeToHit = DistanceFromAimPoint / Speed)
- Move aim point to where it'll be then. (AimPoint = Position + Velocity * NewTimeToHit)
That's probably enough. If you had to be super accurate you'd do it a few more times
dang, i was hoping to not have to do any iterations since this is happening in tick, but i guess this is a fine approach for now. thank you very much 
You could do it 1000x on tick in C++
2 times is nothing in BP unless you got a hundred of these things
oh
not as bad as i read everywhere then, i'll definitely move to C++ later on anyway
I mean BP is about 100x slower, but whether or not that matters depends
walking is 100x slower than using a car, but if you're just going down the block who cares
I think this can be 'optimized' to a modifier based on the travellength and some clever math
wouldnt be as accurate as actually doing the iterations but
likely get you close enough ?
i can try both for sure, as long as it's gonna be "good enough"
You could try do an explicit solution but there might be some scenarios where there's no solution, it's probably faster just to iterate
Target outrunning bullet etc
literally this, im still early in prototyping so no premature optimizations
yeah as soon as i wanna account for acceleration is when its gonna be painful
Not too bad with iteration
do you have projectile gravity or do they just move in a straight line?
Get comfy with vectors
What you're trying to do is solve for T where
ProjectileStartLocation + ProjectileVelocity * T = TargetStartLocation + TargetVelocity * T
so:
TimeToHitAssumingConstantVelocity = (TargetStartLocation - ProjectileStartLocation) / (ProjectileVelocity - TargetVelocity)
try that
i thought aiming a turret with an off-center pivot point was harder, boy was i wrong
and then iterate after aiming?
That should hit with constant velocity without iterating
for acceleration you'll want to iterate
hmm im sure tried something like that but let me do it again
wait a second
nvm
because you need to calculate projectile velocity too
yeah just iterate
You know projectile speed but you want to modify its direction to hit
the thing that i dont understand though is, suppose the aim happens instantly, shouldnt it always be hitting?
wat
if you iterate enough you'll always hit assuming constant velocity of target
and assuming it can't outrun your bullet
this might be my sleep deprivation talking but with the approach i had before, calculation, aim and fire happen in the same tick. since the target velocity is constant, shouldnt it always hit at the predicted position regardless of it moving away or to?
No
since you assume time = distance / speed
but distance is not the percieved distance
distance changes over said time
your function doesnt account for that
(same with mine really)
you can calculate it, you just need to know what you're calculating
if the target is moving away from you, there's gonna be two changes
the relative speed of the bullet towards the target changes
AND the targets location after bulletTime has changed
Target is 1000 meter away
Bullet moves 100m/s
Target moves 50m/s away from you
Effective bullet speed is 50m/s
At what distance would the bullet hit the target?
1500 metres if my math is right
Just do it like this, it'll work.
Time = 0
AimPos = TargetPos
loop N times
Time = (AimPos - MuzzlePos)/ProjectileSpeed
AimPos = TargetPos + TargetVelocity * Time + 0.5 * TargetAcceleration * Time * Time
Repeat as many times as you want
more iterations = more accurate
thats what im implementing right now
ill let you know if it works good or very good XD
thing is i have to consider how many the player will have and how many possible AI will have
actually nvm doesnt matter, C++ later anyway
if it gets slow just put it in C++ and also you don't need to do this every tick
yeah i'd probably aim for some approximation if it were bp only
but yeah c++, and be done ๐
just do it when you gotta shoot
converting projects is scary ๐ญ (probably cuz i only did it once on a machine that took 10 minutes to load visual studio)
@pseudo valleyModified it for acceleration
I just go full balls of steel whenever i convert xD
Convert in place yes please
Start with a C++ function library, then your BP can just call CalculateAimPosition which will do the math in C++
wow you're amazing โค๏ธ it looks so much simpler than i expected
okay i need to learn a lot XD
Unless you have backups, you should probably be careful about doing that x)
good idea actually
pff but how else am i gonna have my own "damn i just broke the whole projec" moment
truer words have never been spoken lol
I don't backup personal stuff as much as I should. But I've gotten pretty good at fixing BPs if the need arises. ๐ Not a bad skill. But I still wouldn't mind not needing it. ๐
haha same
I just pretend to have my shit in order
backups are no bueno
and if I do ever have some backup, its 5 months old and totally useless
I have started to like using GitDesktop with Azure Devops though. It's a really easy system to set up and use. Do recommend.
lmao i hope y'all never have real important projects
for source control?
Correct
my one "real" actually got sourcecontrol
see, there we go
Source control does help a ton. But it doesn't solve everything. Sometimes minor corruptions go on for months without anyone noticing. At that point it's easier to write a script to fix it than redo months of work by reverting the BP.
Hello, question. Why "IsValid" node throws error when input is invalid?
Isnt the whole idea of it is to.. you know. do the thing?
very true, the few times i did back up my projects i still had to know how to fix stuff anyway because of too many commits
Show how you're using it.
You didn't validify what it's complaining about.
Get[0] prob doesnt exist
So it failes to even get a null reference ?
validate the index first before accessing it
IsValidIndex
not at the initial tick for this binding
so this is not a binding?
it IS a binding, yes
well anyways
there's atleast 2 things there that can be wrong
- TrainPayloadRef could be invalid reference
- BatterySlotsArray[0] could be invalid index
if you wanna cover your but, you need to validate them all ..
it checks that the returned reference from battery[0] is valid
but it doesnt validate the chain
Invalid reference =! null ?
only the reference plugged into it
It does. But you're assuming that the initial reference, and index 0 is valid already
which by the looks of it, you can't
Wait
ugh
zis stoopid foken ting
So, i cant do IsValid to shut annoyng log?
because if IsValid gets INVALID data - it throws error
so tf im supposed to do?
validate the source of that data
but antoher "IsValid" before IsValid?
and not just the data
thats waht i was trya do
It's not what you're currently doing
i have reference to a child actor, sometimes it is filled, sometimes its None
It's probably failing because the very first thing Train Payload Ref is null so of course it get the first element of an array that doesn't exist.
(when actor is not attached)
Look
Forget it
ill redo logic somehow other way
unreal is too stupid with basic things it seems
Make sure the Train Payload Ref is valid before checking the array inside of it.
like horizontal collision
You're free to add your own validator
i gave dese checks before Binding starts to tick
jsut a second of running
(because it's a binding)
they're pulled all the frickin time
and ui widget just kills everything
you shouldnt use bindings at all
you
huh.
do i.. do i cast every tick from actor to actor to figure out whats fuel level in the fueltank is?
Show where you set the value for Train Payload Ref please.
thats the main problem, i hope you see it.
the variable gets set up at the time of Widget creation.
You are setting self as the value of Train Payload Ref
instead of the widget that gets created
you are perfectly correct
This is interactable object, that has UI. it creates its own UI widget, then sets himself as a reference into Widget
so widget can bind values from interactable object and do UI things(fuel level inside fueltank)
it is all done so UI can fill those progressbars depending on how much fuel (simple float) is left in the object
Might be a race condition problem due to how binding works. You create the widget then set the value after its been created. However upon creating the widget I think the binding starts working right away which would mean it happens before the Train Payload Ref is set. So yeah like I said before it's failing because Train Payload Ref is null and you're trying to check an array inside of it.
All you have to do is check if Train Payload Ref is valid first before accessing the array inside of it on your original function screenshot you posted earlier.
You dont have to return the err output it can fail silently but yea
i do have , but thats not imporant
Events are better than bindings, much more performant
alr, i gonn cast to parent actor every tick
you're basically doing the same thing already hah
I only use bindings for something that changes constantly like a speedometer in a car or something like that.
thats surely way more performance-friendly?
casting includes validation ๐
...or fuel level in fueltank
doesn't really change that often does it
But does it change every tick?
Or can it change every say 100 ticks instead?
if engfine is running, duh, it does?
oh my god, are you suggesting custom timer
so like make timer that fires every 60 ticks, and does this, lets say "UpdateUi" custom functioin
is that the way you suggesting it?
yea then do that for everything else that uses bindings in your ui
(or the binding, but tick is cleaner, and if you later improve it to some mindelta before update then you'd be off a little easier)
if its the ONLY thing that uses bindings then who cares... but its better to avoid anything on tick whenver possible
ye thats waht i imagined tyuping previous message
you can see it's not just that one things tho
it's a bunch of things
progressbars, throbbers
visibility updated on tick
sounds very excessive
it will give you an access violation if the index is not valid
and another one if the original reference is not valid
but if the thing containing the array is null how can it check an item inside of an array if the array is null in the first place?
and since bindings are basically pulling on tick
IsvValid only validates the input, as i said before
i understand
you can keep repeating that it sucks and whatnot, but it does exactly what it should
but its kinda, counterintuitive to me
I could agree, that having it chain walk would be neat
but then again, you'd be hard pressed to find the culprit, right ?=
Disregard this, ill redo this completely different way that worked before
keep in mind, bindings are evaluated on basically tick
The order of node execution matters a lot.