#blueprint
1 messages · Page 195 of 1
Nah probably just in need of a break 😉
your probably right ive been working on this since like 6am xd
Yea at some point you just don't see it anymore unless you take a step back 🙂
do you mean set the A B from 0 to 1?
because when i plug the door alpha into the alpha the value disappears
or would i need to change the value before plugging it in?
ill take a break as soon as i get this door done its been on my to do list for like a week now xd
What's with the 2 bools?
No, read again. I have to go to bed
oh alright
i followed a tutorial and thats what it said to do
seems like one checks if door is actively opening/closing
but if you dont want to wait for it to fully open/close before retriggering, remove that branch and variable completly
ig if you don't want to be able to override current door activation you can keep it but eh
your alpha should go to the lerp alpha, which should be a value from 0 to 1. That should then change the location properly from 0 to 550
ok. which part are you unsure of ?
do you have a basic understanding of how Enhanced Input System works?
sorry i am really confused im not sure what value im supposed to be changing
my guy. Take the out float from the Timeline and plug it into the Lerp's Alpha pin
I've watched a bunch of tutorials and am still wrapping my head around it all, but I think I understand some basics
also what does your timeline look like ?
ig you should just be able to hook up that line it should work
just connect Door Alpha to alpha as the screenshot above
yeah ive done that and when i press my interact key nothing happens
are you sure the interaction triggers then? Add a breakpoint to the interact event with f9 to check if it triggers, or alternatively a print string after the interact event too
🥲 Why does it fall short when using the velocity suggested by the node (the debug that's being drawn)
also make sure is door moving is set to false by default
Hi everyone! I'm new here so hopefully it's okay to ask this here. But I'm having some collision issues with UE4.27. Every VR Interactable collides with my pawn, despite setting custom collision presets. Maybe I'm overlooking something simple, but I cannot figure it out.
Alright. So on a simple digital bool IA with no trigger (defaults to Down), drag from the triggered pin, GET current cube height and add a value to it, then SET cube height
i probably shouldve made this clear from the start. i am basically new. so ive added a breakpoint to the even interact node. what do i do after that? run the game and try it?
Not sure how to structure it, I have managed to make a cube spawn underneath the player, this is what Ive currently got, I feel like its something I should do in the ongoing section?
The ability is basically spawning a rising pillar underneath the player
no, OnGoing doesn't do what you think it does
First off, Triggered fires on tick. So don't spawn an actor on Triggered
forgive the noobness, trying to learn. I'm not sure if the get and set is what Im looking to achieve
Ah
Do you want the cube to spawn only when you initially press this input?
Yes, other than that the "cube" is non existant
To clarify, OnGoing fires when you're using a Hold trigger (needed alot less often than you'd think), in between the time the input was actuated and the time when the actuation threshold has elapsed). If you release the button before the actuation threshold has elapsed, Cancelled will fire, otherwise Triggered will begin firing. This doesn't apply to your situation, just for future ref.
ok. So Spawn it on Started, and if you want it to keep moving up while button is pressed, do what I told you here on the Triggered #blueprint message
also make sure you read the description on the nodes, the Transform Location node is for something else entirely: https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Math/Transform/TransformLocation/
Transform Location
The transform location bit was to correct its spawn location (it would spawn between the world and the player, when I want it to spawn slightly under the world)
Oh ok
damn this feels bad to ask haha, how do I get the height of said cube?
Get actor location, split pin, get the Z. Then when you SET it plug in the initial X and Y, and the Z + whatever height (don’t make it too big, since this will fire every tick)
Anyone have a solution for this?
triggered exec is not compatible with Actor Object Reference?
It’s an execution pin. What are you trying to plug it into?
Look into EQS contexts
eqs ?
EnvironmentQuerySystem.
Get the return value of the spawn actor and plug that into the get actor location (the one that’s sitting by itself on the left) since you’re trying to get the location of the cube
hello guys i want the controller back after i respawn the enemy he is not moven anymore ... waht is the right way?
maybe to not destroy?
oh boy idk how I missed that thanks, so now Ive got the xyz values, how do I modify the z value to increase while the action key is being held?
Drag from it. Type +, hit enter. Add a value. Plug that new value into the broken pin of a Set Actor Location value. Plug the original X and Y in so they’re not 0.
https://www.youtube.com/watch?v=qLLVayOy2-I
Hi guys,
I work on a chaos vehicle based project, and our problem is that the physics not really consistent, therefore its hard to use take recorder.
What settings should I use for more consistent physics?
After this you should watch your first hour in Unreal on the Epic portal and the bp live comms training pinned here so you can learn the basics @ionic nacelle
How do I set a new value, when the new value is dependant on how long the key is pressed?
Will add them to the list
Do you want it to rise faster the more you hold it down or what
I want it to rise until the action key is released.
A rising pillar that the player summons beneath their feet which stops at height x when key is released
I probably didnt describe it too well initially
Ok, so what’s wrong with just adding 1 to it
To clarify. Triggered fires on tick which means every frame. Which means if you’re running at 120fps, you will be adding 1 to your Z 120 times per second or so
And you can change that value as you see fit
Aaaaah thank you!
Button pressed -> hey pillar, start growing
Button unpressed -> hey pillar, stop growing
Pillar.Tick -> if bGrowing -> height += HeightGrowthSpeed * DeltaSeconds
that's assuming the pillar is some separate actor
Either way, you just need to tell something "hey the button is pressed" and "hey the button isn't pressed" and let it do the growing on tick.
Trying to figure out how to communicate that something is half the battle lmao
You get better at it over time
I have some experience writing javascript, html, python and c++ so I thought It shouldn't be too hard to work this out intuitively, but damn was I wrong lmao
Having a decent understanding of programming will accelerate your learning speed
Just a matter of getting used to bp, the rest is usual logic stuff
@ionic nacelleWhat component within what actor should be doing the growing?
is this a separate actor or part of your pawn?
the z component of the xyz scale
of what?
the whole world?
the character?
a ice wall?
of a cube
its a blueprint class actor
spawns in once the action key is pressed
ok so do it like this
Button press -> line trace (to figure out where to put the cube actor thingy) -> spawn it -> save a ref to it -> set bGrowing to true on it
Button release -> if cubeactorthingyref is valid -> set bGrowing to false on it
Cube:
Tick -> if bGrowing -> Scale = Scale + MakeVector(0,0,Scale.Z + GrowthSpeedFloat * DeltaSeconds)
tune GrowthSpeedFloat to taste
It's that simple
Are we growing this pillar or just moving it up?
he said growing but same idea
just modify position instead of scale if that's the case
how is this communicated in BP is my confusion
The general form is the same for many things like this
Button down -> spawn the thing -> save a ref so you can talk to it later -> tell it something
Button up -> tell it something else
Thing.Tick
Do something based on some variable
almost exactly how it's laid out here
GrowingCube will need 2 variables, bIsGrowing and GrowthSpeed
the character will need a variable MyCube to know who to talk to on button unpress
start with printing a string on button down and button up
My main confusions are, "Button pressed" isnt something you can right-click and add to event graph neither is "button released"
started and completed probably
idk 100% how it's done with the new input system but find the events that fire when button is down then when its up
use print strings
Read this, I grow weary of repeating myself lol #enhanced-input-system message
Giving it a whirl now, thanks for the help
What button... The thing is there are many. With the old system you could specify just a key press but this isn't a good way to handle it.
With enhanced inputs you create an 'input action' and then define what keys will trigger the action in an input context mapping. You can have multiple mappings that you can add and remove at runtime.
These input action events have a triggered which is triggered most ticks as well as having a started and completed pins.
Anyone know a handy tutorial for making an inventory/mine/drop/craft system?
I accidentally hit override on a function that i have on my child class? is there a way to get it back to how it was?
No but it's not too hard. Start with thinking about what an item IS when stored
You have sort of 2 ways of thinking of any given item. The item existing in the world (dropped, held), and the item existing in the back end (stored in inventory)
Sort of like a dollar bill vs a dollar in your bank account
a dollar bill is a thing, a dollar in your bank accoutn is just a number.
Do you plan out your scripts before you write them?
I mean I think about it a little bit but I just start making the thing
What you need all depends on your requirements. Like Minecraft for example
a stored item is just an ID + a count
- some other data for enchants or condition
So should I be doing that in unreal for my project?
or is there another way of approaching that
depends
I have no idea what you need from an item system
do you need items to be fungible or not is probably the first thing to think about
Like, is 20 apples just
ID : Apple
Count : 20
or do you need to think about individual apples
20 customized guns wouldn't just be
ID : Gun
Count : 20
that's not enough info
right
So there would be 2 different types of items
Back to your money anology, that could be a dollar bill and a 20 dollar bill
well IDK if you have customization or wear or other individual stats about an instance of an item or not
In my money analogy it'd be if you care about the serial number on the bill or not
do you care about individual items or is an item just identical to any other item of that type
depends on the item
thats why there would be 2 types of items
some of the items are 'special' and need more info, other are just repeatable and not unique
I would start with fully fungible items to begin with
a sword is a sword, a gun is a gun, an apple is an apple, and they are all just clones of each other
then your backend, the data structure to talk about what's stored or what can be dropped or what can be crafted is just
Thing
Count
Thing can be a data table row, just an ID, a data asset soft ref, whatever
hell I'd lose count to start with
just have an array of ThingID, whatever that is, and that's your inventory
You got 5 apples, you have
InventoryArray:
Apple
Apple
Apple
Apple
Apple
and if Apple is a data asset ref, then when you want to drop it, you can go like:
DropItem -> read data asset -> pull BP class out of it -> spawn that -> remove item
So an inventory is basically just a bunch of arrays
can be yeah.
It can just be a single array for the first draft
Yes, if the event triggers it will pause the game and show you the blueprint with the breakpoint. If nothing happens and the game just continues then the event does not trigger
Sounds like a lot of planning
welcome to gamedev
either that or I'll have to find a flexible tutorial that I can add to later on
not something unoptimized
Either way, you want some source data. You want either a data table or bunch of data assets that represent all the items in your game.
btw blueprints are data assets, you can just store BP class refs if you wanted to get real janky with it
MyItems:
BP_Apple
BP_Apple
BP_Apple
the general form is that the DEFINITION of an item, the thing that says what it is, is static. That's like the ID lists from Minecraft.
An inventory is just some way to say that you hold x number of x item ids
spawning an item in the world is just reading that id, getting to some spawnable thing from it, and spawning that
sorry it's gonnat take me a few minutes to fully understand this 😅
I've started a tutorial series a few weeks ago. I just uploaded episode 4 today. It might point you in the right direction.
https://www.youtube.com/playlist?list=PLcwVLBaUNnHoujbPwOAdMgNtq1ShoHIGc
Hi all, Just a quick question, I think I am missing something stupid so wondering if any of you know what may be the problem. I am trying to move an object using a timeline on 1 axis relative to it's world location. For some reason (And no matter what axis I try to change) the object ends up in a completely different world space. But it goes there every time and idk why and it's killing me inside xD
Show how you're currently doing it.
A bit messy but just trying to get it working lol
I merged a bunch of actors together and then converted into a bp btw, Maybe this is part of the problem?
Try this instead:
Dont set your actor location inside the timeline, that is just a headache to change
Make your track inside the timeline go from 0 to 1
Use a Lerp to change the desired location from Start to Goal
Ah you legend! It works perfectly now thank you
Perfect!
Im passing in a variable which is an Actor class reference into a function that'll spawn the actor in the world at some later time. Should I use Soft or normal?
class reference
Is it possible to call a function in a macro via a timer by function name?
I'm trying to call my function UpdateCharacterGravityDirection via a looping timer until a condition is reached (until current velocity equals target velocity). Once that condition is reached I want to clear the timer handle.
I was expecting this to keep calling the function but it only gets called once
Just use tick.
Why do you want gravity to be applied on a timer? It'll literally be worse than on tick. Either it won't work well, or it'll be tick with extra steps. Either way it won't be great at all.
gravity "happens" per frame, use tick
The only reason you wouldn't want to do it on tick is if you were using async physics, then you'd want to do it on whatever the async physics update event was
is it possible your map having to many actors so the ai cant move them ?=
I think there is a pay to preview the nav mesh if I can remember correctly?
wdym ?
wdym?
Try pressing P in the editor when you have a nav mesh in the world, Shows the areas the AI can move
I don't want to apply gravity per se, I'm making a movement system where I change the gravity direction (walk on different sides of a cube etc) I figured I'd only need to update the gravity direction until it has reached the goal direction. I don't need to update it always right?
so once the gravity direction has changed, gravity would still be applied on tick by the character movement component, I'm not fudging with that
some units arent moving..
ive been trying to bebugg for hours cant seem to find our why
could be literally anything
jepp
and one thing would be to many actos ? i dnno i havent tried with many actors before
altho its like 30-40 so that would be mindblowing if that was the cause
Okay a timer is fine for that. But 0.01 is a ridiculous time.
have you -actually- debugged your ai's blueprint? set the debug object to the one not moving
If you're gonna be anything near tick time just use tick.
right I figured the "max once per frame" would kind of fix that 😄
That's just tick with extra steps
.01 is 100 hz
but it's a tick I can turn on / off per function, right? How would I do that with tick?
For the specific scenario of choosing to either update or not update the direction of gravity, I would just tick, check something, then either do it or don't. Or just do it all the time.
Is the one thats not moving a copy of others that are moving?
isnt there literally a 'tick enabled' call? i think
right, okay that's how I had it before
@hollow pecan same actor same blueprint same settings exactly
It's probably faster to just always update the direction of gravity than to do that half of the time.
And you can see the nav mesh, The area is covered? and the actor is spawned a little bit above the ground
alrighty. for curiosity's sake though: should this be possible to call in a macro?
The fact is if you're in blueprint then performance is not a concern. And if you're in c+ plus, then just doing the thing predictably without branching is probably faster than doing it sometimes and not others.
I don't know, I haven't really found a use case for macros. Outside of maybe custom loops. I don't like macros that add stuff.
@hollow pecan yeah everything checks out "it rotates" its changing its speed" (CMC actual speed) obviously all is my settup but its the same as the others
A macro is literally just copy paste nodes
yeah, I'm just a bit confused why the function doesn't get called continuosly
so it has a speed, but isnt moving..?
yeah
anyway I'll go back to how I did things before and not deal with that problem now 😄 appreciate the insight ty
maybe its stuck on something? jiggle its position around. or figure out where "speed" is actually applied and debug why not
Have you moved the spanner or actor to a different spot to test.. I don't see why too many copies of it would be a problem
but deleting other actors if fixes this one, would tell you something for sure
hm
@steel staryeah i have >.<
@hollow pecanyeah i have
tried everything xD
is there something in the cmc that i can check if its locking ?
No sure, And what happens if you spawn another one at another spot, is it stuck as well?
hmmm i think i got a clue
im using these red stuff (actors with 0 collisions) as patrolpoints
where to walk to
im asigning them on each npc individually from viewport
but it seems some of them are bugged O.o ?
anyone experienced this ?
hmm i think i got it
i had them placed on different sub levels
yeah that did it
loool
such a dumb issue xD
one of my newer projects (made in 5.4) allows me to right click and scroll my mouse wheel to adjust the camera speed. Another project of mine (in 5.1) does not seem to allow this? Or at the very least it seems to be much less user-friendly. It doesn't seem to affect the actual value being displayed, just a hidden value that seems to be limited to the one being displayed? I thought I remembered it working just fine in the 5.1 project but idk if I'm misremembering or if I somehow broke it?
Ultimately I'm wondering whether it's just not a feature that 5.1 had, whether it's changed, or whether it's some sort of editor setting that got messed up (and if it's the third, how can I fix it).
Hey everyone! Kind of a general question for a blueprint implementation, how do seed systems usually work?
If I have a defined integer, I'd like to "randomly" select between different options based on what the seed is. So if the seed is the same it will always be the same outcome, but different seeds could happen to be one of the different options.
Currently I am just using the modulo on the last 3 digits in the number and depending on the value it selects an option, but this feels like a waste of the actual seed itself overall. What would be an ideal way to do something like this?
It sounds like you're after the 'Random Stream' var type.
Thank you so much. Just watched Mathew's tutorial on it. Exactly what I needed 😄
Hi, I'm revising some old settings menu stuff for saving and loading players video and audio settings, I notice that I'm saving all the settings on Event Shutdown on the game instance.. is there any actual reason to do this?
Its causing me another issue which i can resolve by removing it from the Shutdown event but i cant remember if i put it there for a reason or not lmao
Does anyone know how is Get Hit Under Cursor by Channel works? Like how does it shot the line trace or something? I'm not sure if better to use it or line trace for clicking around in top down game? Anyone know difference and which is more reliable? I cannot really easy debug Get Hit Under Cursor like I can with line trace.
I don't think I've ever used the shutdown event lol. As long as the data/settings are saved before the game is closed it shouldn't matter to much.
Yeah i have no idea why im using it lmao the player has to hit the apply button which is also where the save all settings function gets called so i don't think it should be a problem to remove it lol
I don't believe there's any difference. (I could be wrong) As far as I know it just gets the cursors location and projects it to world space and uses that as the start point and then gets the direction normal of the camera adjusted by the frustrum. You can calculate it yourself for your own linetrace but that's just a convenient node for it.
Ok, thank you 🙂
If I have some class with 5 components, and I cast to that class, does it automatically gets every component into memory? So it would be actually better to call to components because they wont reference up and other components? (if set correctly)
If the thing exists in the game already (ie. it's an actor reference) then it's already in memory to begin wtih.
I've hooked up a widget blueprint to an "Open Level (by Name)" node, but when I press the button it just quits 🤔. Also had this issue when trying to use an execute console command (Command: "RestartLevel") node
Anything after doing a hard travel like these is basically not executed.
Finally fixed two of my overlap problems. Fingers crossed I don't find more the instant I start validating.
Or are you saying it basically closes the game out?
Yeah, closes/quits the game
No crash notification thing comes up?
Nope :(. Is there a log I can check?
Yes, it should be present in Saved/Crashes I do believe?
There's also Saved/Logs which might contain info.
This is the log for my main menu widget (which uses the open level node)
and this is what happens when I try to restart the level
Cmd: quit is strange to see there.
Sure is...
Doesn't look like a crash -- at least that log tells you nothing.
I definitely don't have a quit node in either of those logic chains
I'm curious how many ''nests'' do you guys usually have for your classes so each of them stays ''light'' and serves one purpose? I have some idea to do something like
BP_Selectable > BP_Interactable> BP_Master_xxx (logic) > BP_Child_xxx (meshes/heavy stuff) and maybe I could fit even 1 more after thinking a bit more.
I was also thinking about separating my Data Assets into 2/3 parts like DA_Gold_Base (integers/texts/ very light stuff) and DA_Gold_Mesh(heavier stuff), so I don't have to set soft references (I'm not good with them yet! 😦 ) these would also be separated into Master/Child (LightStuff/HeavyMesh).
Are these good ideas or is it overkill and if something is already in the game then i'm basically trying to fight something impossible. Maybe Resource is bad example because 99% of time all of possible resources will be on the map, but let's say we have 12 units each of them has different mesh, but there are currently 3 spawned, I guess there is no reason to load the rest of them?
And additional question to that is if there is just array of things (like Data Assets), and it's on let's say Player Controller, but nothing yet casts to it, it's anyway already loaded in the memory because it's on player controller, who happens to be in game...? Like good example for it would be if player can choose 3 factions which all have different units / buildings, how to make sure that it can choose faction, but at the start of game he loads only one? Choosing faction should be in 1 blueprint that is in lobby (here we can have all factions data loaded, and then he sends only that Data Asset further into the level, and the blueprint which was used to chose faction should not exists anymore?
This was actually on the discussion yesterday, as it happens.
The gist of it (to the extent I can summarize it) being that for any class you want external access to (i.e. BP casts), you'd want one base class with only logic functionality and as few asset dependencies as possible (BP_MyClassBase).
Then when it's time to add meshes and sounds and lights, you add them to a subclass of that (BP_MyClass or whatever).
Stupid. I am so very stupid.
That way, when you need to do a good ol' BP cast to trigger some functionality from another actor, you don't need to hard reference the class containing all the assets -- you can access the base class which contains only logic, meaning it's cheap to keep loaded.
Hey look, everything works fine now! 🤦♂️
lol, at least the crash was benign :)
Thanks for the help anyhow @dry sleet, @dawn gazelle 🙂
Okay, so that confirms first half of my question. What do you think about the 2nd half and factions? And I guess separating the Data Assets into smaller chunks would help as well?
As for data assets, I've always made them in C++, which helps avoid linker load... but I'd advise trying your best with soft refs at any rate.
They're your friends!
The thing that makes them trickier to use is exactly why you want to use them -- it prevents assets from being loaded when you don't need them.
In BP it's easy to resolve soft refs in actors -- just use the Load Asset Asynchronous node.
They are complicating the things.. loading unloading.. some things not working.. i dont feel confident using them yet
Still, I'd advise going that route rather than splitting your data assets out of memory concerns.
I mean, with resource example I think i'm fighting something impossible because it's like loaded in the game from the start to finish.. .so no matter how I set it up, it's already in the memory, right 😄
unless player gathers them all, then that's the only case
Perhaps so, but this also applies to the editor!
maybe that is still good practice, for sure will keep code cleaner
When you load an asset with tons of linker burden it will need to load those assets as well -- and that is true recursively. It can become a terrible spider web of dependencies.
Yea xD I just finished cleaning 1 class and now it's time for next ones. I think I will try with Master / Child + separating data assets because it seems very easy. The 1 thing I'm wondering about is how to make it with factions, so player can choose from 3 at the start, but then only 1 gets loaded? Would it be like to put FactionManager in the Level_Lobby, but then in the next level (map) load BP_Faction with 1 Data Asset? It's how these things are done?
I'm a bit tired so take it with a grain of salt, but this sounds like an excellent place to make a data asset containing all the data making up a faction.
DA_Faction_DinosaurGang.uasset
Then you'd have the ability to create an arbitrary number of such data assets to define further factions as needed as the game progresses.
I generally think of it like this:
If I need to create 3 variants of something, I might as well design this in a way such that I can create 100 variants.
The data asset would contain a lot of soft refs to meshes, sounds, and such, naturally.
That's fine -- the engine will need to load the class types of those assets, but it will definitely already have those in memory (and they're native regardless).
What you want to avoid is having assets such as meshes being hard referenced.
And this is where soft references are good -- a soft reference still means the TYPE it refers to gets loaded, but it doesn't necessarily mean the ASSET it's referencing gets loaded.
You need to request that yourself, which is their strength (Load Asset Async).
and then I have to unload them at some point or I usually care about loading it only before using?(so like on Initialization/Begin Play of that thing that uses it?)
When you have loaded a soft reference, you get a hard reference. This will stick around until you no longer need it, at which point the Garbage Collector will clean it up for you.
Is the only way to play an Anim Montage in BP if I have an active animation blueprint for the mesh?
doesn't everything unload on level change? or do i understand that wrong
No longer need it = no variables are still referencing this asset (you can null them by using a Set node with no input).
For actors it's not necessary, they get cleaned up when the actor is destroyed, no sooner no later.
Okay that starts to make sense,
So I tried these soft references, and if I just drag from soft to something that needs hard reference it becomes hard reference and that's it, but this method makes the game stop until it's loaded, so that is why I should use Async Node?
That's true, but for some games you might stick around on one level for a long time, so it makes sense to be aware of the retention of memory.
The "resolve soft reference" node only works as you'd expect if the asset is already loaded!
(the node you get automatically, that is)
If the asset has not been loaded previously you can get Null from that.
There is Load Asset Blocking (Synchronous) and Load Asset Asynchronous that will help ensure you get a valid pointer back.
Anywhere in the level or manually by the node in the same blueprint?
In the asset manager, deep in Unreal's bowels.
Or registry or database or whatever it calls it.
Generally, just use Load Asset Asynch when in BP.
It never hurts!
If the asset is already loaded it just returns it immediately.
This one?
Yup yup but there's a trap here.
You'll want to wire that cast from the Completed pin, not the one you've pulled from now.
The unlabeled pin of that node fires immediately, even before that asset is guaranteed to have loaded.
The Completed pin is fired first when the loading is done.
Okay got it.
Otherwise there's a risk you'll cast on Null.
The only other things to keep in mind is that Async Load Asset only works in the Event Graph (because it's latent).
Not inside functions, etc.
You can use Custom Events (instead of regular functions) to try to stay inside the Event Graph for when you need loading done.
so to have more detailed example, if I set as variable as RTS_PlayerState (not a native PlayerState), and set it at Soft, and then I Async Load + Cast it's a ''proper'' way to do things? That way I can have literally the most heavy thing as the variable, but unless I Async Load + Cast it's not gonna take any memory?
Just to add: The Synchronous version of that node (Load Asset Blocking / Load Asset Synchronous, I think it's called?) is available inside functions, because it's blocking, but it carries with it some pitfalls (it can cause bad stutters, not just because of the loading operation you request, but because it forces everything that is currently being async loaded to be finished immediately as well).
oh lol, yeah I heard that this one stops whole game until it loads the thing, like with for loop I think?
Well I won't comment on whether it makes sense to do that with the player state or not because I'm sleepy, but that node setup is sane at least!
Haha, yea it's terrible example 😄
That setup will demand, immediately (even upon opening the editor and loading this blueprint), the loading of RTS Player State (because of the cast), and all it contains.
However, if that type only contains logic, or small, cheap, data (in the way a good data asset should), it's perfectly fine.
Hmm, so I should not really cast after loading in most cases?
You need to!
This is the part that's hard to explain -- but the thing you need to consider is the makeup of the assets being hard-loaded.
Say for instance I have a weapon.
And I decide to make this weapon out of 10 different meshes (because it's cool and modular).
If I make a blueprint containing all those meshes, directly specified within components, it will need to load them all.
Haha ok 1s...
Yes! A weapon!
And the weapon has a mesh and a gun sound and a mesh for the bullet casing and a niagara emitter for the muzzle flash and what not.
You define that weapon in a Data Asset like this:
Mesh = Mesh Asset
Sound = Sound Asset
Bullet Casing = Mesh Asset
Flash = Niagara Emitter
Those types are already guaranteed to be loaded in Unreal, since they're core to the engine.
The only thing that is heavy to load are the assets themselves.
So if those are soft referenced, it's not expensive to load the concept of a weapon.
And you can retrieve any part of a weapon as desired.
Perhaps you don't need to know about the muzzle flash if you're only looking at it in the inventory -- so don't load that emitter.
And the data asset itself is so cheap to load -- just a few pointers (or soft references in this case).
Okaay, so If I have Static Mesh soft reference, then I cast again to Static Mesh to make it hard reference?
You have a static mesh soft ref, then you use Async Load Asset to get a hard ref to a UObject, which you then cast to its correct type (Static Mesh).
Indeed, that's 100% correct.
Haha, okay got it 😄
And when Unreal loads this blueprint, it doesn't load the softly ref'd static mesh. It only loads the concept of a mesh, which it has already certainly loaded already.
Yeah, you'll figure it out! It's very nice to get this in early in development, let me tell you :)
it's because of the Async Load Asset node or because of Static Mesh beeing soft reference?
because usually anything that is on execute pins in the blueprint already has ''weight'' on the blueprint, right? so I guess it's the node that is stopping the cast from beeing loaded ?
Hm, not sure I get what you're asking.
The runtime cost of the node execution is very small at any rate.
The loading is the big one.
Ill do some tests with the fresh blueprint.
What this node setup does is essentially:
"Hey, load /Game/Art/Dinosaur/Dromiceiomimus.uasset/ please, at your leasure."
"Sure, I'll load it... but first, tell me what it is?"
"It's a mesh!"
"Oh, a mesh. Let me look up what a mesh is. Yeah, I got it."
"And now it's loaded. Have at it."
(well actually it already knows what a mesh is at this point)
(actually, imaginary dialogue with the engine might be a sign I need to go to bed, glhf hope you figure it out :) )
Well, thank you so much for sitting with me and explaining it
I really appreciate it ❤️ !
No worries! It's pretty tricky and it took me a while to get in the habit of!
I watched some videos about it but they never click at first time so your iteration really, really helped, 1 more video and I think it's gonna be good already
Yeah, just doing some experimenting will probably get you the rest of the way.
It's pretty intuitive once you start using it.
The linker loading (hard ref) stuff is not super intuitive though.
Haha, I guess you are talking about Size map? because I tested it and when having soft reference but using cast on begin play to rts_playercontroller, it shows size map as I had hard reference of pc, but I guess it's just on paper and I have to believe that this thing is not loaded until it really happens.
If it's on the size map it's still hard referenced somehow.
using a cast does indeed create a hard reference. That's what that blue pin is
Though in this specific instance, it's likely not a problem
could make a code only base class for your controller that you cast to though. Not that I can imagine why your PC has asset refs.
Also in regards to this. I would recommend considering composition a little more. Selectable should be a child of interactable, as you shouldn't be able to select something that isn't interactable. And both of these are rather modular kind of functionality and should be in a component.
Yeah so it's just bad example, because in the case of Static Mesh, it's not gonna load that 100 mb Static Mesh at the start and even if I cast to Static Mesh, it's still not gonna reference it out of the box, like with RTS_PlayerController
It's the faction manager with all the meshes haha that is on the Player Controller, I need to change his place and way it works. 😄
Makes sense.
Damn, guys you are so helpfull but it's time to sleep haha 😄 I'm gonna dream in blueprints.
Thanks a lot
That's totally fine, since your game will need to have a static mesh anyway.
You can freely cast to generic classes like static mesh, skeletal mesh since they will always exist in your game anyway.
Casting to skeletal mesh in the bp will just let the engine load what it needs to know about skeletal mesh, it will not load your SK_Elephant
How do I make phys constraint go back to a specific rotation when something is not pushing it
There should be a drive thing under the options
how do i make a skeletal bone follow a camera?
ik chains and setting target positions
with great difficulty, avoid if possible
sadly i really don't know unreal TT
then the answer is: avoid showing it that way
its a third person only game 💀
im in way over my head but i really want to learn
i dont understand the actual question, is the problem
do you have any tutorials you send?
im trying to make the lower spine bone follow the camera
but my brain to square to understand
i mean, is that a character controller?
you just want the turn the character to a new rotation?
yes
idk how to check TT
so, you dont have the ability to move an individual bone
you rotate the actor, and play an animation
which should already happen, if you are in control of it
and bind the default controls
ohhhhh then yes its a playable charactor
im sorry if im annoying you
Do you want the entire character to rotate when the camera does? Is that all you're looking for? So they can strafe?
Or are you trying to get the character to look/rotate it's upper body when you move your camera?
no i want the lower spind to follow the camera
YES
ok i see, so a look animation
It's complicated. I'd save it for the polish stage once you've got more of the game built and have had more experience.
fair and smart
Unless you REALLY want to do it now, then look up a tutorial on Youtube for getting the character to look in a direction and apply it to your use case.
https://www.youtube.com/watch?v=8skq8t_Fffk - This will get you started. But it's not an exact tutorial for what you want, so you'll need to take the concepts and apply them to your use case.
Hello guys, in this quick and simple tutorial we are going to learn how to make a the AI look with its head at the player in Unreal Engine 5.
↪️Join my Discord Server, NOW: https://bit.ly/GorkaGamesYouTubeDiscordServer
👉Awesome Unreal Engine courses on Wingfox: https://bit.ly/GorkaGamesWingfoxHorrorGame
Check out my Steam Game! https://bit.ly/3...
thank you for helping me atleast
doing it for the whole upper body is going to have consequences that make it even more complicated
But if you're JUST starting out in Unreal I'd spend your time on the bigger picture things. Getting bogged down in polish and details can really hinder development and lead to burnout really quick.
that's not tha difficult?
find look at rotation already do most of the heavy lifting
i am, sadly
just make the head look to origin again when the rotation reach certain treshold so they dont break their neck
Which is great! It means you have a ton of small wins ahead of you that many of us don't have the luxury of attaining anymore. lol. It takes a lot of us a lot of work to get that dopamine hit you'll get just doing something simple. : )
He wants his upper body to rotate in the direction he's moving his camera. It's gonna be pretty complex for a beginner. He'll need to be doing a line trace from the camera to get a point on front of it for the bones to rotate toward. Then he'll need to determine a clamp so the body doesn't rotate all the way around.
And without some additive animations going on it'll feel really stiff.
So while, sure... it's not all that complicated, I was simply suggesting focusing on gameplay and not the details.
its super easy to get bogged down on any specific visuals
smart, there are a lot of other things i should focus on like adding footstep audio
"realism"
but i mean, if its a boxing game, well ;D
DING DING DING
we've got a winner
i've seen other fangames use official models and not get any repercussions for it so im not too worried but i'll be careful
It’s just a cautionary. Game devs don’t always hit people. But you could be the odd one out
fan game = free?
yes
then yea who cares tbh
thats a fnaf thing, if you want to make a fangame it HAS to be free
That’s still very cool. I know a fnaf lore whore who follows all the fan games too haha
if you have to take it down, ok replace the models and republish
I mean fan game should always be free
thats what im saying
ya but this fangame is just for the funzez
thats the only reason im giving this advice
otherwise it would be "no, do not steal art"
i really don't care if they want the game gone, i'll take it down in a heart beat
I’d definitely start small like they said a bit ago though. I was jumping in and trying to polish too early and realized I needed to just get mechanics working.
i know and thank you for the advice
Now my top down 2D shooter is just squares an arrow and a circle for projectile XD
bru
i mean that is quite a bit working, if you can move at all
but the character animation might be real real high up on the list for next ;D
i guess its all style dependent though. so.
I have movement. The pawn looks at the cursor. And you can damage things, die and get random drops from the enemies. Etc
It’s just the core stuff so far though and it’s not done yet.
Just a small project I wanted to make to learn the engine before my big project.
Also @quiet violet if you want help with anything lmk. I’d like to help if you want. I’m new to unreal too but I catch on quick 🙂
sure
Bet. I’ll add you 🙂
added
Still have had no luck in fixing this. I don't see anything in my uproject file which could cause the SkeletalMerging plugin to load late after the blueprints
{
"FileVersion": 3,
"EngineAssociation": "5.3",
"Category": "",
"Description": "",
"Modules": [
{
"Name": "SabotageGame",
"Type": "Runtime",
"LoadingPhase": "Default",
"AdditionalDependencies": [
"AIModule",
"Engine"
]
}
],
"Plugins": [
{
"Name": "ModelingToolsEditorMode",
"Enabled": true,
"TargetAllowList": [
"Editor"
]
},
{
"Name": "StaticMeshEditorModeling",
"Enabled": true
},
{
"Name": "GeometryScripting",
"Enabled": true
},
{
"Name": "AnimationBudgetAllocator",
"Enabled": true
},
{
"Name": "SkeletalMerging",
"Enabled": true
}
]
}
I found a similar thread from someone on the dev forum, but no solution was found https://forums.unrealengine.com/t/corrupted-blueprint-nodes-related-to-a-plugin/473212
AHA! If, rather than worrying about plugin load order, I change my game's module load order from Default to PostDefault, the issue is fixed. But that's only fixing the symptom I think. There's some race condition somewhere that is causing plugins to load in the wrong order even though I don't have anything weird in my project file, and that hasn't been fixed by just moving the game module from Default to PostDefault
I know this post is old, but does anyone know what gorgeous font is being used in that screenshot?
he might actually have the answer, you could additionally use this site, copy the image and paste it in here. Find one that's similar and then google a free download for it.
life of writing async functions in blueprint because Epic refuses to add real local variables to macros
anyone know why it looks like the door is absorbing the light?
What macro? That’s a BTT
And why are you using only the failed pin of the AIMoveTo, what sort of hocus pocus is this?
because it's pointless to collapse to a macro when I'd have to do the same thing (drag all of the pins across the whole graph). And oops that part after the finish execute should have been hooked up to path success
Pretty sure you can still promote those to normal variables and use GET if we’re talking about code cleanliness
I don't want to have global state for something that should be a local variable
I could replace all of my C++ local variables with global statics. Should I? No
same for blueprints
and there's the added issue that BT task variables can be shared across multiple AIs
I think you have to make them shared for that to be a problem iirc
Way I see it tho, you have other problems there
For instance, you’re putting everything in one task when you should have one task to find your target and a separate task for the MoveTo, and use BB keys to pass the info along the tasks. There’s also a built in MoveTo task, tho that may not necessarily work for your case.
#gameplay-ai would be better at dissecting that code but imo that would help your code org a lot
So you can avoid the spaghetts
BTs have even worse organization. Blackboards are shared across even subtrees, so using a blackboard key for minor bookkeeping is going to quickly inflate global state
and then for any object pointers you have to cast each time you move between nodes
🤔 Why would you need to cast each time?
because get blackboard value as object is an untyped UObject?
I mean sure but you can just give the next task the BB key if it’s a target actor, it doesn’t need to know what it is. Again, you’re better off debating this with Luthage in #gameplay-ai , she could prly explain this stuff better
behavior nodes in behavior trees are definitely intended to be rather atomic by design
complexity comes from the arrangement in the tree
this BTT is doing too much
also blackboard isnt global state...? but it certainly represents the state of the tree.. You shoudnt put data in the blackboard that isnt used by other tasks
Wasn't there the option to allow sharing data with different BT instances?
Via the BB that is
That would at least give back a reason for putting stuff into the BB even if only used in one place
i am not suuuuuuuper familiar with ue's bt (but have a lot of experience writing whole behavior tree systems from scratch for other engines) but i seem to recall that there's essentially a "static" kind of variable that you can set for all instances of a BB
but i may be misremembering that x_x i havent really dived too deep on that sort of stuff
imo though, if the data you're trying to store isnt going to be shared between nodes, it doesnt really have to go in the blackboard
lots of nodes in a behavior tree can have internal state (like a selector or sequencer) so that as you tick the tree, they can iterate over their children for example
Hello,
is this the right channel to ask questions on BPs related to morph targets, sequencer, and similar stuff? As I'm facing issues with trying to expose morph targets on sequencer via BP, I want to make sure I'm asking in the right place.
Kinda. There is also #sequencer
well, considering it's early-intermediate beginner stuff (I think) would it be best to ask here or there? I've done a search before but I couldn't find similar issues
don't ask to ask, just ask™
Worse thing that can happend you will just get routed somewhere else
Perfect
Let me preface that I'm doing this for personal projects, I got a character off artstation that comes with morph targets. Said morph tartges also control part of the clothing and I wanted to control directly via a BP in the sequencer while say, for example, I assign different animations to the skeletal mesh. I tried an animation blueprint for the morph target that lets me use them in the sequencer but obviously I can't animate the mesh this way. I was trying to use a character BP for this but I think I'm stuck on how to call the mesh correctly. There was a thread on the official forums that actually explained it but the accompanying video was set to private so I'm not sure what I should do.
Why can't you animate in the sequencer?
you will have access to the skeletal mesh's morph
bp and sequencer is apple and orange imo. What you do in the sequencer is contained there, the bp just play the sequencer
I need to access the morphs directly from the sequencer, and I cannot do that if I put the mesh, and for example, I want to put certain morph target default value which is different from the default value of the character
but you can?
Is it possible to make Mouse Click and Mouse Over events to use different Trace Channels?
I'm using Mouse Clicks for movements (top down game) and they should ignore Units Capsule Components, while I want those Capsule Components to fire Mouse Over events. But both seem to use Visibility channel by default. I can change that to any other channel sure, but they will still use same channel.
@ocean holly These are all morph targets
I animate the character talking entirely in sequencer
@frosty heron Yeah, sorry I wasn't clear enough. my problem is setting up the BP like that. the animation BP was set tp something like this (with the value of the morph as variable)
@ocean holly same with me, it's the only method to see morph target in sequencer as of now if im not mistaken.
Make sure you set it to instance editable and expose on cinematic
Ok at least I got this part right!
The problem (which I assume is something very beginner level) is setting up the character to see this animation BP. Should I set a character BP and that's it? Because if I use the mesh directly I don't even see it.
You can create a character bp that have the skeletal mesh component uses the anim bp you set up
I really apologize for my ignorance...once I added the character here should I do something else?
you need to make sure that the mesh uses the anim bp you set up
in other word, this class here
I wasn't doing things wrong then...but I don't see the AnimBP in the list, just the character own post process BP. Is it a matter of naming?
where are you looking?
You want to go to your Mesh component (character mesh0) and set the anim instance class in the detail panel
@frosty heron Ok now it works...kind of. For some reason if I set the default value in the BP it shows correctly but in the sequencer, despite having put the variable as I said before If I try to change the values it does absolutely nothing...
I don't know what you have on your end
have you tried to animate in the sequencer? if so , show a picture of it
As you an see the variable with 0 represents the part of the morph that I want to edit but if I put it to 1 I don't see any modifications. However if do set it here and recompile the character BP it shows them correctly
Show me NewBlueprint
and go to the detail panels of the skeletal mesh component and screen shoot that
show to me that you have set the anim instance class there
Ok just a sec
ok I also notice something
you must have an animation running for the morph target to work
@ocean holly if a key is run inside the red box I highlighted, it will not work for me
But now I noticed something... if I apply any animation to the "CharacterMesh0" it does nothing
@frosty heron I tried it in a fresh project and the morph target works (I think something broke in the old project). But selecting the animBP doesn't let me use the animations, in the sense that if I add an animation track nothing happens.
show a picture
@frosty heron This is the sequencer and the BP set up
Try adding a key, to your suit leotard, make it 0.5 or something and play from the start. if that doesn't work. I am out of idea sorry. I can only say what I think I did
Yeah no worries, thanks for the help
I want to make skin stealer but something is wrond can you help me
You first ask the server what costume is the target acor is using
Then server set the mesh and that's it
and what exactly is wrong?
you have to be more descriptive
the code looks like it should work (though not great for multiplayer)
I can't access the other player's skeletal mesh
Something is wrong after break hit result
And you said it's not good for multiplayer. How do I make it good
you are doing the trace on server, this means that people with considerable ammount of delay may missed the trace because it takes [Insert ping here] for the RPC to run on the server.
So in your screen , you might supposedly hit the trace but in the server machine since it doesn't necessarily see the same thing, you might end up missing it.
it would be more tolerable for the player if you just trace locally, then inform the server what you hit
perhaps the hit actor is not the target actor, print string to debug
then adjust collision settings accordingly
Can you be more specific. What I need to connect what to what
that's just spoon feeding and I have my own problem to sort out right now
That or you have some form of breadcrumbing.
my tracers don't hit clients player, what's the reason?
are you just trying to change the players mesh so they look different?
that's a little more complicated than that from what I can see on the internet. It I even tried to make it using resources and haven't been successful granted I'm new to UE5 but I digress. skeletal meshes are more than just the mesh that sits on top.
I want to access the skeletal mesh of the other player
I tried making it work, tried a few ways, but skeletal mehes are complicated from what I can tell, so even if I got it to work animations would likely be broken. From what I can tell there's no cut and dry way to make this work. Unless someone else can answer this I think my hands are tied. Sorry dude.
That's not an issue of client or not
networking has is not relation in this sense , that's just your Trace not hitting the actor
again, as I have suggested before, check your Collision settings
if it's a character, you can trace to the character Physic assets or you can trace againts the capsule component
I know, I just wanted to emphasize that this is a player, not an NPC.
it doesn't matter if it's a player or npc or anything
What is the best programming pattern to juggling with UI buttons? Like my mind is blown how to make it more dynamical without considering literally every possible switch from one to another. Or maybe I should look into Common UI and staking widgets? But generally biggest problem is how to decide which commanding buttons to show when having selected multiple units and also allow to switching ''type'' when units are already selected to allow showing command button of 2nd type of unit, as well as how to connect with that possibility of using spells for that type of unit (like if I click Q, the buttons visible are for archer (skills) i want to only get archers cast their spell and not all of units. Do I literally try to take care of every possible scenario with switches, something like that needs a manager (how could this manager work more or less)? Anyone could give any tips? I have some ideas how to do it but it's gonna take so much testing and checking every case to switch here, turn on here and turn off here. Unless this is way I'm looking for insanity check. Do I just brute force it?
the only thing the trace care is the Collision Query settings
if the one it's tracing againts doesn't set to block (in your case Vissibility channel) then it's gonna go through
Hey guys!
Is this safe?
And are async loaded assets automatically unloaded, once they are destroyed and garbage collected?
Cheers!
Yeah. Eventually. You should store the asset somewhere (e.g. assigning it to a mesh component if it's a mesh) or it will disappear eventually.
But why 2.3s?
Why not just wait until it's loaded?
Thanks! So in this case I just wanna play the level sequence trigger and after it unload it.
I have Blackfade
I just use the 2.3 in all situations.
but thanks !
i just want it as backup, so if the levelseq is not loaded, for what ever reasons. it does trigger it.
This magic number is not even a bandaid tho
Like what's the reason.
How do you do the black fade?
You can use delegate to check if something is finished.
With widget you can use OnAnimationFinished with sequencer you can use OnFinished
Verdana with lineheight 1.2
@frosty heron Thanks. I know that I can. It's a huge project and it's just the way it is now. But thanks anyway. Have a nice day ! 🙂
Hi, I'm a newbie. Does anyone have a tutorial or an example of QTE (frequent button presses many times)? I want to move a character from a sitting position to a standing position using QTE. But I can't find any tutorial or example.
Or maybe you have ideas on how to do it in a proper way
just record the number of key presses within the quick time event window?
It's not that simple., I want to play "standing up" animation when user is clicking button and play "sitting" animation when user is stop clickig on the button. And if user stopped clicking on the button, but started again clicking, animation "standing up" should start not from the start, but from the current position.
it doesn't sound complicated either
sounds like a blend space
you drive the blend value everytime the button is clicked
add the value on click and have some timer where it subtract the value
Blend Space and Blend Value are new things for me. I thought I could somehow use animation montage for that purpose. But thank you, I will investigate blend space. ❤️
@spare sentinel like this or https://youtu.be/It_HmGaTTPU?si=zLT3oTA8hJ-gxWRG
Assets Available from here: https://marketplace-website-node-launcher-prod.ol.epicgames.com/ue/marketplace/en-US/profile/PolygonBlacksmith?count=20&sortBy=effectiveDate&sortDir=DESC&start=0
In this series we are creating the common mechanics found in RTS games, everything from unit selection, AI combat, and base building.
In Part 23 we work on...
Bunch of similar on YouTube
The time it takes an asset to load will be different on each machine. You should play the sequence on the completed pin and fit any logic to that.
Any asset is garbage collected at some point when it is no longer being used or referenced. The sequence asset will automatically unload when it's no long playing and isn't referenced anywhere.
Also, in regards to a comment you made, if it never loads, then there's nothing for it to play. You'll get an access none error.
HI,In Unreal Engine 5, I have animations with a "camera bone" that extends from the root. I also have a movement animation with shakes for the "camera bone". However, when enabling "Use Pawn Control Rotation", the shakes stop working. How can this issue be resolved? Thanks in advance!
hey guys
hope u all having a great day
so i have a problem i just created a light bulb and a light switch and made the interaction with and interface the thing is i can interact with the lightswitch on off without problem but i also can interact with the light bulb it self and turning the emissive color on and off as well
any solution so i can only interact with the light switch Only
dunno if you solved this or already have a plan, but sounds like a job for loops
How did you know that ? I actually figured it out and yes I used like 4 loops. I was afraid of using them at first because they are loops but turns out these are quite light and it's not nested but on completed.
if the container can layout an arbitrary number of buttons, when you show the ui clear the buttons, then loop over the things you have selected, and dynamically create and add the button widgets to it
Yea I realized because my biggest mistake was that each ''unit'' was taking care of adding himself to the UI, and I took a try and instead of each unit handling it, right now HUD does everything, like takes all Selected Units and shows what is needed and in the way I want it.
nice
that was like eureka after it worked 😄
much easier to debug the code too, if its written in one place, and not being executed across different actors
It will also let me a bit of other things I was wondering how to deal with so i'm really happy
loops are op ;D anytime i am doing something more than twice in a row, i make it a loop
or at least consider it
just a reminder that they're expected to complete in one tick
yea I was anxious but then I realized what if I did next one on completed.. it shouldn't be so bad and well, it worked! 😄
i cant imagine you have 100s of selected actors at the same time in this game
keep track of what is selected in an array, as they become selected and deselected, then you dont have to iterate every actor
so don't put latent actions inside them (is what I meant)
Can you go into details with that? I have Selected Actors array that I iterate, or did you think I iterate trough every actor in the game? 😄
then you're doing it right, how i was describing 👍
Yay! 😄 thanks for confirming whole idea
is chat gbt plus better then the free version?
not worth chat gtb plus?#
yes, chat btg minus no no
Hey guys! Im working on my platform game here. Its almost done, but Im not quite happy with the distribution of platforms. I am using Random float in range, clamped with screen borders to define each platform location. But this random float for some reason only gives values that are super close to each other. So the platforms mainly spawn in the center. Sometimes they spawn on the sides, but I just do not like the way Random Float defines the spawn points. Here on the image you can several examples and on the right side I marked with orange color how I would like it to work. Do you have any ideas how to tackle it down? The only way I can see is to add a variable measuring the distance between the two platforms, and if it's too small, just run Random Float again. Maybe you have a better solution.
yeah, you need some sort of distance calculation if you need them to be spaced out. Maybe some line traces that get the distance to the next platform once the spawn is complete and if any result is too close, destroy self. Otherwise, #game-math might have a more elegant solution
Is this correct way to check the Array of Names and break loop if it finds 1st match and then it will set that first match as current type?
try making a loop that tries 20 times and have a rejection test to skip past bad ones. or you can calculate a float rating for each candidate location, and then pick the highest
You can also Return node your function after the set, it will stop the loop
but still need to break?
nope
"return" means "execution returns to the caller of this function"
like this?
perfect, and make it pure
and it's gonna stop when it finds first matching thing?
there is likely a 'contains' node that takes an array and an element, or at least if not there should be
Contains Item
aye, FindItem/ContainsItem
depending on whether you need the index or just true/false
Well, so I have Array of Names which are supposed to be sort as priority by player.
Let's say there is priority of:
Worker
Archer
Warrior,
but the player now selected only Warrior, so I need to check if it's not Worker, not Archer, and finally it checks it's Warrior and sets it as ''current''. Same would be if we selected more units and also would allow the player to switch which units he wants to display as firsts.
Do I need nested loop for that?
if you're trying to sort an array, cpp is better at that (TArray::Sort is a thing)
the way you are doing it is going to work, but look for the "contains" node which encapsulates the entire concept of the inner loop here
it will do the same thing, but is likely implemented in C++, so much more efficient but also just less annoying to setup in a bp
Hmm, its not working the way I want it, I will try to describe it once again maybe I will understand what I really want
loop over the array of tags you have pre-allocated to be in order of priority
first one that is contained, return it
done
or isnt there a "has tag" node, if these were actors you would call that
I dont know what I did wrong but I cant find the get gravity direction from the blueprints menu https://dev.epicgames.com/community/learning/tutorials/w6l7/unreal-engine-custom-gravity-in-ue-5-4
i dont see it either, but you can make a variable, and set it at the same time you call set gravity direction
works!
@steel star its a function inside a c++ I think? why isnt it there I followed the directions
google is saying set gravity direction is an unreal 5.4 node, and no mention of get gravity direction existing
If you have Unreal 5.4, you need to get the Character Movement Component and then get the gravity direction from it.
oh, this was just it being filtered out of the list ..
Alright...I'm missing something. I spawn an actor, then in the BeginPlay I rotate the actor, then I turn on the ProjectileMovementComponent. The ProjectileMovementComponent does not care about the new rotation at all
The projectile usually has a velocity. Rotation doesn't modify the direction in which it is travelling.
ProjectileMovement calculates the velocity before activated?
even free chatgpt is without limit afaik, i havent hit it
the version 4 which cost is much better then the free version 3.5?
neither are good for unreal
isnt there now a 4a, which doesnt require plus?
You uually give it a velocity or an initial speed. If you give it a speed it treats velocity as a normalized vector for the direction instead.
why is chat gbt not good for unreal engine?
if you want to try it just make a trial and cancel it
Because it's a large language model that is only predicting what text comes next. It doesn't actually know what it is doing, so unless you know what it may be doing wrong, you'll get wrong answers.
but its unlikely to be able to answer unreal specific questions that go beyond things covered in actual unreal documentation
I give it a max speed and speed as defaults in the actor when it is spawned, but it's not ready to activate when spawned. I have to do a few more things. Is there a way to make ProjectileMovementComponent redo the velocity calculation before I activate it?
i use it to figure out the terminology when i dont even know how to search documentation for something
That said, if you know what you're doing, ChatGPT can be a great resource for doing some heavy lifting as you can then correct it when there are problems.
If you set the speed, then you can set the velocity to a normalized vector for the direction.
It basically agress with anything you will suggest to it and it's not gonna come up with anything better or correct you actually, at least in my case. It can be helpful to wrap your words if you have problems with writing detailed texts, but generally it's shit and misleading, just have in mind it's my experience when trying it for unreal. I'm not saying it's not usefull generally.
Hmm...Okay multiplying the vector by speed works, but setting the initial speed in the component does not seem to work
Also 4.0 version of gpt is free now but with limits of answers so why not try it and see yourself. @spare sentinel
When instantiating a class, is there any way to have a parmaeter in the constructor?. For instance, int he ^ blueprint I want to pass in a String parameter, but I don't know how
maybe this is more of a multiplayer question my bad
what is the point of local player save game if it doesn't persist other players saves after reload?
You can make a variable instance editable in its details or by clocking on eye sign
Exactly, I use it to spitball a first approach to something if I'm totally clueless.
For example, I barely passed my thermodynamics and fluids class in college. I'm making a physics engine that has to handle compression and expansion of gasses. I used ChatGPT to shortcut to the general "shape" of a function to do reversible compression on a gas volume, basically "What would the temperature and pressure be of this volume if compressed by this ratio". It just saved me a bit of math work really.
i did,
why is the iteminfo not showing
there's "expose on spawn"
that will also give you a pin on the construction node
got it, ty
Question. Years ago I made choppable trees in a game and I used the foliage brush then swapped out each foliage instance with an actor I could interact with when I begin trying to chop it.
Is this still the best way to handle foliage like this? Or is there a better solution these days with UE5 that I'm unaware of?
It's probably the simplest
It's probably still as valid as ever. There's also a built-in plugin "lightweight instances" which might be useful for these things.
But I've never used it myself.
It all depends on what you need
Do you need "a daisycutter just dropped and I need these 1,000 trees to fall over"?
or just chopping 1 tree at a time
Just a handful of trees at a time. It's also top down so I'm kind of thinking between frustum culling and some optimizations on my end, it might be fine just to paint actors right into the level.
This is your vision range, so I'm pretty sure I can afford having 20ish actors on the screen. They won't be running on tick until you interact with them, so it should be pretty cheap.
Thousands.
They'll be loaded and unloaded as you leave areas. I'll probably use level streaming.
If you set the speed, you need to give it a normalized vector (meaning X Y and Z will be a value between -1 and 1) in the velocity field so it knows what direction to go in. Otherwise you can do what you've done and directly set the velocity to the actual speed you want on those axes.
any loop over actors becomes that much slower, i guess its a matter of what main thread timing you can hit
try it out i suppose
If they're not running on tick, then does it matter if they're sitting there?
Yes. There's still overhead to actors simply existing, even if they're not on screen.
generally i think of numbers like "200, 400" as reasonable numbers of actors to have alive at once, but this is really more in a unity engine context, im new to unreal
yeah... 450 of them dropped me from 80fps to 55
For context that was running a listen server with two players. But still. It's a noticable hit.
I'll set up the foliage method AND use level streaming.
Is there a way to set an actor BACK to foliage after it "respaws"? Or should I just deal with the overhead of whatever the player interacts with during a session?
time to read up on the foliage system, which i have not myself, ;D
What is doing the original Foliage -> actor transition?
have that thing keep track and put things back
It's been a few years since I set that up, so I couldn't remember if it was possible. I don't remember putting it back, so I wasn't sure if it was possible.
I'll just get to work and stop asking questions now. lol
sounds like something that could easily require custom C++ additions
Nah. You can grab individual instances from the foliage actor. I know that much.
I would probably have some FoliageManager thing that owns the foliage and the actors representing them etc, then you can easily keep track and put the tree back to being foliage if it didn't get chopped.
oh, nice
Honestly I'm gonna check the marketplace for a solution before I get my hands dirty. I've learned that a few dollars is often better spent than a few dozen hours of time.
I've learned the opposite.
Lol Well it depends on what you're spending the few dollars on.
most plugins seem to be pretty opinionated and it can be very hard to get them to play nice with other systems
Depends on the plugin though. I'd never ever buy a "game mechanic starter pack" but a very self-contained system could be ok
Yeah. That's basically the plan. It's rare I find exactly what I'm looking for and often just do it myself. But I'd rather spend 5 minutes searching just in case.
https://marketplace-website-node-launcher-prod.ol.epicgames.com/ue/marketplace/en-US/product/foliage-plugin - Something exists at least. Not sure it's worth $40 since I can probably set it up on my end in a couple hours...
perhaps make sure first you can represent your scene as you want it, with foliage
ie to compare to that earlier fps hit
for the widget item called "Uniform grid panel" is there any way to set the number of columns / rows? Bcuz rn its two rows and I only want one.
How can I make a viriable look like this ?
right click on its target gravity actor pin, and promote to variable? i dont get it
right click, convert to validated get
I created it the variable but I cant get those options to show up
ive never seen that node before that just says 'get' you can use a "is valid" node and connect anything into it
its from there https://dev.epicgames.com/community/learning/tutorials/w6l7/unreal-engine-custom-gravity-in-ue-5-4
It's from right-clicking and choosing the "convert to validated get" option
I dont know how to get the varible
As mentioned above
drag drop the variable from the panel that lists them, onto the blueprint
choose get
connect to a 'is valid' node
that won't give them that node
it's a solution sure, but not for what they are wanting
If you want the thing on your screenshot, drag your variable into your bp, right click it and select the bottom option
it looks like that when I do
No, you need to get it, not set
Then you'll be able to right click and select the validated get option
oh ok
@somber vector thanks!
im going to go to the bar get some food and drinks and come back
No problem, although I think engage was the first one to give the correct answer:)
Enjoy your evening!
Hey can't find the item base variable type
Have you made the item base class?
nope I'll do that now
If you're following a tutorial series, you probably want to start at the beginning. Creation of the ItemBase object is the first thing done in the first video of pattym's tutorial series.
i did but i mustve missed it
Hey guys. I'm having trouble that the owning player save (SveGame) is not valid. How do I make it valid?
These are the errors when I remove the isvalid statement.
By ensuring there is a value set in the "Owning Player Save" before you access it.
Unfortunately "Begin Play" of one actor can happen before the "Begin Play" of another, so if you happen to be loading in BeginPlay of the BP_Player blueprint, that's no guarantee that it's set before the Begin Play of this actor.
Ah I see. I want this to be called only once so should I move this section to event tick with a do once before it?
Yea, make sure you start with part 1. 🙂
Definitely not.
You want to do something when the save is loaded. So you can check if the save is loaded, otherwise, you need to know when it is loaded so you can continue from that point - you can use an event dispatcher that you call when the save is loaded and other actors could potentially bind to it so they know when it is ready.
Add an event dispatcher to the player character that is called when it's finished setting the save game object. On the actor that your trying to access the data from, if it's not valid, have it bind to the event dispatcher. That way you can have it call the relevant function when it's finished.
Thanks, I'll try it now.
Hi all
I'm trying to "Spawn" multiple "Actors" at the same place after some seconds
But when I do it the "previous" spawned actor is destroyed, I don't understand why
Thanks everyone I got it working!
are you sure it's the previous one and not the new one being spawned?
Show your spawning node
I'm sure that the name of the spawned actor is changing from "Actor_01" to "Actor_02"
especially your collision handling setting
"Collision Handling" is "Always spawn, ignore collisions"
and maybe a screenshot of your Outliner where you searched for Actor_
Should be in the details panel, no?
It's ok thank you all I just found that I had a "Destroy Actor" somehwere in my code.. sorry :/
hey. im working on a 2d platformer and im trying to recreate the jumping from the foreground to the background level element from, mario wonder, mutant mudds, and yoshi’s crafted world. how would i do something like that?
I want to change cameras based on the player state. Lets say the player is using a workbench and I want the camera to point directly at the workbench where I have (or will have) various interactable elements. Should I keep all cameras in BP_Player or is it okay to have a separate "workbench" camera in BP_Workbench too?
It sounds like a pretty straightforward thing to do but I've spent quite some time trying to figure it out and it doesn't seem to get me any closer to what I want to achieve.
🤦 why?
I have an interface that allows me to reference the pllayer, but for some reason the bp above returns none when trying to access the player actor.
Can you change an items index in an array?
how is Player being Set?
understand that it'll overwrite the current element, so you will need to cache the initial value in a temp variable beforehand if you're swapping
That last part is what was messing me up thanks
Do you have plugged Player reference inside this interface ''event'' inside Player Controller?
why even pass the ref through an interface before saving it?
btw you could just cast to BP_Your_PlayerController and it's faster than using interface
I mean at the very least it prevents you from passing nullptrs as refs to your other interface
I don't know. I read/heard a hundred times casting is expensive and I got into a probably bad habit of avoiding it
It's the tutorials, I was the same like this 😄
I'm fairly new to unreal. I believe what people say :/
cast costs are irrelevant for you.
let me try just casting it.
Casting is free. Just casting. It's the problem where you are casting. If something is already in the level like Player State, Player Controller you can rather cast to it without thinking. You just need to avoid casting from Player Controller to things and holding big assets there.
also
please watch the pinned bp comms live training if you haven't already
it's long but worth every minute
I have a huge problem referencing stuff. I've been working on improving for the last couple of weeks but I just feel dumb when I need to reference something.
Take deep breaths, cast there, check that it works and then go watch video about bp comms, I might do it too just to remind myself
I know it's nothing scary and is a very simple concept but still I keep doing it wrong.
it's cause tutorials out there teach it in an ass-backwards way, putting the cart before the horse
I'm not really using tutorials anymore
did you watch that video I mentioned?
that is the single best resource to understanding cast, interfaces, dispatchers, etc.. I never truly understood casting until I watched it tbh - even though I thought I did
not yet, I'm going to try and get it to work with casting and I'll save the vid for tomorrow. It's the last thing I was supposed to do today as it's 1am already. I'll definitely watch it
https://www.youtube.com/watch?v=EM_HYqQdToE - that one?
Announce Post: https://forums.unrealengine.com/showthread.php?101051
This Training Stream takes a look at Blueprint Communication. We find that Unreal Developers of all levels can sometimes struggle through the concepts behind moving data between objects. So in this video we'll take a look at the different ways to make Blueprints talk to one an...
cool, saved
at least watch it first before you ask questions, there will be questions anyway but at least you have some fundamentals to work on, if after you watch it you still have questions, its cool, sometimes you need live discussion to process
oh yeah that's for sure. I don't want to be a bother to anyone if there's a vid explaining what I don't understand.
apologies.
once you get a handle on bp comms, it'll make all this stuff easier
dont aplogize, it's all good
to activate a cam I need to deactivate the old one->activate the desired camera or is there a toggle or something?
is what I meant
and don't be afraid to ask, it's how you learn and also I sometimes write myself and then in the middle I finally figure something because describing it ''out loud'' to someone made me realize my mistake
what does the Note say
BP_Player is my player
and that's not where the cast goes. you swap that funky interface that you plugged the player con in, for the cast
so a 3rd person char or what?
can't recall. it's the point and click one, top down I guess
ok, when you open it, what does it say at the top right for Parent class
oh and that camera change thing I posted above is not in the BP_Player but in the bp_workbench
it says Character
yeah, so you can't get the Controller and try to plug that into the BP_Player ref, they are not the same thing
yeah. the controller is BP_TopDownController
k so if you need the player character
you use get player character -> cast to BP_Player
You then set the return value to Player
that makes perfect sense
and it even works
curious
what does that mean?
popped up in my game window when I changed the cams, never seen this before.
(it worked btw)
you're using a lot of heavy assets probably. Did you download a bunch of Nanite level stuff from Quixel?
try to bake your light maybe
holy crap camera swaps can be intense
I'm using the metahumans model though
this has helped in the past too https://youtu.be/uk3W8Zhahdg?si=HcVxf_MDHLdurklx
This time on Unreal Tips & Tricks, we look at how to manage the Texture Streaming Pool size to take advantage of more video memory, or VRAM. By doing this, we can avoid going over our allocated VRAM budget for streamed textures and MIP maps. We'll also take a brief look at how to modify multiple textures at the same time.
For more details, plea...
I gotta say BP start to slowly "click" for me. but I keep feeling like I'm not using it "the right way", or that I'm not utilising all tools it offers (eg. interfaces)
I guess there's always time for refactoring but I need to get in the mindset to just get things to work for now.
good building habits are important, but refactoring is life nevertheless. Perseverence is key.
I think I called "it's working" a bit too early. something weird is happening and it doesn't look like the desired camera got activated
from experience I know it's gonna take time before you really figure things out but more and more things will keep clicking, but they will be clicking almost without end 😄
I'm having some difficulties learning new things, and I have the terrible habit to always try to "do things the right way" which is just slowing me down.
because I never really understand what the right way is
It'll come with time I guess.
at the start it's really important to jsut get familiar with things and try to get grasp of everything, then after getting some portion of knowledge, go and build something with this, after you build, go again and watch some more things, watch things you watched again, ask questions and then again try to hit and build some things
hello i have an exploding barrel which on shot at , fires a take radial damage used to kill any enemy character nearby . But I wanted to also affect other barrel in the vicinity from the explosion. Which doesnt work
yeah, the right way is the way that works, you can optimize later as needed.
there is gonna be a lot of iteration of things you build but it's good because you are progressing, also its good to really protoype shit things and then you know what you need to connect to what and rebuild it so it works together
is your barrel a Vehicle ?
Completely agree.
Ok I made a mess with the cameras, I'm gonna read up on activating and deactivating them.
watch live training first, don't skip fundamentals 😄
set view target with blend is a thing.
tomorrow. I need to catch some sleep soon, son's birthday is tomorrow 😄
no
is your barrel set to block visibility?
yes i did
is this checked on it?
event anydamage
oh right, and before that?
in blueprints is it possible to pass in a reference of "this" like if im in an actor and i gotta like return myself how do i do that?
and you have one of these on your Barrel actor, right?
(an instance to myself)
actor reference
self
what you doing there?
but returning to the caller, the caller just called you so already knows
Ok so I have a struct with a value called TSoftObjectPtr<AActor> itemRef; so a soft actor object reference
drag the variable into the graph and plug self into it if needed
and I'm tryna pass myself in
(in blueprint)
the struct was created in cpp
using it in blueprint
try putting 2nd barell closer to the first one
its very unlikely you want to use TSoftObjectPtr
I mean, so im currently in an item class
and since there can be a lot of items
i figured its best to keep it soft
and then it'll load when the player uses it
who is allocating the struct
yes , which is shot at with a line trace that is applying damage.
who is calling "make struct" node then
show more of the code
the blueprint BP_baseitem is calling the make struct, I'm passing in a reference of my self into that struct
its all in one class
alright, so then whats the issue? that sounds fine
like I got class defaults like the name of the item and whatnot, but I also need to pass in a reference of the object, but I can't do that for some reason
here llemme show u an image
like
what do i put as the item ref
ok this is all happening in blueprint assets, not with blueprint nodes
and i cant tell which way you want to do it
🤷 i dont care mind either method, I just wanna pass in an instance of myself
any damage in barrel
okay forget the struct, i wanna create a function that s called "getSelf" and all it does is return a reference
then you need to use the blueprint designer, that property grid / inspector is just for setting defaults, and there is no "self" asset
part where radial dmg is applied , works fine on the enemy character
why? Self exists
is that a node?
yes, get self
does it print anything? set that draw sphere to have line thicknes so you can see where is epicenter, also what is pluged into Origin?
ty for the help
that's what I was pointing to in my first response lol, I guess I wasn't clear enough
Sorry if this a dumb question, but how can I make a sphere trace stop tracing when it hits an actor?
uh, are you tracing on tick or something?
thats exactly the purpose of a trace
give the actor collision setup to "block"
it needs to block whatever channel your tracing
idk the way that question was phrased was confusing to me
idk about stop tracing, but you can get the hit actor if it's blocking
i just assumed they were looking for a hit
Thank you both
epicenter is a scene component
does it actually take any damage ?
as far as things fire off, you can check if the event is actually firing the anydamage, and is the hp display on tick ?
i'm guessing the other barrell is supposed to explode as well ? @queen ore
What does it mean to "stop tracing"? A trace is a single shot
there is no duration to a trace really
Hi. I'm back. I'm looking for a solution to using a foliage instance static mesh to find a corresponding data asset. (spawning a resource actor from foliage when interacted with).
I'd love to use some sort of tag or enum system, but that obviously isn't built into the basic foliage instance static mesh.
Any ideas? I'd rather not do a series of branches for each resource type.
What is your initial source for what foliage goes where?
Are you painting in editor?
I think foliage has a per instance custom data somewhere right?
Painting for now. I'd like to experiemnt with the procedural tools though.
per instance custom data... I'll check. That would 100% work.
I mean worst case you can just have a mapping of mesh to data asset or whatever
SM_Tree -> Wood
SM_Rock -> Stone
Not that I can see.
But that would mean a bunch of branches, right?
nah a map
map container
Oh right.
Durh
Yeah. That's actually a good solution. No custom data from what I can tell.
Idk why I didn't consider a map. This is why I came to the professionals. XD
ok so i found where the issue is . its got to do with adjusting the radius of the radial damage . The code works fine , its just the barrel close to it wasn't getting detected.
When in doubt, make the numbers so big it HAS to work, then dial them back
Always this. lol
This was so much cleaner than I was originally anticipating. lol. Thank you.
this is my current value , its hard to say if i shud go low or high. The order of explosion is always the say tho
draw debug sphere same radius and location
tune it to taste, it's your game. You decide how big an explosion should be
inner radius same as outer radius might be a problem but 🤷