#blueprint
1 messages · Page 222 of 1
idk how but filling in actor just any actor actually just fixxed it
that was so weird cuz i dont remember this not working like ever
Ue5 Peak
Any idea why I can make an eattachmentrule enum variable in a blueprint, but in a struct, It's not available as a variable type? Tons of other enums are, but not that one
My set percent function is working in breakpoints but no matter what in my HUD I can't seem to get any progress bars to update. I have made idk how many games I understand how progress bars work, I am lost I can't figure out what is so wrong my bars won't update at any time in this project.
When I update values the percent correctly calculates in my breakpoints but in the HUD it never changes
Where else can I look for an issue like this?
If I put text the text values change
just not progress bars this time bro I'm dying
Nvm I put text below at the same time and it looks like for some reason there's one stacked on top of another. That's a direction I can go with damn
Yeah there was 2 HUDs being created my bad
Probably running it on some begin play for mp
Or in some character bp that isn't filtered by locally controlled
Got several huds overlaying?
Also, encapsulate the logic inside the widget
I did
Dont let an external actor define how they update
It's fine I had the call to create HUD inside the BP player
Instead listen for event dispatchers
Guy my entire widgets are MVC
All my values are delegates
I had just forgot when I set up this project I did a quick throw together a HUD to show health values
and now I made the real widgets setting this up properly I forgot to not call create HUD in BP so I called it once in BP once in C++
Yes that was the whole issue was double hud
I deleted the function out of BP player it works just fine
Perfecto
Any people in here good with UMG?
you can try ask in #umg
how to work with elements in array of a Input Action ? Thank you for hepls
Well can I ask first why move forward and move backwards are two different input actions?
You're doing it right like you have move forward with different options for key inputs
but you can just make it IA_Move and add those move backward keys there, and negate the values
But to your question I don't understand what you're asking either
wait
what do you mean array
actually, i want create ReBinding key Mapping feature for player can change input in setting, Some input action can have many key, so i need able to change which key instead just one key and remove rest of them
Oh I don't know anything about rebinding sorry
Ah there we go. Thx
You want to look at 'Player Mappable Key Settings.
This article shows you how to set up a simple UI in your game which allows the player to customize the keybindings using the Enhanced Input System. We will set up a UI which automatically gets the list of all available player mappable keys, and displays them in a list where the player can configure the bindings.
I am having a game mode where you control a VIEW camera - i was accomplishing this by having an ACharacter base class that has the cameara angled desired - allowing for AddActorWorldOffset(...) while maintaining Z height relative to the landscape it is walking on top of... which gives appropriate height offests when moving up ramps, climbing ladders etc (Think XCom camera follow on a controlled pawn).
The problem i'm facing is the camera actor moves REALLY slow (expected) when climbing elevations. How do I make it so that the camera wouldnt have this physics lag when climbing elevated landscapes? I"m looking in the CMC and found this - thought it was the culprit but it is enabled by default... and it is worse when turned off. I literally want ZERO phsyics applied when climbing elevation - if this is even possible?
You could force update the Z?
would this be on the CMC?
i dont know thats a viable solution - going downhill - there is 0 resistance. its only uphill. there has to be some calculation on slope - i'll look into the CMC coding - may need to extend the class and override funcitonality
Let me check xcom then. Sounds like i misunderstood the issue
Sounded like you wanted constant movement regardless of elevation differences
i do know that XCom has the same functionality - but they really have just a set height in Z as far as the camera goes
100% correct
that boolean on the CMC appears to be the requested behavior - but it is not reacting as i'd expect it to :/
Yeah that ignores Z
In its velocity check/limiter
think i used a floating pawn for my rts camera
cmc sounds rather overkill
checking now to see how it behaves...
how would you handle dynamically changing z height? IE: going over hills/elevation changes
i was relying on the CMC + Character class to perform this
with the Camera boom driving it.
it just seems added overhead
but this is a single player game
not much goign on
might be worht hte sacrifice
me doing it manually is likely cheaper than the boom 😛
since i dont care about collisions etc
Hello people!
how has your day been?
RL work getting into the way of my private life development time .... story as usual 😛
how bout you?
Would anyone here by any chance have a little bit to sit down and help me with a really minor issue I'm having haha
I think I'm staring myself blind and missing something obvious.
Well nevermind
I fixed it in the process of trying to test it again
by restarting the godamn engine...
Hi everyone,
I am experiencing a issue with my post process vignette to signify to the player that he has taken damage. Now, the begin visual function is working because it is showing the red vignette I specified but the end visual part is not working correctly because I would like it to fade out. Basically, I put it on a set timer by function node so that it can call it based on how much damage I've taken. If you can let me know what I did something and explain what I can do better on some parts of my code I would appreciate it 👍.
Do you when when the "On Interrupted" is called?
i was sure my pawn reacted to landscape elevation but not at this iteration it seems!
if you have an equation that includes random integer in range and use the equation to set two different variables. Will the equation result be the same for both if run on one line of code?
thanks for looking - if you dont mind let me know how your's behaves on steep inclines?
if you use the SAME RNG CALC node - yes
if you duplicate it - it will calculate 2 seperate RNG's
awesome
yea that makes sense and what I figured would happen. thanks for the confirmation
it doesnt at all atm. Setting up a camera manager to see how that works out
seems like xcom mostly alligns it with the cursor height, but they're also doing mad stuff about the angle (probably level constraints)
i'll load up a game here this afternoon - but i remember being able to zoom in/out. Dont know the engine but it mimics camera boom functionality.
I'm mostly concerned with getting past the hurdle of steep inclines going x/y slowly (physics). Again -i'll probably have to look into custom CMC code to pull this off.... shouldnt be that hard to track down where the ***AddActorWorldOffset ***comes into play
Hi, do you know how to get in which function a warning took place ? I would like it to behave like errors.
I do attachments in many functions so it's hard to know where the warning came from:
Anybody know to make player detect on which material of a landscape is put on?
Hello all, I would like some opinions on where a Players "shared/replicated" Target variable should reside in a multiplayer game . Currently I have it on the "PlayerCharacter" class but, I am thinking that maybe it should live on the "PlayerState" class?
Example use case; As a player, click on another player character and get their target. Call it, "My Target's Target".
Is there a quick way to run a function on all objects minus one?
Not within an array, but I have several objects of the same class that hold a property I want reset when another object gets modified
Event dispatcher possibly?
get a way to get them
The objects are all components within the actor so probably not an event dispatcher
Curiosity question, are you able to add content to a data table at run time or are they read only content?
read only
thank you
Those tables are specifically read-only
Thanks 🙂
HI!
Does anyone know how to fix this? When I change the light, it slowly adapts. This same effect is also breaking everything when i use VFXs, because it tries to adapt the whole screen light and it goes up and down, it's really annoying.
I think it's somehow related to exposure, but can't find it.
you have auto exposure on
For some reason no matter what I do, input doesn't trigger. The subsystem is added and valid.
No InputAction triggers ever.
is there any reason why playing a level sequence in bp would immediately cause lag, even if the sequnece is empty?
exploring hacky solutions for a problem I've been trying to figure out the last few days, any advice (even just 'no, that's too dumb to bother attempting') welcome
my enemy (using hte character class and movement component) is facing away from their target after an attack or being circle strafed or whatever. I don't want them to rotate in place or rotate sharply while barely moving, I want them to start moving at normal speed and turning in an arc even if it moves them further away at first.
Is any of these ideas at all viable:
EQS to find points to move to that will eventually get them turned around? I tried this and it was stuttering along the points even with what seemed like a fairly lightweight EQS, but maybe because it was moving, then doing a query, then moving, then doing a query? Any solution to that?
have a spline that it runs along with an appropriate curve until the target is within an appropriate angle for normal movement to work fine. only thing I'm iffy on is the possibility of overshooting the turn if it's not dynamic, but I dunno how quickly and performant-ly(?) a spline can be updated with an appropriate shape. I guess if it were a relatively short bit of curve that it just followed repeatedly that could work, but I again have no clue how smoothly that could be done. I'd have to figure out a way to make it not run into the environment, too, I guess.
I know, or at least strongly suspect, that root motion turn animations could do it (and the asset I'm using here does include those), but I'm not quite sure how to get that to play nicely with the rest of movement/not just end up with the overshooting-the-turn problem I'm worried about with a fixed spline
Anyone able to help? Im trying to communnicate between a widget and an actor BP, when the exit button is clicked i want the code in the actor BP to fire, instead of the input interact that is already there
Is there no way to iterate over a Set in Blueprint?
Make interface and send message with event you want to run
wouldn't you just put a custom event on the actor bp in place of the inputaction and then have the on clicked exit button in the widget cast to actor and trigger the event?
maybe use an interface if the actor isn't something you want to cast to?
maybe I'm missing something, I've barely touched widgets.
I am trying that but can't seem to get a valid object reference for the cast
If there's just the one actor in the world you could use get actor of class
thats worked, legend thank you
If this widget has the ownership assigned to the player controller that is utilizing these inputs, you could just use "Get Owning Player" in the widget which gives you a reference to the player controller, and from that you can get its controlled pawn.
i think there's even a "Get Owning Player Pawn" in widgets.
You better off learning how to pass the reference to the widget
Get actor of class only work for singleton and it's only a matter of time before you run into the same problem again.
I am working on the tutorial for my game. Currently, I have everything hard coded in the level blueprint. However, doing things this way makes it rather difficult to save / load progress on it.
Does anyone have any suggestions on a better way to handle quests / tasks
Hello all!
I made a system where the player can pick up physical objects using a physics constraint. However, the problem is that when a client picks up an object, it doesn’t replicate. I’ve checked and made sure replication is on for the objects and all constraint components.
RPC_Server_Grabbing is set to “Run on Server”
RPC_Grabbing is set to “Multicast”
You can see my blueprint here:
Use some kind of manager actor. Or take a dive into C++ and look at Subsystems
player controller component doesn't sound too bad either
I don't think I'd do quests in a component for the player controller personally. It depends on a few things, like if the game is multiplayer or not, etc. etc.
Hi!
Any idea what may be happening here?
I have this mesh set to block all, but my pawn goes right through
https://gyazo.com/70dc8aba312cca2b546705f84ddfe132
Also, I am doing quite a lot of my game logic in the Game Instance.
Will this cause issues down the way or should I change how I am doing things?
I am using the game instance to handle saving, loading, changing stats and things, among many other things.
Currently the game is single player, but I want to add a multiplayer thing later on.
right, but does it have any collision?
...oh god. May have forgot about that one
haha, classic
Tough that static mesh have collision by default when created with the modeling tool
I'm not sure, but auto generated collisions with a plane without thickness probably doesn't work nicely together either
Abbandon level blueprint from a start
Multiplayer is not something you add down the line... different architecture
I would suggest just trying to finish a single player game since you just start
you can set it to use complex collision as simple, just keep in mind it's more expensive and doesn't support physics simulation
I changed it so it has volume and added the collision, that one solved it, thanks!
true def not on a multiplayer project, but for singleplayer I find it to be a good approach
Hi all
Anyone has an idea about making a constant radial froce pushing my Character ?
Should I use "Radial Force" and enable physics on my Capsule or is it better to fake it playing with velocity of the Character OR with a Set Actor Location node
add radial force does not require physics
My goal is that the Character has to be constantly pushed by a "Wind force" with some force varieties
it should add velocity regardless quite sure which will be used by the movement component
nevermind I am wrong
So it's better to use the "Radial Force" node ?
You're wrong about having to enable Simulate Physics to make it work ?
can't add radial force to character, you can launch character and multiply the force by delta time, maybe
if you are using the character class then simulating physics is not an option
Humm ok so I should play with the Launch Character node you think ?
With a Timeline or Tick ?
Tick, timelines are meant for visual changes and execute on the animation tick
instead you can call an event on tick and bind/unbind as needed
(or activate/deactivate ticking entirely)
if you have an actor that solely exists to add the force then the latter is a solid option
yea, realistically a force is just an impulse scaled by delta time
actually, just use impulse, it's the same (minus being able to lock by axis) and you won't need to cast
for the radial aspect I can only think of using find look at rotation and get the rotations forward vector
then scale the resulting vector inversly by distance
I need a quick help with something regard an actor that spawns other actors.
How can I add a preview on it to check where they would get spawned?
multiply by delta time and add it as impulse, done
For the record, it's an actor that creates X counts in a ring, with settings to control how many coins and such...
It works fine, but I can't see the coin placement in editor which is annoying
is there a reason you don't create them in the construction script?
well, if you use it the script will be executed in editor and baked so it won't need to run in the packaged game
That's nice, but this is something that outright spawns actors
I just need it to preview something at least
Could I maybe instead make it create something as a component and child of itself...?
you probably want to have the actors not spawn in on begin play if you can avoid it
Ah, I see. Any particular reason why?
just longer loading times
Ah I see
I have the actor as a quick and easy way to make coin patterns tbh
Like you know in mario games where you have several specific patterns. I thought making a simple tool for that would be somewhat faster.
right and the construction script would let you properly preview it in the editor and the coins would be there as if you placed them yourself
The thing is, the construction script cannot actually spawn actors
You can't put the node to create actors in it
I would do it with editor script and do it via button click.
Like have a generator actor that have a button you can click and everytime you click, it just generate the coins. In random pattern or not
And just have a bunch of different settings that are parametized
Ah, not sure how to do that, never tried it
ah, child actor components are supported though
This is the first time I ever heard of any of that honestly
Like I said I'm a programmer out of sheer necessity as of now
I haven't used them myself so far so I'm not sure if that's a good idea
Most people here are hobbyist imo
Ppl that make a living out of programming are prob in #cpp
You get paid to work on games? That's my dream
Like my BP knowledge is at a "I can work with people involving this" level, hardly full time stuff.
Not right now but yeah I have.
Just wanna wrap up with college so I can dive in back proper
I've used plenty of cpp when it's necessary, but overall I'm just a BP kinda guy out of many years of habit I guess
Well then it's a hobby project and most people are also in the same boat
Imo as someone who sucks at cpp
You gotta do what you gotta do, especially when you are in a small team or a solo dev
UE is at its best when using both bp and cpp
Even the cpp people never say to use 100% cpp
Those that do get banned actually for trolling
Yeah UE's best call system is within BPs
nah I like to do all my game UI in slate only (I'm kidding)
Ok yeah I refuse to touch slate with a 10 foot pole lol
I have maybe 20% bp atm, going to be more bp when the core system is done
I am struggling to make this widget fit the screen properly even when resized, could a merciful soul help me understand what am I doing wrong?
Imo never limit your self, I did and I regret it.
Just learn what you have to learn
Do it out of love not neccesity
Okay so 2 things
This is #umg talk
There's nothing regarding bp specifically that would cause the issue
ColdSummer, any ideas how one could approach the Nier Automata dash?
thanks, didn't know what channel use
And second, the problem is that your hierarchy doesn't really have access to the stuff
Like for testing it's fine
But I assure you, you DON'T need 2 canvas panels at once
Nope , afaik you can still have influence on the direction during the dash right?
yea pretty sure, plus the smooth transition to running
I actually did an in depth study on how to do dashes
it's tough
Certainly
How did the Nier Automata dash work again?
I didn't know how to wrap everything together lol
The smooth transition to running can just be a blend maybe? I actually have short dash to running
I will ask in umg talk
If the dash can be influenced by player controls I would say it's done in 1 of 2 ways
yea my current setup uses motion warping but that takes away control
I will take a video when I got home
They have a direction vector that moves the character each tick in that direction, and the vector gets updated with input based on sensitivity
Or they apply constant velocity to the player character, with a new turn rate and physics settings for the "dash state"
I made a very simple dash using the CMC via repurposing the Flying Movement Mode. I only ditched it because when returning to walking, the player would inherit their flying velocity from the last update
Ok thank you very much ! So to resume I have to use the "Add Impulse" node and get the Forward Vector of the Actor which is making this "Add Impulse" to push my Character away (with the Tick Event).
I probably want to do a blendspace and have it as a cycle in the animbp instead of montages
I mean I can use the "Add Impulse" node in the "Actor_01" but target the "Actor_02", right ?
I rotate my character towards velocity so I have that off during the dash so the directional animations work properly, afterwards it will help transition into a forward sprint
no you don't need the forward vector of the actor since it's radial
Using states can work too
need the forward vector of the look at rotation
no state for dashing specifically yet, but would be good to have
cannot add force to character
Ah, I see
so I suggested to add impulse and multiply by delta time
I really need to see how other people actually manage to do dashes ngl
So I have to use the "Add Impulse" on "Event Tick" and multiply it by the "Delta" of it
It's such a staple mechanic, how does everyone get to make one?
For nier automata dash, I would just have it as a state in the anim bp. The direction and input can be freely controlled in cmc.
Never venture there but should work?
yes multiply the vector by delta time just before putting it into the add impulse
I'll try that. Thank you so much !
iirc it also has a setting to ignore gravity yeah?
yea, the advantage is having a proper blend space, too
Like if you dash mid air in Nier, you reset your Z velocity
It's been ages since I played it
But yeah, if it does reset Z velocity and disable gravity then
How would you then "make it dash"
thank you !!
disable friction, gravity, add velocity in the direction, then interpolate back after the dash and blend into running animation
in theory
Just set acceleration to an infinite value and tweak the max walk speed
You add velocity with just the Move node?
Or some other node I don't know the name of
I tried to do a root motion based dash but couldn't figure it out honestly.
Lol yeah?
works like a charm
honestly my current sliding behaviour already has most of what I need from the dash
@undone bluff Ah btw, on the construction script I could onlt manage to make it draw a debug circle to preview the stuff
It "works" but I need to click it for it to work
I was thinking of that but I didn't know it'd work in editor
It works yeah, just not permanently
ah yea the script only executes when an update is triggered
not sure what'd happen if you make the debug circle show up forever
would probably make it unusable
Sorry for the book while ya'll are chatting just throwing my question out there
I have a problem thats hopefully simpler than ive made it out to be in a rats nest of a BP. My third person camera orbits around the player on mouse movement. My running animations work fine while moving. I'm working on Idle animations now and id like to make it so that my characters feet stay planted in place until you've rotated far enough to trigger some stepping animations for various degrees around their point.
What I've got so far: While moving (WASD movement) i store the latest rotation of the root bone (feet). When standing still i compare this to the angle of the camera. If the angle reaches a threshold I play a sections from an animation montage that contains each of the 45,90, 135, 180 degree stepping animations. It sorta works until the animation starts and then its all borked.
So, surely theres a better way to do this lol
Then the more I update and tweak it, the more circles I get
yea
And it'd just be an eyesore
I think i just thought of a way to do it with a blendshape..
oh you mean turn in place
you should be able to find resources on how to set it up if you look with that term
you def do not want to do this with montages
@undone bluff btw, I'm curious about your project. What you making a dash for?
action rpg, with switching between third and first person (but properly, not half-assed like how bethesda does it)
Is the switching part of the gameplay or just a setting?
just an option to change perspective at any time because I enjoy being able to do that in games
lmao if it works it works
Thought it would be something like Clash: AoC
I actually didn't add the turn animations, this way it detaches the character rotation from the camera when you're not moving so you can actually look at your character ,kinda like that better
The game has this fun little mechanic where you can enter first person mode and fight with a strong powerup
oh that game looks cool
for me first person just started out as a simple option to make exploring interiors a bit nicer
now it's proper with hidden but shadow casting head mesh, arms rendered separately and its whole own interaction system and animation setup
it's kinda a little like a second game
Clash is neat
As a fellow Latin dev it's a shame to see it perform poorly...
Imo the issue was that there was hardly any marketing for it
Like quality wise the game is excellent
Can someone help me with concepting my idea? I'm trying to make a tile system that has hundreds, if not thousands of tiles, and the tiles need to be interchangeable. I would like to store these tiles in chunks, and the chunks would be a single actor. I'm just having trouble wrapping my head around how I would get this started and what I should store the information in. Arrays are too slow.
Arrays are not slow
You are hitting bp limit when it comes to loops
Deff do procedural generation stuff or any large data in cpp
In bp you do be making copies and not to mention bp loops are slow as hell
I was hoping you wouldn't say that. Well, it's not procedural, but it is large data. It's more like a level editor.
Deffinitly a job in cpp land
I mean if you don't care about it being slow since it's for editor then you can just use bp
If you want faster iteration you will need to use the right tool
You can also use bp's to interact and implement it if you make the stuff callable in cpp
But if it's a for loop... That has no place anywhere outside cpp imo
The performance difference is massive for how easy it is to implement it
For only a thousand tiles bp is fine
I ran 50k on it, and while the initialngen was slow, the rest was not (altho my operations were limited to 1 tile swaps)
But ofc, c++ is far faster if its an option. Definetly my go to for larger loops
Thank you, guys! I'm still very new at cpp and coding in general, but it really shouldn't be so hard setting up a bunch of tiles at xyz cords.
Correct
But the number gets out of hand for bp quite fast^^
10x10x10 is suddenly 1000 tiles
is there a way to rotate a box overlap actors? I am tryting to make an attack that hits in a square right in front of the ai but when i use the code in the attached photo it does not always create the square so that it lines up perfectly in front of the ai, as in sometimes it spawns and the ai is at the corner rather then the box being centered with the ai. Does anyone know how id fix this problem
What is best way to detect is actor possessed. Like for example vehicles. I don't want to enemies detect those if are not possessed.
If there isn't some IsPossessed node, you can always just use the Possessed/Unpossessed events to set some flag when the player possesses it.
Okay thank you! Basicly most organized way is just create common interface function that returns is possessed and every car, bike etc have that variable and function setup.
GetController is how they track possession
so if all your cars , bikes etc are pawns then you can use this information
Hello, I have an issue with collision.
I have an actor that accelerate. But when reach a high speed it go through a collision object without activate the overlapping event.
I try to activate the CCD collision, the speed before passing though is increase but the issue is still there... is there a way to avoid that with all high speed?
trace based on velocity
so basically have to ask the server I guess?
if it's a multiplayer game
yeah
you'd need to ask it to possess it anyways, right ?
possess being a server auth event
yeah
is someone experienced with using ik_hand_gun ? I'm having a hard time understanding what does it do.
or why would i use it instead of attaching guns with just a regular socket to hand_r
Hello, do you know what Reset Array is doing ? There is no description in-editor nor in the unreal website:
if you hover over the tickable box?
i mean it probably resets the array after the function is executed right?
so pretty much putting it back to a state how it was before you executed the functionm
im just guessing
But what does this means in the context of attached actors ? Ticking it does not seems to alter the behavior of anything
can you show a bigger pic?
It may be C++ only
It clears the array before populating it. Less useful in BP.
TArray<AActor*> AttachedActorList;
ActorA->GetAttachedActors(AttachedActorList, false);
ActorB->GetAttachedActors(AttachedActorList, false);
ActorC->GetAttachedActors(AttachedActorList, false);
For example this allows you to take these three actors, A, B, and C, and call the function on them with that as false, and populate the same array without having to copy or append it.
AAAHHHHHHHHHHHH thank you
void AActor::GetAttachedActors(TArray<class AActor*>& OutActors, bool bResetArray, bool bRecursivelyIncludeAttachedActors) const but we can't pass this in blueprints so it's useless here. That's it ?
I'm not entirely sure. But being a pure node, I think the array will reset every time this is called because it will be a newly allocated array it posses from BP. So you'll probably get same logic regardless if it's on or off.
I think you're right, since it's impossible to set &OutActors
When it comes to detecting stuff like collision. What is cheaper, using Get Collision Object Type. Or setting up a system with tags? I want to have weak-points on my enemies, and I dont know if I should make new custom collision channels or a tag system 🙂
I think a lot of people do this via phys materials.
how do I get this value in construction script?
I'm moving the spline component however Get Relative Location returns 0,0,0
Why would that be? I have not used them, so I dont get why 🙂
I've seen people do that via bone names
you get the phys material for free if you do a line trace, I guess that's why
Ah, I dont linetrace though, I use projectile movement for my projectiles :/
Bone is pretty generic in comparison
Low resolution
Hard to tell a joint from mid-bone
Because it's easy to adjust and work with. And you don't have to rely on the entire bone. Take like a monster with a bunch of weak points on it's stomach. You don't really want to do that by bone or you'll be adding a lot of extra bones for those weak points.
Hi I made a widget, and it has a size box that I'm overriding the height and width.
I then put it into a canvas panel.. but the canvas panel seems to be deciding the size of the widget. Even if I change the variables they have no effect
Is there some setting I am missing?
how do I set my sound source to not stop when player is outside the fade out area? basically can't even hear it. I am making a radio that loads sound with the help of Runtime Audio Importer plugin. I already made a sound asset and set always play but it still stops when player got out from the source region
change the virtualization mode in the asset to play when silent
how (should I even) talk to PlayerState from a projectile? I have a liveProjectilesCounter in PS I wan to do a -- after the projectile despawns itself because of an internal timer
when is the counter being ++?
on PlayerController when I shoot
on spawn of the projectile, you can bind OnDestroy of the projectile to do the --
awesome, I'll look into binding, didn't know that. thanks
called Event Dispatcher in blueprints
Not sure where best to ask but any tutorials / documentation on creating player made trenches or other items that change the level? Like being able to grab a shovel, see a highlighted trench of where you want to dig, and insert the trench asset where the original world terrain was.
Can someone help me pls with this aiming?
Funny running you here, https://www.youtube.com/watch?v=b88Dj_k9b84
This video should cover what you are looking for. Need to make sure the trench assets can fit the terrain well.
Hello guys, in this quick and simple tutorial we are going to see how we can build objects with a preview in Unreal Engine 5.
↪️Project Files: https://bit.ly/GorkaGames_Patreon
🏆My New Unreal Course: https://bit.ly/UE5_StealthCourse_GameDevTv_GorkaGames
🔥Discord: https://bit.ly/GorkaGamesYouTubeDiscordServer
Danger Zone Tutorial: https://youtu....
It'll be a bit tricker with replication, so keep that in mind.
i feel like this is simple but I cant figure it out. How can i stop a looping audio on an event end overlap?
is there an "opposite" of the play sound node?
You need the audio comp handle
So using the play audio spawned or whatever its called
Whichever returns a reference to the audio comp
Hey thanks!
My brain hurts, can anyone explain to me why my forward vector is going the wrong way...
You're not adding the actor location to the directional vector, so it's getting the forward vector as if you're at 0,0,0
So add the actor location right before the line end pin
Oh, and convert the bottom pin on the multiply to be a float
When you only multiply the x it'll mess up the direction it's pointing
Brilliant, tysm. Ive been having a nightmare trying to fix this. Im trying to apply forces in the forward vector and its been going crazy - this might just fix it 🥲
anyone know how to cast to a specific sphere collision within the BP_Player?
What exactly do you want? This sounds like an XY problem.
Casting is just a type check, not accessing a specific instance. Casting takes a specific instance, and checks if it's of the requested type, converting the reference to that type if so.
It's like saying "is this piece of furniture I've showed you a chair?". It has no actual knowledge of that specific instance, it's not a getter.
okay wait lemme rephrase
how can i execute this overlap event when it overlaps specifically with a sphere collision in the player bp?
any sphere collision, or a specific one?
well there's only one, so either i guess
You could always manage the overlap event in the player itself.
If the sphere in the player wants to do something when it overlaps something, the sphere should be responsible for that
No problem, to put it another way, it would be a little odd if your enemies told your gun to shoot, instead of you :P
If you want different things to happen based on what the sphere overlaps with, take a look into interfaces.
It would essentially let you call an interface function on whatever's overlapped. Then if you wanted say a crate to break, you would implement the interface function on the crate, and do the breaking logic there, and if you wanted it to turn on a light, you could implement the function on the light... yada yada yada, you get the idea
hold on im still confused actually so
in the player bp, i can make an overlap event with the other object cast to the water bp
Trying to stand on an object with physics enabled using the default third person template causes some very weird behavior. The object and character will jitter wildly and launch either one far away. This happens at any size and weight.
Hello can anybody point me in the direction as to why this simple Cast To StaticMeshActor is failing?
Cause the thing you fed to it is not valid or not a StaticMeshActor.
Hello, I am still learning unreal and hoping someone can help me with a issue I am running into. The blue prints in the screen shot work perfectly fine how I want, however the "Get World Location"/"Shooting Player Location" variable only sends properly if the host/server is the killer player controller, when a client shoots another player the hit indicator shows up but the "Get World Location"/"Shooting Player Location" is the same each time.
Cause you told it to use the server's camera manager.
The actor is a simple rectangle made with the motion design tools, how can I convert it to a StaticMeshActor?
I don't know what the motion design tools are. Or where you're populating Headshot2. Is the rectangle a StaticMesh?
Rather than casting to a StaticMeshActor, you could cast it to whatever this BP is and get that ShapeMeshComponent to set the material on.
The nomenclature isn't the same but this is the Actor, it doesn't need to be this particular kind I don't think, I just need to have an actor where I can change the material/texture on an event trigger
The other way would be to simply use the Actor type and GetComponent(s)ByClass
Thank you! I apprechiate it greatly!
hey, I'm trying to get the closest point of a skeletal mesh from the cursor (using the get closest point on physics asset) which works fine if the cursor is outside of the mesh (pic 1), but not when the cursor is inside (pic 2). i really only need the outside edge. I've been adding an offset if the cursor is inside the bounding box before, however this makes it very hard to get inside any crevices the mesh has. anyone know a better way of getting the outside edge?
Does someone know's why my foot ik works totally fine on the master blueprint character, but does not work on a child blueprint of him?
Im feeling extremely stupid right now, Anyone know how I can add force in the forward vector? 🥲 Its currently making me go sideways
I got this error "Blueprint Runtime Error: "Accessed None trying to read property CallFunc_CreateDynamicMaterialInstance_ReturnValue". Node: Set Scalar Parameter Value Graph: EventGraph Function: Execute Ubergraph BP Player Blueprint: BP_Player". The screenshot is the blueprint that caused the error. How do I fix? BTW I checked the param name in the material and it's the same name.
If you only want the forward vector. I think you have to split the struct pin for the force node. Not 100% sure but that's my guess.
If you only want to move forward only
Don't add location.
Force is a direction. ForwardVector is a direction. ActorLocation, is a point in space. Multiply ForwardVector and add it.
Is there another node I can use instead of set text, that will still set the text but only in intergs
Fixed issue. I have no idea what I did to change but I revert to a previous iteration in revision control and now it's fixed.
Do I not need the location to update where the force is being applied from? Im trying to apply it to a moving object
You're mistaking this with setting a location in a direction. You're not setting a location. The physics system is doing that for you. You are telling it to move in a direction.
What? Just plug the ToText output into the SetText node?
I must be having a different problem then 🥲
If it's still going sideways only applying a multiplied forward vector, then your camera is sideways to the actor's forward vector.
It seems to work fine until I go on an incline, then when i re-enter the "vehicle" it loses control and freaks out
does anyone know how to cut a hole in worldstatic as if it was a portal hole? (im struggling with the logic for disabling collision upon entering the portal)
- i used a small floor tile that is enabled upon entering the area of portal, but it caused an issue when youre touching the portal on your eyes height it teleports you from being stuck in geometry
- i used a method that is very basic. i have a scalable overlapping triggerbox that is turning off player's collision with worldstatic upon touching it and vise versa
can anyone help with 3rd? like is there an actual way?
Any ideas on why this isn't working? It is saying I cannot afford this property even when I have more "crypto" than property cost
Did you look at the portal tutorials on youtube? There is one that is pretty good
yeah pretty much most of the use seamless doors without having them on the walls
like, you dont have do worry about worldstatic collision
because you dont get bumped into a wall
Check if the references are populated (IsValid node)
Hey all, quick question: I'm adding a menu system and flow to my version of Breakout. The tutorial I'm following recommends creating a main menu as a separate Level. When the player clicks "Play", the game loads the Gameplay Level - Level1. But when this happens, I can't control the paddle.
I'm able to control the paddle when I load Level1 directly by starting the game "in" Level1. But when I load it from the main menu the player has no control over the game. What do I need to add to enable player controls on a new level?
For context, my Level1 blueprint looks like this:
Hey everyone, have you ever worked on a level you're walking around and the characters fine, and then you open up a different level maybe from an asset pack or something and then all of a sudden your character that was once walking becomes grounded to the terrain and they're just running in place? And when you don't move the character just sits there and twitches up and down... 😭
This is a strange issue that's just happening right now and I don't know how to fix it, I've been spending the last few days building mechanics in a spaceship and I switched the level because I want to try something out and now I can't move and it's extremely frustrating I even disabled my line trace to see if that would help but nope still twitching and lock to the ground can't move
And my actual Player Paddle blueprint has this in it - which I assumed would be good enough:
Each level has its own defaults, change the defaults to match your original level
Maybe you guys have the same problem, check the defaults on the level
By Defaults, you mean these?
Well the test bench level that I was using to build mechanics on was just the default open world UE level just blank and a regular sky that's all. I didn't change anything specifically, and then when I opened up the other level the defaults looked to be the same but yet I'm grounded However I'm going to try something and I'll get back to you
yep
So I'm not sure I understand how the default classes would enable control. If I set the main menu's defaults to those of Level1, the same issue persists.
It's almost as if I need to perform a function when Level1 loads, to give the player control of the pawn.
Thanks, I'll try this.
So somehow...and I wish I knew how...I've broken something.
Now when I load the MainMenu, the screen is black. No UI Widget, nothing.
what does the level blueprint look like on your main menu(level)?
The same.
🤔 maybe the widget is set to not visible or collapsed?
Let me check.
check in class defaults* too
It's not something I changed (at least, consciously) The elements of the Widget are all visible. I even created a new level, assigned its game mode as "MainMenu" and left the class defaults be and the screen is black.
That leads me to think it's something with the Game Mode or the Widget.
in the new level did you set the level blueprint to create widget and add to viewport like the pic above?
Yup.
I copied and pasted from the original level to this one. So their BPs are the same.
I think something I might have done - and I don't know if it has an effect - is click this:
Because my MainMenu Game Mode and my game's Game Mode now open very different panels for me.
AH
Figured it out.
what was it?
Not sure why, but when I drag my old GM_MainMenu into the GameMode Override, I get this:
Id try disconnecting things one at a time to see what is making the camera zoom in like that
I recreated the Game Mode, dragged it over, and I get this:
The second loads the UI normally now.
Okay so all my defaults are the same, and I even made a copy of the level and converted it to a world partition level just for the sake of it, all the defaults are the same the collision on the default character is default everything is just default. And my character is still grounded to the floor. 🤷🏾🤷🏾🤷🏾😭
And somehow...my player controls are back to normal when pressing Play. I think it was the setting Input Mode Game Only you suggested:
Thank you!
😊
Did you make sure your default pawn is setup correctly and set game input mode?
You could also check if auto possess player is disabled
Ok a bit of a more advanced question now: As I understand it, when a level is loaded it also loads the default classes such as the Game State Class. I've been keeping and updating my player's score and lives in the Game State class. I thought I understood that this class would keep track of important variables across the lifespan of a game - but that doesn't seem to be the case.
When my player completes a level, I open a new level. And their Score and Lives are reset. Which I don't want. I want their Score and Lives to persist across levels. How would/should I do that?
I see a few hypothetical options, but I'm not sure which are possible:
A. Manage the player's lives and score in the Game State class and pass them from one instance of the class to another as a level is loaded.
B. Manage the player's lives and score in a separate class that somehow sits "over the top" of all levels in the game. (I'm not sure how I would do that)
C. ???
My Dr. Google search on that returned this https://forums.unrealengine.com/t/why-not-save-everything-to-the-game-persistence-level/475446
Hi mrstarks510 I need to clarify a few things you said: I learned save my character stats to the player controller and not the player pawn as it will be destroyed during level transfer and the controller will likely stick around. But now I need to save those variables to game mode as the controller will not carry over because the contr...
Boom, three paragraphs in answers this question AND my next task which was saving data (score and high score) between plays. Thank you.
What was the search term you entered to get this result?
I feel like sometimes I'm using the wrong terminology.
"save data that persists through levels unreal engine"
Thanks!
Yes everything is default, the input was all default, except for the custom ones that I made for what I need to need. Everything is set in the project settings. I just find this extremely strange because the level that I'm having the strange issue on right now, is an asset pack that I use all the time for testing out space stuff, it's the floating island asset pack..
Question about the GameInstance. When you create an empty game in Unreal Engine, it creates several objects including the GameInstance - which I know is pre-set in the Project Settings > Maps and Modes menu. Am I right that this object can't be accessed or edited in the Content Browser? I need to create my own, and set it in the Game Instance Class settings myself?
hey, I am kind of stuck here for my weapon bullet trace logic. What I want is, the more the player hold the left click on an automatic rifle, the more the bullets spreads. Actually I have this logic which spread the line trace to x y and z axis a little to have some randomness. But I would like to increase the range over time while left click is hold. So first bullet would go straight away, then range increase to 0.01 etc....
I really dont have any idea on how to approach this issue. Any Idea ?
There are several functions called "Random Unit Vector in Cone" that you could use to perform this I'd think.
So as the player holds down the left click, increment an "Accuracy" variable. Then use some math to set this variable as the degree of the tip of the cone.
You could also use the Clamp Angle function to ensure your accuracy is clamped between your minimum and maximum values.
thank you I didnt knew about those, I will take a look
You're welcome!
Hi, not sure if this should be in Animation or here, but I was wondering if I could change a socket rotation per animation montage? Right now, I'm using random sword animtions and they all working more or less fine. But I have one animation where the character slams down the sword, but the way the rotation is set up, the sword is being held rightside up. If I change the socket to fit this animation, everything else would be wrong. I see I can "Get socket transform/rotation" but there is no set for it?
So I do a loooooooot of casting to my SaveGame values for the score of the game. Something tells me this isn't ideal. Should I be setting a variable in this class to the Save Game Object I continually cast to?
You can use an array of integers if it's just numbers
Do everything in one go
Right, but I'm referring to the actual get/set of those values. Right now my BP is super messy because I have to cast to the GameInstance every time I want to change the score/lives.
You have score, lives, what else?
Is it "best practice" to create an object variable and cast to it on init?
Right now, that's it. It's a very very simple game.
Ok so make a function and call that function instead
so happy with how it looks now 👍
Yay! Awesome!
Sorry I'm a bit confused. What I'm asking is - if my code looks like the first screenshot up above. Would it be better if I created a local object variable like this:
Is it: faster? better? Or does it have no effect other than the code being cleaner?
Where are these nodes happening?
This is in my Game State class.
And when do you call some of these events?
I call Update Score every time the ball hits a block. I call Update Lives every time the ball falls below the player's paddle.
Ok let me think
So you need the score stored somewhere because you plan on using save system, correct?
I have that saved in a SaveObject that is instantiated during the GameInstance init (or loaded at the main menu), yes.
But really my question is less about the logic and more about the performance. When an object has an Object Reference Variable - and that Reference Variable calls a function - is that faster? Or the same as performing a "Get Object -> Cast to Object -> perform function"?
For performance, you want to minimize the casting in this case and use it only once, like at the end of the level or when game over
Got it! Thanks!
I decided to do that because I figured it was faster but wasn't sure.
The way you have set it up, is that it saves the score even if the player quits the game mid game
I wouldn't do that but that's your choice/design
This is just the current iteration. I'm adding a "Do you want to save?" option, and a load system. This is mostly for self-learning. What would you change about that?
Ah, saving from the last level, rather than saving mid-game.
But then again, the score depends on how you want to implement it. Do you want players to save the score for next session?
Right, I think I understand - that would require not updating the SaveObject's score directly. But rather updating it when you move from level to level (or losing)
And instead keeping "temporary" score and lives variables for that play session.
Yes, that's the original design of the game
Got it. That makes a lot of sense.
I'll refactor to that tomorrow. Thanks for the help!
Np
aye I've been working on a game for a while, just had a shift in direction to roguelike and I'm having a bit of trouble with my stat system. Gonna try and keep this short:
- The individual stats are stored as arrays with 5 elements representing a formula
- The stats and formula function(s) along with anything else attached to this system is attached to a component.
- For the Modifiers(perks if you will) I created an array of structures that store which stat they should modify, the part of the equation to modify, and how much to modify it by.
My issue is how the Structures reference back to the Stats. I know I could like map them out to ints or something and compare or something gross but they're all treated the same so I was hoping it could be done generically. I can post screenshots or other info if needed.
Lookin for either a design pattern that might fit this or a simpler solution to tell the modifiers which array to mess with. Perfectly fine having to redo this from scratch, it's not hooked up to the rest of the game yet fortunately.
Individual stats are stored in a struct?
Here's an example of one of the stats along with the calculator function that calculates the output.
Along with the formula so it makes sense:
(BASE * SCALE1 + BASEMODIFIER + FLATMODIFIER) * SCALE2 = STAT
And currently StatModifiers or "perks" are stored in an array that looks this. The "StatArray" portion is an enum because I was about to do a map before deciding to ask for help
Hey folks, this may well be a #geometry-tools question, but just wondering if anyone is away of a path to create new static mesh or skeletal mesh sockets in the construction script or at runtime?
Hoping to create a socket 'painter' tool which lets you click somewhere on a mesh, trace to it, and place a socket at that location to streamline some vehicle setup
Sockets can only be done in editor. What are you trying to do with vehicle setup? Maybe there's another way to go about it
We have a lot of sailing ships to assemble rigging (ropes/pulleys/etc.) for dynamically, and my hope was to make that process a little more streamlined in a custom editor tool rather than having to open/edit each of the meshes which might need to be attached to at a precise location and add (and manually name with a very specific naming convention) hundreds or even thousands of sockets on hundreds of meshes 😄
The idea was to instead have a tool which lets you load in the whole ship at once, and it would take you through a list of predetermined (specifically named) attachment points, and you could either click where it should be on the actor (thereby adding a socket to the clicked components mesh asset at the location, and mirroring it to the other side as well) or skipping that particular attachment point if it's not applicable to this ship, and so moving onto the next one in the list.
We can't do it in the DCC because of the workflow for the ships being quite awkward already and reimporting them would be quite a nightmare (tech debt, to be honest, but something I'd rather work around than fix due to the impact that would otherwise have on timelines)
And simply storing those locations into a vector array or as separate components isn't really good enough, because these meshes will translate at runtime based on all sorts of factors. I suppose we could use scene components and attach them to the mesh components with the correct relative offsets and not use sockets at all but that just feels really inefficient and would bloat the component count by thousands per ship.
Looking for a solution to click on an object, have a character run to object (if not next to) then open a widget once the character is in range. I would also like the character to open the widget if he is already in range and then clicks the object. Does anyone have a loose good idea of how to accomplish this?
I've been trying to use a gate and event actor begin overlap, but I can't seem to find a way to be able to do it. Any logic suggestions?
The top down project comes with the click to move logic. You can use that and implement a distance check before the move is done and set a var. Then when the move is complete or before hand you can check if it was set and then do a widget if yes
Hey, in regards to my question earlier. What do you think would be cheapest, child actors or scene components?
hey i got a question. I've been following a tutorial to learn more about ue5. and I've run in to a road block. I'm trying to make a animation for the character however it's not working i was wondering if someone could help me please.
I think you intended for Character to be the class of your character, not the class of your Anim blueprint
you should be piping Try Get Pawn Owner into the cast. Not a reference to Character itself.
That is the wrong cast node. ABP Hero Quin stands for Animation Blueprint, you may want to double check that node
Does anyone know why they are both stuff at 500?
even if I change the first value from 500 to 100, it will print the value 100 perfectly but it will not let clones be independent
Why do you want to cast ABP_Hero_Quin in ABP_Hero_Quin?
i messed up and choise the wrong node. i fixed it but it dident change anything
suppose to just be bp
Hi, I'm having trouble trying to handle the hit event of projectiles against enemies. both actors have a printString in OnComponentHit. but nothing happens after I see the bullets bounce of the enemies when I'm shooting at them. If my character touches an enemy, the enemy's hit printString does appear, but not with bullets
BulletActor
> SphereCollision (collision:BlockAll,physics:On,event:OnComponentHit)
>> SphereMesh (collision:NoColls,physics:Off)
> ProjectileMovement
EnemyActor
> BoxCollision (collision:BlockAll,physics:On,event:OnComponentHit)
>> CustomMesh (collision:NoColls,physics:Off)
PlayerController
> OnInput: Spawn a BulletActor and adds velocity to its ProjectileMovement
try to remove the target from "Try get pawn owner" to get the owner of this ABP not the owner from the Ref
yeah changing from ABP to BP fix a few thing so now it look like the tutorial only thing that i can see is different is from character to target to as BP Hero Quin
So, it may be easier to talk this over in vc but I don't think you're casting to the right thing
are you ok with that?
In about 20 minutes I can help
ok want to dm or just in a channle server?
Server channel is fine👍
ok just tell me when you arte ready
try to set the actor after creating the widget
I'm unsure what you mean
like when you create the widget try to update the ref actor
Is there a node for that?
the "Get actor of class" node it will get the first actor in the level
You're setting the sign ref and it's likely picking up the first one, you need to find a way to set it to the specific instance of the one it's related to.
So move this here?
no, you need to set it from the actor
And remove it from the wbp?
you do need to remove it because it will update when you create the widget
like this
yeah like this
no you need to get it from the create widget return value
get what?
remove the "get actor of class" node and from the create widget return value drag and drop and set the ref actor and the value is self
like this?
yeah that right but you need to update the ref from the widget
so like this?
in vc
This still only gets the original and not the dupes
the "get actor of class" node it will get you the first actor that placed in the level so you need to remove this node and in interact function in the actor you need to drag from the create widget return value and drop and search "Set name of the variable"
I don't have that node lol
what the name of your actor ref in the widget
so type this name
oh my bad xD when you said "set name of the variable" I thought that was the name of the node
now the value is self
plug it in before the viewport?
it doesn't matter I think
perfect it's working! Thanks so much mate
is this stuff still neccessary?
no remove it
Amazing, thank you
Watched a guide for a crouch bp thats smooth but when I uncrouch below an object my camera clips through any way to keep crouched if below something?
Hi, question how can I limit door swing only in one direction?
Well first figure out if you really want the door to be opening with physics, like you've implemented now, or if you just want the door to open with an animation.
Physics, my main objective is to replicate door from Amnesia: Dark Descent
So I've got this loop to check if the character is close enough to "interact" with the actor. And everything works great if you simply click the actor.
The problem is, I don't know how to break the loop if the character clicks on the actor, then clicks somewhere else before the move to completes.
- The break loop that's already in place works if the character stops moving, but will continue to the loop otherwise.
Anyone have any ideas?
Getting some weird results when trying to normalize a float between 0 - 1. It appears as though the number I'm getting is the original and it hasn't been normalized at all. This kind of makes sense when I look at the formula in C++ but I don't think I've had this problem before, any ideas?
Instanced static meshes by far, if thats an option
Simple move to stopping line trace from working on static mesh, anyone have this issue before?
Hey everyone, I am not sure if this is the right place to ask, but i have a question regarding the best use for actor components. I do plan on creating a 2D metroidvania/rpg with several mechanics. I created a movement and a camera component already but i am not sure about the other components (Inventory, Equipment, Skills/Attributes/Perks, Crafting, Dialogue, Quest and Combat). Is this a good seperation or should i merge or seperate it any further? Furthermore i am not sure if Quest should be in a component or rather a seperate system. Hope someone can help 🙂
I am not really a pro or anything but id say that skills and equiment should likely be components. I am not quite sure what you mean by combat but if you mean a damage system id say that could be an interface. Assuming you are getting quests from a variety of characters I would likely use an interface, and a component to keep track of the quests the player has gotten. Hopefully this helps, sorry if it doesnt
Is there a way to rotate box overlap actors?
hey guys ,
any idea where i can store my json file, to be in a build and i can read it at runtime
Question: Is there a way to line trace multiple trace channels at the same time? For example, I want to have effect X when it hits trace channel A (like add an impulse to an object), but I want to have effect Y when the line trace hits a something with trace channel B (like adding a decal to a wall). I was thinking of having a line trace by channel for A + cast to object nodes and if it's invalid, I have another line trace by channel for B + cast to object B, but it's ugly af. In code, this would be a simple switch-case statement. Is there a way to do this without resorting to C++? Thanks.
You can setup a function with all the logic you need to loop. Then when you need to start looping, use the ‘Set Timer By Function Name’ to start the loop.
Whenever you need to end it, use ‘Clear Timer By Function Name’.
The Clear Timer node can be run inside of the function, the Set Timer node has to be called within the event graph or inside of a different function/macro
Set ref frames manually or move it to halfway, set limits, then rotate back to closed
Anyone have A niagara effect inside their blueprint? Why my niagara resets when I move the BP?(Any niagara fx)
Are any of the Niagara System's parameters being set in the Construction Script? It could be resetting in the editor because the CS is re-ran whilst the BP is being dragged.
no cs whatsoever
Ahhh I think remember that many particles even reset when they aren't in a Blueprint though so it might be related to that instead. I forgor how it's handled sadly. Maybe something to do with the particle asset itself and its lifetime/spawn modules.
i tried all of them
weirdly, old cascade effects work
and all of them work if they just are normal particle/niagara systems and I move them around the level
hmm, ok its only on editor I guess.. weird.
Does anyone know if it's possible to have an input variable for a function have a random default value? So that when ever a new node is created, it just sets the value to a random value?
So for example, the UID input, instead of being 'None' it just prepopulates it with a random value (which can then be changed if required).
why not just attach a random generator to it?
Technically, it needs to be unique (hence the random) but would need to remain the same for that instance of the node.
would it work to make a variable that takes input from random
That would require creating a variable for each time the node is used. I would have liked to have used the GUID var type but that requires a variable as well. :/ Splitting it isn't an option unfortunatly.
Array variable then? 🤷♂️
I did think of this but then it would just get a new GUID each time the node is called.
The issue with using an array, is if the order in which the nodes are called changes, theres no way of knowing which entry corresponds to that node instance.
Someone able to help please, I'm getting stack overflow error but I can't seem to see where this is occuring to fix it, all I get on the crash report is UnkownFunction
Perhaps someone could suggest an alternative method if you explained what you wanted to do in the first place
Thats the error I'm getting
also a note I'm in the TSW public editor so I don't have access to the source to dig into stuff I've not made as a fyi 🙂
As an example, something like this. The idea is if it gets to a node it'll check if it's created the quest, if it has it checks if it's been completed. If it has it moves to the next one. Because players might complete quests in different orders, the order won't always be the same so I need a GUID that each instance of the node can use when doing it's checks.
In the above example, I manually copies different GUID's in but this isn't an optimal solution lol.
This looks very sub optimal
what is a task object even?
out of curiousity
Also, would you naturally check a quest by its UID ? Why does it have an UID ?
I would think any quest identifier would suffice?
Unless you can have several of the same quest, but as different instances ?
I would think if you needed the UID, it would be created internally, and returned as some handle
Pretty much this. Technically there's individual tasks in a quest but I might have to settle with not allowing duplicate tasks.
Yea, I might be overthinking it to be honest haha.
been there done that! It's easy to overthink and over-complicate the design to ensure support for all sorts of silly scenarios 😛
If you want to get into DM i could share some of my Quest system internals
, if that could be of any use
arms are glitching , when player jumps its colliding with gun and also positioning is off
also after player dies arms are still at their places
I'm ok, thanks for the offer though. This isn't my first quest system, just playing around with an idea to make it more friendly to build the overall quest flow.
Wanting a node friendly approach makes sense. I ditched that, and instead went for a (very alpha) quest editor instead, as it allowed for a better underlying quest structure
Seen a few using the Flow Graph plugin and go that route
Guys why does this not generate 5 cities and stop afterwards?
can't say,
i'd expect it to be an infinite loop but apparently that didnt work either
sorry to prompt on this again but anyone know what I could do to either catch when this happens or have it spit out what causes this to occur please ?
you are within a loop, going back to create another loop
need to break out of current one
How can I do that?
there's a variant of a for loop with break
When I trigger a break, it goes through with "completed" output right?
yes. a small redesign is required
or rather a proper design since this wasn't a correct one anyway
It was the best to my knowledge 🥲
good attempt. imagine what you'll be able to do in a year
Can you suggest a proper design please?
I can suggest that you get pen and paper and try to think it through first
As an FYI, even with a break, there could be scenerios where you end up with an infinite loop where it never finds a random vector that is far enough away from all other points.
so it's probably best to end the process after a certain number of tries like a thousand right?
I would instead generate grid points and than adjust them by a random amount on the x and y.
or never get into that situation in the first place
wouldn't that be the same as random vectors?
No because you're base grid points would be perfectly spaced than you change how much they can adjust this base value you by. This could be just 10cm or 200cm depending on the space available.
while Cities.Num() < TargetCities OR Attempts < MaxAttempts do
I had this in mind but mars says to never get in that situation in the first place 🤷♂️
I think I will have to learn that
Ensure there's an out to the while loop, especially if you're working on something thats likely to be hard by randomness alone
by "never" I meant "don't". not that this should be avoided at all cost. just wanted to point out that almost always there's another solution
How hard this is depends on the bounding box , number of citites and the minimumDistance
and algorithms like poisson disc sampling
https://sighack.com/post/poisson-disk-sampling-bridsons-algorithm
if someone cal help me :
https://www.reddit.com/r/unrealengine/comments/1fae42n/help_me_understand_how_references_variables_work/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
Something like this should work. I do use 2d vectors here though.
don't post links to questions on reddit. ask the question here.
sry, ok
Help me understand how references variables work.
I created a class called "BP_Wand" ( derives from pawn class );
On this BP_Wand I have 4 variables (spellSlot_A, spellSlot_B, spellSlot_C, spellSlot_D) and each of them is Actor Class Reference ( that derives from Pawn class );
My question being:
If I have multiples BP_Wand pawns, and if on each of them the spellSlot_A var refers to the same Actor Class ( BPA_SpellProto) would I have data duplication on memory? Will I have four times loaded into the memory the same data?
[ PS: I come from a art background, not IT so yup... I really dont understand how somethings that are basic really work... ]
your question doesn't make a ton of sense. If you have references to 4 different instances of a class, then yes, there will be 4 instances of it in memory. That's not a problem.
I can probably use this instead of my current. But my problem was where to put the break. I ended up using a loop that checked last click location multiple times inside another loop that checked proximity.
If you have 4 actors holding a reference to one instance, it'll only be defined in memory one time. Your actors will just be storing pointers that tell them where in memory the actor is define
Adding to this, its not 4 duplicates in memory of the object, just to where the object is stored.
but its pretty unlikely you need to think too hard about this
Its 4 references to that 1 memory location of the actual instance
also your spell slots almost certainly should not be pawns
That depends, they might be controllable fire balls. 🙃
surely not the slots are controllable
so what i ment is... This memory size will exist 4 times?
Wiggle the slot - wiggle the projectile!?
No
This is the memory cost of loading this single bp , which loads all the rest of the crap (referenced assets etc)
It'll load the base class into memory once. This would then be referenced when needed. For example, if the grid material is already loaded by another BP, then it wouldn't be loaded again, it'll just use what was already loaded.
But!
If the grid material wasnt even needed, but is somehow referenced through a reference you hold in your bp, it will be loaded, even if its not actively used in the scene
If you hard reference the last boss in your bp, the last boss will exist at all times your actor exist, even purely in memory, because you hard referenced it
Same goes for your skills
If you hard ref them, they will be loaded into memory, Even if they're not in the game
Adding to what Squize said, this is why good hierarchy and using base classes for just logic can be very powerful. Base class wouldn't have heavy assets in them such as materials, sounds etc... so even if they aren't being used at that movement, it being loaded wouldn't normally be an issue.
That includes their referenced assets, vfx, sfx etc etc
so if i have multiples "wands" with the same spell class variable, the spell memory size will be loaded only on time ( it self size) and the "wands" will use something that i think its called "pointers"?
or should I use a SoftClass Reference?
Hi, I have two functions where I do the same thing, but have two different results:
- For all actors in the set except us, destroy the entire attached actors hierarchy of the actor, then destroy the actor
- Except it did not worked, so I created a ToDelete array of actors, and instead of destroying the actors immediately, I add them to the list, then delete everything at the end. It worked and I don't understand the difference.
Here is the two blueprints. It looks the same for me, but the behaviors are clearly different, I don't understand this at all.
(It's reversed, the failure is at the bottom)
doesn't destroy actor just destroy all attached actors to begin with
I just tested and no, it does destroy every components but not actors
What you can do is latch on to the 'owning' actors on destroyed
So when you attatch to another actor, you bind to its OnDestroyed event
Oh I think I found out: I think destroy actor removes it from the array. It's REALLY weird, I thought it would result in an invalid actor or something else, so the underlying iterator is messed up. For reversed also work but it's conceptually the same. The edge effect is strong with DestroyActor.
Is that right ?
does anyone know why a breakpoint won't fire ?
even when the function/event being ran is being fired ?
This would definitely be the cleaner approach.
If you add a breakpoint when inspecting a specific instance of an object, the breakpoint will only trigger when triggered on that specific instance so it could be that.
ohhh
so i need to make sure this is not debugging any specific
That's totally intelligent
Yea, when looping through an array and destroying elements from the array, this can mess with the loop making it skip entries. Normally you would need to loop through in reverse.
But I would do what Squize said. It'll save you having to loop all together. 🙂
When you add the breakpoint yea.
and if that debug filter is set it'll only debug on that singular instance ?
well fire the breakpoint when the filter matches the one where the breakpoint is hit ?
normally yes. i tend to have mixed results though. lol
same cause the breakpoint didn't fire and I was on the instance that I added the breakpoint on as in the debug filter was set
Q: Does material graph have a node for adding or multiplying more than just two inputs? Like .. just needs a "add pin" option but doesnt have it .. ?
ALso if I want to do something like this but it be between -1 to 1 would I normalse both vectors first befor passing into the dot or only normalise one of them ?
Try restarting the editor. I've had the odd occasion where it bugs out and doesn't fire breakpoints at all.
so odd thing happened, I just got a crash with Audio Device being the reason for the crash
anyone ever heard of that before
I'm sending an event dispatcher from a widget called BPW_Grid. In the event graph of BP_Grid, I'm trying to bind to the event (shown). Why can't I set the object type?
When I try to cast to the parent class "User Widget" instead, and use the object "BPW_Grid", the logic forces me to cast again to BPW_Grid (instead of just inheriting?). I'm trying to learn casting without making a hard reference in Variables - does the User Widget have a different inheritance structure/protection?
can anyone help please with what could cause a stack overflow cause I'm getting it again for as far as i can see unkown reason
the crash log and generic log doesn't tell me anything specific that it's anything i've added
Let me rephrase my question above: If I'm sending an event dispatch, why do I need a reference on the recieving end? I should just be listening for a call right, so why do I need to get an instance of the widget - what am I not understanding?
Sender doesnt care about recievers
Reciever must care about sender
Its a one way decoupler
So you need a reference to the instance you wanna listen to
In most cases
You want the ui to know about your objects and instances
Not the other way around
In this case I want it reverse since I'm controlling grid size based on a value change. But I think I get what you're saying about de-coupling in one direction.
Shouldn't the logic of what the grid is be on the grid object itself and only listen if the UI changes it?
Oh, I see - I think I was using this as a case to test event dispatch where it sounds like it doesn't need to be (as it's pretty one to one on what controls the grid size so it might as well be direct). Thanks, I'll look into it more and just add the reference for now
Dispatchers are great if you want others to latch on to an event where you dont care who listens
MatchStart could be one
GamePause
TimedEvents..
Inventory updates
Now inventory can notify ui that it updated without knowing anything about its existence
I have a question about performance.
I got here 2 templates both are different.
One template had Master Blueprints for weapons so the code was mostly in the weapons themself.
Another blueprint did create everything in the Character it self, all the weapons are listed but hidden and unhidden depends on the call. All logic for each weapon is in the character.
The file lags slightly when opening it but i am curious how bad is the performance if you put all code for all weapons in the Main Character, compare to separate Weapon Blueprints?
doesn't really matter from a performance perspective. What matters is whether it makes sense from a code organization perspective.
if your characters are picking up and dropping a bunch of different weapons, you probably want well organized weapon classes
if they're only ever holding one character specific weapon then it probably doesn't make sense
Not worth the overhead/boilerplate
Generally i lean towards the masterclass tho
Its just cleaner.
Its a single player game where you pickup weapons on the way then you own it for the rest of the game.
So they never really will go away after picked up you can just scroll through them.
I have currently one code that allways destroys the weapon BP when switching and spawns a new weapon BP.
So i was just wondering since you own all weapons in the end if its mattering that much.
But thanks =)
hey i have a render target with a scene catprue 2d
wanna only show a splinemesh
where can i make render custom depth
or stencil
to only show 1 mesh on render target
How can I dubug/track memory used by blueprint objects?
If its like half-life with 5 weapons, then nah
I see thanks was just not sure if i should go the simple way or do it properly with different blueprints.
Mostly i was scared of the performance hit, the Marketplace asset i check and played around worked well with everything stuffed in one BP but... i wasn't sure if i oversee something that i don't know of.
Hey here's a weird one for y'all. I've had this issue on and off for over a year that sometimes the attach track in sequencer would just mysteriously 'not work', maintaining the parent and child relationship outside of the duration of the track, and I figured out this morning that it consistently happens when 'run construction script in sequencer' is enabled on the child actor. Even if there's nothing in the construction script at all.
Any thoughts?
Child actor component, say you?
Is it possible to get overlapping actors of a box collision when it starts overlapping? For some reason I can't get the bounding box to sample the static mesh green floor in this scenario. I tried setting that box to overlap everything in the custom collision, so I'm not sure why it's not detecting more than 0 ever.
No. I have two different actor blueprints. For sake of example, we'll say Cube-BP and Sphere-BP. Both are in sequencer as spawnable objects. If I use an attach track on Sphere-BP targetting Cube-BP in the sequencer, it will work as expected, unless Sphere-BP has 'Run construction script in sequencer' enabled in it's class settings. If it does, Sphere will remain a child of Cube in the outliner, regardless of whether the playhead is over the attach track or not
You can get overlapping actors that are currently being overlapped. Not on enter or exit. As you see in the BP screenshot. But for some reason it's not detecting the SM.
Yes, you can get currently overlapping aswell as being notified when it changes
Usually id do
MyEvent()
{
CollisionComponent->GetOverlappingActors()
CollisionComponent->BindOnBeginOverlap()
CollisionComponent->BindOnEndOverlap
}
MyEvent 90% of the time being beginplay
In macros, is there a way to duplicate inputs to avoid links everywhere ?
I don't want it when it changes. Cause nothing changes. I need to just see what's there already at that moment. I'll try to do more tests and figure out another way. Thanks for trying.
The really odd thing is it detects when the character is in, but not static mesh. Oh well, I'll fiddle with settings.
Keep in mind collision/overlap is a two way street
Damn it, that was it. I forgot to give the floor the collision check for overlap.
Always something small and stupid.
Thanks for that!
Yepp😅
IIRC the SceneCaptureComponent has arrays in the details panel (if it's an actor) or BP nodes if it's in a BP, to "Hide Actors" or "Show Only Actors".
I've been using it for creating a holographic projection volume, where I can choose which actors I want to render to the projection and which actors to hide.
When I get home I'll open UE and double-check my BP node setup for adding actors / the details panel. But it's luckily pretty straightforward.
Hello, I am very new to unreal engine 5 (started last week). i am working on a small game whereby the player can interact with a PC. The PC screen is basically a widget which the player can interact with. inside the widget there is a bunch of text and a couple buttons. when the player presses on of these buttons with the enter key it will change to a different screen. there is no mouse interaction. I am struggling to figure out how to use the arrows keys to select one of these buttons and how to make the screen change when pressing the enter key. Can anybody direct me in the right direction?
you can use common UI plugin
is that in the store?
no, try to search in plugins window common ui
where can i find this window?
it's like a layer widget with complex navigation such as menus with layers submenus or popups
I recommend this tutorial.
https://www.youtube.com/watch?v=80flMwKhhcY&ab_channel=MrButier
Welcome to our UE5 Common UI crash course! If you're diving into game development or just curious about creating cool interfaces in Unreal Engine 5, you're in the right place.
Buy Me a Coffee: https://buymeacoffee.com/mrbutier
Join my Discord: https://discord.gg/xdvsmCPbf7
Xelu's FREE Controller Prompts: https://thoseawesomeguys.com/prom...
ah thanks
i have been bashing my head in over this the last week. so lets hope this works for me xD
Hi I have a bit of weird question. At least internet can't seem to understand me.
If I create an actor component to act as a parent class.
How can I turn a child of that class into a Scene component (in Blueprints) or is it not possible. Or do I have to make the parent a scene component and just work with that (Not to big of an issue just curious)
The parent has to be a scene component
You can't link up like that. You've branched off from an actor component. You can't join back in down the line with your changes as well
oh true I completly forgot how parenting works xD mb indeed a stupid question
I have successfully setup a camera on a spline for a side scroll. Is there a way to get camera bounds in World Coords. I want to setup something similar to MK camera system were it meets between 2 players and when they are at the edge of the camera view it doesnt allow them to move back any further (For Reference).
quick performance question, would an interface returning a variable be better than get actor of class ?
why wouldnt you just communicate directly
getActor is also unreliable if you got several instances of that class out there
neither have any noteworthy impact on performance
hello, does anyone know how to make a scaling mesh in real time generate overlap events? Scaling, not moving.
The goal is to make a growing torus apply damage to a character, like a shock wave
Anyone Good with Vectors and/or line tracing? I'm trying to have a start vector at (0,0,-100k) and a midpoint of (mouse world location). Essentially making the line trace go though whatever object I point at. How do I get the trace to extend beyond what im pointing at?
Do you need a Hit Result, or just the actors hit ?
just the actors hit to apply damage to it
sounds like a basic ray from camera + camera.forward * distance
(0,0,-100k)
Z is up, not sure if thats what u want @chilly geyser
right after you change the scale , you can check for overlapping actors
explain a bit more, does the line originate from below?
Yes it does, sorry helping wife bring in groceries
if you want to extend up, just add a vector to the mouse cursor location
0% tested , but i would start here
that doesn't work 😦 I will try another approach, like creating 2 capsules inner and outer ring
but I dont get why scaling doesn't generate overlapping events
but moving it does ?
try moving it to where it already is , and see if that triggers
I want the mouse as a midpoint for the vector
Was really hopeful on this haha, no dice
Remembering back to my days in school when my teacher said "you'll never use this in life"
yah , I wish I took all the better math classes
Amazing! I love you
Is the mesh the Root , by chance ?
that worked ?!
I tossed some notes in there to help under stand it
Seems you're much more intelligent than myself lol
no, its a different mesh
Now only when my character moves it generates the overlap,, but if I stay still it doesn't
Yeah I'm about to study it after dinner, thank you so much though!
hmm, maybe alternate moving it ?
seem like there has to be a better way...
why the flip flop?
still not working, even changing its transform every frame, only when my character moves it overlaps
too much time spend on this issue😵💫
Hey, how would I go about controlling events in a level? Toggling lights, doors opening/closing... What is the best way to go about that?
These events would be triggered but not controlled by the player
probably an actor that you use for delegates
delegates?
since the actor would always be loaded once in the level you can cast to it
they are known as event dispatchers in blueprints. they allow you trigger events
just cast to the single delegate holder actor from the lights or whatever needs triggering and bind their event on begin play
So once central actor that triggers events all around the level? Is that right?
no. imaging a light switch for instance
it's a standalone actor.
when it's triggered it fires an event (delegate)
and the lights are listening for that light switchs delagate to fire before toggling
Right, so what sends out the 'signal'?
the light switch actor
the same actor?
uh. light switch actor sends signal
light actors listen to signal
oh I see
What if I need a program that controls the light actors seperate of the light switches
like a level blueprint
there's not a single answer to everything though. i wouldn't use the same setup on doors unless i had a compeling reason to.
right the doors would simply trigger themselves thru a hitbox
inside of the same actor when the player overlaps
then you can do that. that's the advantage of the lights being actors themselves
the light switch would just be one way to toggle them
Where would I have the logic inside tho?
in whatever other actor you want
Ahh, great. Thank you very much
personally i don't think I'd necesarily use delagates for this use case. but it is a viable option
Seems like a better use case for a component, or a interface
Why does it seem like a better option?
interface would be prefered by most
I forget my blueprint communication info
from experience.
I would have to look back
Why interface over delegates or event dispatchers? Sender and Receiver wise?
because the light actors would specifically have to register to the light switch. but I'd personally rather have the light switch register the bulbs
It's basically "Should the light bulbs be responsible for all the objects that control it? or should the objects that are controlling be responsible?"
right
So not only in my light switch actor, but also In my other actor that controls bulbs + doors + etc... I would also have to register everything that it controls? Is that right?
again, no one size fits all solution, but for your use case I'd make a interface
IControllable
and define a function "Toggle"
now the light bulb actor implements the interface and would implement the function and define the logic
When toggle is called, toggle the light brightness / visibility
for the door I'd make it implement the same interface, and implement the same function
but the logic here is
When Toggle is called, open / close the door
of course you could also define functions to set on and off specifically
yeah. from experience, and having knowledge of tools, programming patterns, and better code architecture you start learning what the better solutions are for your specific problems.
sometimes you just have to break down the question to something simpler
Yes, I think I have ADHD so It takes me a minute longer to understand things sometimes haha 😅
Thanks tho this is a huge help
What is Inhertied vs Implemented?
In the interface I would probably need a separate Toggle Light Bulb, and Toggle Door correct?
And then another actor to actually trigger the interface function
Yeah that correct. Inheritance a concept where a class is a child of its parent and it inherits all of its parents properties and methods
Not quite the concept we’re going for here.
apologies fixed wording to make it say implement instead
no the interface just has one method
Toggle
the controlling object doesn't have to care about what the object is, or how it behaves. it just has to know that it does have this interface
on the lightbulb actor, implement the Toggle method, and then toggle it's light intensity, or visibility when the method is called.
But then wouldn't the interface toggle all actors that I implement it in when I trigger the toggle function?
Or am I not understanding that right?
that'll work fine 🙂
no, only registered actors
on the light switch create a variable of type BPI_Controllable
then when it's interacted, iterate through the array, and call the toggle method of the interface
you can do the same thing for like a control panel controlling those same lights
i'm confused on this part
when what is interacted?
when the light switch is interacted with
What do you mean by iterate through the array?
for each loop.
And why do I need an array for this ?
to reference the objects you want this to control
ahh
and just like that I'm all done with the 9-5. (time to drive home) gl
here's a good resource to getting your programming up to speed
http://rbwhitaker.wikidot.com/c-sharp-tutorials
it's c# but everything up to chapter 27 will be directly applicable in C++ or unreal blueprints
Ahh alright mate, appreciate the advice
and the resource
When you get the chance, what are your thoughts on the learncpp.com site opposed to the one you just sent?
C# if you are going to use unity, learncpp.com if you are going to use unreal
Or both eventually, c# used by 60% of dev in the world
Directly applicable is a bit misleading because the languages have distinct differences. And not everything is directly applicable either, even conceptually.
Learning C# can be great if you don't think you're ready for CPP but want some programming essentials, but don't say it's directly applicable
whats the inverse of this> ==? how do i resume it?
Set Movement Mode
restart movement worked
Trying to make a line trace to the ground, what would the ObjectType be for the landscape?
Nevermind, I figured it out
Thanks for sharing
You're welcome
I have an ability that's supposed to slow down the character's falling speed dramatically, but I don't want to activate it instantly by hard setting the velocity to a particular value.
My impression is that I have to on tick (or on timer) manually change the velocity over a desired period of time until it reaches a certain point, likely using a curve of some sorts.
Is there anything in blueprint that can help me perform this sort of operation across multiple frames or iterations, or is this something you just end up having to DIY?
Is there any way to use Editor Ticks within Animation Montages?
Components can be good for this. Just depends on what you need. How long does the ability last? Does it simply slow the character down til it stops mid air? Slow it down for up to 2 seconds regardless of whether it stops or not?
At this point let's say it's always a slow-down that occurs over 1 second and always ends with the same descent velocity until the player releases the key
My naive implementation here would be some kind of on tick process that checks how long it's got left to process the slow-down and how fast the player is going, and slow them down by the right amount until the time runs out. Or I could actually just look at a curve and apply that value to the player's velocity.
i want the platforms to keep moving from the position they were immediately stopped and not the beggining, is there any way to do this?
Hello guys I have a big problem, I don'r understand why the only E key stop to work. But with the other keys it works.
Somebody could help me please to solve thi problem please?