#blueprint
1 messages ยท Page 223 of 1
i like to recommend C# because it's a much easier language to understand than C++. Unreal uses C++ but it's like learning to drive a manual transmission for your first car. may be a bit easier if you start off with something a bit more approachable.
Conceptually almost everything up to 27 is applicable.
Implementations are not. but that's not something you don't have to be concerned with until you actually need it.
I do get a lot of hate for recommending C# as a foundation to programming in this specific discord server so that's just my take. I used to teach, and my method was to make learning more approachable, instead of telling everyone to dive to the deep end right away. take a look at both sources. and see what you like. either way you'll definitely have a better foundation going forward
what i strongly believe (and im sure most would agree with me here) however is that you shouldn't follow blueprint tutorials to learn programming. I have yet to see a good course that actually teaches you how to good programming concepts / principles.
No it doesnt work
is this wrong? it doesnt destroy some of the spawned actors
You will have to look around where you use the E input. Ctrl f type the key and click the binoculars
Then check for every bp that uses it. Click on the event input and see if consume input is ticked
Binoculars?
On top of that your widget may also consume inputs
So that's another thing to check
Yes is consumed in two flibook actors
But only when the player is begin overlap the box
Well if your key is consumed somewhere, the same input most likely not gonna work in other places
Because it's consumed
Is there a way to consume it in multiple actors?
you can untick consume.
I tried but it doesnt work
Like @desert juniper shows but usually if you have to do that. You have design problem
It doesnt work only in this specific BP character
That's all I can think of tbh.
Either keys are consumed by other bp or UI
I'm putting all E key to not consume
Might be a needle in a hay stack if you have inputs everywhere
Check your input mode?
Might be set to UI
For it to work ,input mode must be at least game. Or game and UI
Nothing
All happens when I created two actors, and then I change it making the "Reparent blueprint"
Is this done in for loop? Because for loop happend in a single frame.
If that's the case, only your last actor most likely get destroyed.
What you can do is set a life time in the actor being spawned it self, no need to tell it to commit the unthinkable from the "spawner"
it spawns the actor when bullet hits to surface
i want that actor destroyed after some time
Try using "set life span" on the spawned actor instead, that way the spawned actor will be responsible for destroying itself
Anyone know a solution?
again, something is likely consuming E.
look in your character BP, level BP, etc
Ok but I uncheck everything and it happened also at the start
ooook it works
I didnt see in the level blueprint
can someone help me with ads?
Thanks a lot guys ๐
For sanity sake, don't pop inputs everywhere
It can be a needle in haystack
But what is the best alternative?
To do what
Normally inputs are binded in player controllers
Or characters
Depend on your game
If you just want to do some test, use either of those two and don't place it else where
If E is to interact I would have that in the player controller
Characters if you have different character you can posses , e.g. a car or a plane
You want to avoid level bp, they are ok to test around tho. You can always use custom event for that as well.
1 step above literal key inputs is action mapping. and another above that is the enhanced input system
๐ฏ I don't use those legacy keys beyond testing
Enhanced input just inheritly soo much better
(not a architectural solution to how to handle inputs, just as a replacement for hard coded key values)
Just realized unreal's deprecating action maps
Also less deprecated.
is Enhanced input being deprecated?
The old input actions are.
Eh, 7.2 maybe.
wouldn't mind using them in empty project without the extra steps to setup IA
You can still use the direct keybinds for quick stuff. They're just debug marked so won't work in shipping.
UE5 is killing me with these context fuckups.
anyone know how to get rid of the error?
You're using the not valid side of the IsValid node to do things that should only be done when it's valid.
idk why but before it gave me more errors now no9ne thx,
would you happen to know why its not adsing? i have the event and input for it
You plugged the set node in?
yes i have it on the one i showed the anim one too along with it turning on and off in a BP
just show the latest code
the fixed one
your ADS pin is still not plugged in
what's the actual issue here apart from that?
Brother don't do multiplayer when you are at this level
it's making learning many times harder
oh wait
yeah that dident work
you want to set the ADS in your ABP to the character ADS
drag and drop the isAds from the variable window to an empty space, select set
it seems like you are following tutorial or some sort and blindly as well on top of that.
you need to actually understand what the code does and the purpose, informing the ABP of the ADS variable change is a start but not a sure fix, you do need to check where in your anim graph the boolean are actually used
ok. thx
How do I get my character to not try to walk downwards when I point the third person camera is pointed down? I know that somewhere the player controller is basing pitch off my camera view, but all the Use Controller Rotation ____ options are turned off on my BP.
All the solutions online are for first person cameras which isnt working for me
Deleted GetPlayerController, GetControlRotation, GetForwardVector, and GetRightVector.
Find the nodes GetActorForwardVector, and GetActorRightVector and use them instead.
Issue with this, character no longer strafes but now spins in circles when I hit A or D
I also still need it to go in the direction the camera is facing when I hit W
Then you have some form of auto turning on which is inconsistent with the term strafing.
You could put your old nodes back. Create a Rotator from XVector from the Forward and Right vectors, and break that rotator. Make a new rotator with the same Yaw, but Pitch and Roll at zero.
Also consider using GetController instead of GetPlayerController.
How come, what would the difference be?
GetPlayerController gets the first playercontroller on the machine. If you have splitscreen or are a listenserver, this can cause issues. Less of an issue for singleplayer or clients in a multiplayer game. But it's still good practice to understand that you want to use THAT pawn's controller instead of some random one.
This method works though, thank you so much
Hello all,
I am trying to make a racing game with a vehicle control scheme akin to Haloโs vehicle control. I did this successfully in Unity Engine around a year ago with some online help, so just translating this to blueprint and Unrealโs animator is my main issue.
For those who have not played Halo, the right thumbstick controls the camera orientation and the left thumbstick Y-Axis controls the throttle and brake. The steering of the vehicle always orients the vehicle to the direction that the camera is facing. Would anyone mind pointing me in the right direction for achieving this in Unreal?
(For reference, I made the C# code provided by the user in this link work for my purpose in Unity: https://discussions.unity.com/t/has-anyone-ever-made-a-vehicle-control-scheme-similar-to-halo/464094/2)
what's a good method to make an AI not move and later move on demand?
I tried using a BB condition, but somehow it didn't work.
Unpossessing and repossessing doesn't make the AI BT work either.
My dumbest workaround is to set the movement speed to 0...
Thereโs a StopMovement node. You can also StopLogic from the BrainComponent if you want to stop the tree entirely
apparently the service has to be spammed at the action instead of the head selector in the BT, which is stupid... but it works...
because at the head selector, it is only called once
What service
Well yeah, the tree doesnโt get reevaluated above the first selector since you have no decorator or additional branch on it (and the active branch would have to abort entirely to go all the way up)
Curious Question: Does the Timeline, "Finish", Execution Pin fire when it's being reversed? Does it finish when it reaches the Beginning?
It finishes both ways last I checked
But itโs Completed not Finished, no?
Yikes! I didn't know that nodes which are not even connected with execution pin get loaded in memory! https://youtu.be/EQfml2D9hwE?si=3N4r95O6V9dUz9FI&t=650
Interfaces & Event Dispatchers are both methods of enabling decoupled communication between different parts of your game.
Understanding them is essential for writing clean and well structured code.
This video explains both interfaces and event dispatchers, when to use them, and most importantly, why use them at all.
Sign up for the free chat ...
I thought anything which has no execution was ignored. Or is it just for Cast nodes?
Sorry about the delay! The Timeline I'm looking at the, "I'm done", pin reads, "Finished"
Finished is in both directions
Accompanied by the output direction enum
Is there any efficient way to pass parameters to an event that is called by a timer? A global won't work, because it might be overwritten before previous timer is finished.
Some sort of hashing would work, like saving an int on a timer key, but then again there is no way to get an elapsed timer from an event.
The only idea that comes to my head is to spawn an Object that holds all the logic (the timer and the data), but that seems like an overkill.
This looks a bit flawed?
Wouldnt the cooldown reside in the skill or skillmanager?
And you can get elapsed time, by the timer handle
Then ability or ability manager would have a dispatcher for the UI to signal its cd is done (and update cd tick)
Or just using GAS where these systems are already made for you. ๐
hey i try to use the trace sphere by channel
sometime it trigger lot of time when it touch the target
i don't understand why
so the basic movement is like that
blue vector, and with the impact point of the radius of the sphere trace
it generate the normal to change the direction of the sphere
most of the time it works well
how do I do a infinit loop?
but sometime it act like that
While(true)
oh ok
you mean use a while loop?
I guess so? Why would you want an infinite loop?
like if there was multiple collision point at the same time ๐
no it gives an error saying that its an invinit loop and that it doesnt work
๐
basicly I have a flashlight and I want it to flicker like every 1-10 secounds
show us the blueprint ๐
Definetly ๐ Perhaps a tad more complicated tho
maybe you call a function during a function and call back the same function again. it's also a way to generate an infinity loop
Less complicated than anything he's making. Make ability. Apply CD GE, move on with life.
basicly this is what I have rn so I just connected the last pin to the first which doesnt look clean at all
better to use timers for this
Connect it to ui, block with tags, , Damage calc etc etc?
But yeah it quickly piles up even with custom systems
Sounds simple on the surface, but once you start thinking about it in detail... ๐
this will always the same value
?
so you will always go to false
yes
but this is not the loop I meant
but if you always go to false you are into an infity loop
yea I fixed that
but I meant
this here
like if that is possible with a node
put a print after the random int float
instead of connnection the last pin to the first?
to see if the value change on each loop
yes it's called Set Timer
it didnt there but i fixed that
oh ok
you can set a timer once with a random delay instead of a loop so that you get some random timings instead of the same interval every time
All the more reason I say GAS. The foundation is already done for you and all you have to do are those extra things. GAS isn't any more complicated than any other system would be if you needed the same things and you don't even have to use a vast majority of it. Rolling your own ability system is a daunting task that always seems easy at first. And then there's that next little thing. Before you know it, you're months of work out creating and debugging code that is literally handed to you already in the engine.
That said. I do still hope they're planning on helping their scripter implementations. Would go a long way to be able to have attributes not from a third party plugin. Doesn't bother me, but it would help the perception about it a lot.
set it by event? or by funtion?
by event ensures you can still use async nodes like delay and makes it easier to see all at once
by function will require you to make a function which cannot be async
Im surprised they didnt out of the box. But then again, they still only got header previews. Feels like they'd be able to make native c++ classes from bp base classes already
Along with enums, structs, and heck, attributesets
what is that node
Intensity?
it set the intesity of the flashlight
ok
it do the flicker ๐
I did it now like this but it gives an error
you plung the beging play to the set timer by event
and you create a new custom event that you link to the event of the node
oh ok yea I see what u mean
like that the timer will call the LoopEvent on each Time
no one have an idea about that sphere trace by chanel?
Sphere trace won't cause that. It's just a simple trace that'll go til it hits something and stop. If you have multiple hits like that, it's your own logic calling more than one sphere trace.
but that can be related to the speed of the object before hitting something
kind of hard to follow but this picture makes me think you are receiving multiple sphere trace hits when you only expect one. a sphere trace gives you all overlap hits and up to one colliding hit. the collision presets define what is a colliding hit and an overlapping hit.
yes but if my object move faster. than expected? will the collision point be unique?
What does an object's movement have to do with a sphere trace?
sphere trace will tell me when i have an impact
Why doesn't the object tell you that?
if my object move fast he is not able to tell me that. someone suggest me to use trace for that
but it's the same in fact
are these projectiles?
it's a pawn with a component : FloatingPawnMovement
and i increase the pawn velocity over time
but with faster velocity, the collision are not detected properly anymore
so the object go though the wall or things like that
if they are projectiles (meaning anything that is "shot") and they are moving very fast, then you can miss an impact event when they have collision response, indeed a sphere trace would avoid that because you are effectively doing a trace projectile instead of a physical projectile. You can also enable continuous collision on the projectile which sometimes helps if you don't want to do a trace projectile
sounds like you might want to try continuous collision
and when i touch i change the direction by the normal of the impact
You're using last frame's velocity?
also, setting velocity directly will exacerbate this issue, if you can instead apply force you may get a better result
i use only the
Why not just use a PMC with no gravity or slowdown?
don't know the last frame's velocity
You set it above after your trace.
what is a PMC?
ProjectileMovementComponent
it is purpose built for fast collidables, but are you making a billiards game or something? if so, I wonder if PMC is going to work for that
Ccd only works so far. Traced projectile cant really miss with a decent implementation
Does anyone know why in my datatable, sorting doesn't seem to work on ints? https://i.gyazo.com/ffe6a8da453ffd77e505a6c7f5b8eda6.mp4
Unreal Engine bug? ๐ฆ
looks correct to me, if the field is a string
so it's not that it's not working
it's that it's sorting it's string representation
well shouldn't ints be sorting from small to big and vice versa?
think of these like strings not numbers
hmmm ok but why is there a sort button then? ๐ค
if they are strings, it's sorting correctly. I'm not saying thats desirable for you but that's what's happening
Is there a way to change it so it sorts properly?
As in from small to big and vice versa?
good question
I could probably export the datatable to excel and sort it properly there, but bit tedious
yeah that works, I'll just make the entire DB using excel
in-editor indeed sucks, full agree lol
Why can't I give a static mesh to my blueprint actor?
I've dealt with velocity based clipping, ad there are a few ways to fix it
Yes?
One is you need to make a way bigger collision box on your object
second is you change the FPS of the object to natively higher than the FPS of your game
so it'll check between ticks
Other is, depending on the size and length of the object-- say you got an arrow. You want the collision box to be at least a 1/4 longer than the object
There are other things like continous collission
OR set up your detection through a function instead of through the tick, because a function event is more reliable because you can set up the time between checks
But is it the collision the issue or the lack of collision because of the speed
I extend my collision box
its the speed
And notice the collision is inside the box
If you're going too fast and using event tick, it'll only check on that tick
So
If the object is going too fast, and moves too much bewteen ticks, you need to set up a function that checks twice as much as your FPS
like
If you make a function event and set it to loop and set the timer to .0167(120FPS) and set your games play rate to 60, it'll stop having issues with detection. Unless you're going excessively fast
but I was able to set up my vehicles to collisde properly going at 50,000 UE units without issues.
BUt
you have to set up your worlds collision to continuous. Not only your character or object in question
So there is an impact on the performance? How do you set up the world collision to continuous?
A small impact, depending on how you perform the checks
Event ticks take more performance than event functions
and
a event function can be set to check only when needed. Event tick checks all the time until the object is destroyed
hello, I would like to invert the turn rotation of my character to see his face. Can someone help me please?
use the controller control rotation node
ok thanks i will try to change my approach
If it doesn't work I can probably show you, later
i think i will manually set the limite of my world position
do you mean "Use Controller Desired Rotation"?
by cheking it changes nothing :/
Why does this event not work for me?
Does your character have a movement componenet?
sure
yes
I think you can check in the boom to do it directly
This actor has not had input enabled.
can anyone confirm without a doubt if blueprints suffer a performance impact from having many calls to the same variable or not?
sometimes having just one call makes too much spaghetti
They do not, sometimes. It's a BP thing with how it executes nodes. Sec
right, they're pointers, thanks
Pointers?
a reference to the variable, the nodes aren't holding a value
Still, this might showcase better how BP handles that. These aren't variables, but variable access works the same as a pure node.
ahh, good to know. got it
so in this case, the + operators are like pure functions and it takes the original value on the second call
How can I enable it?
This still doesnt work, I also tried on the controller
Correct. At least per executed node (node connected with white lines). Basically execution runs the executed node. Before it runs it's logic it will go through each of it's parameters and call connected pins, which will call their input pins. But if the node has already ran for that specific executed node it will just retrieve a cached value since it'll be the same value anyhow. It's neat to learn how BP works like that because it'll save you a ton of performance costs. Specially when it comes to things like a pure node returning an array and using it in a ForEach loop, only to realize that the thing getting the array is being ran every loop iteration.
You didn't pass the PlayerController you want to enable the input for.
**[HELP]**I'm trying to scroll down by holding down the button in the combobox, I wrote the necessary code, but it doesn't work on the phone, it doesn't see the press button of the button, I opened the setting from the project settings, I opened the touch click setting, but it doesn't work, I can't get interaction on the buttons I tried touch input, it doesn't work in the combobox, it doesn't work in other places, it works in other places, I tried to write into the button, it didn't work again, what to do to make it work on the phone
https://youtu.be/KE_8OwmHY-A Can you please look at minute 8:17 ?
This guy doesn't seem to need to enable inputs yet it works
๐Get Access To All My Unreal Engine Courses At : https://www.unreal-university.com/courses
๐Get My Free Unreal Engine Beginner Course : https://bit.ly/46mUWMr
Intro 0:00
Event Being Play 0:36
Event Actor Begin Overlap 1:20
Event Tick 2:09
Boolean Nodes 2:38
Interger Nodes 6:01
Vector Nodes 8:17
Delay 10:29
Retriggable Delay 11:02
Flipflop 12:23...
That is in his possessed pawn.
And I can't figure out how to reference the controller blueprint
It has input enabled from possession.
Because what you created isn't a pawn.
You need to set it up in the begin play of your character
Otherwise
you can use the Debug key
Those work without input
The video is also an Actor
but I even tried on pawn, it didnt work still
this is pawn
Eh?
what do you mean?
Debug keys still require input enabled.
Does it?
They do not require an applied context mapping. But they do require the actor to have input enabled.
Maybe set up enhanced inputs
Okay but pawns don't require enabling right?
why does it not work on my pawn then?
Is this blueprint specified as your player character in your GameMode?
^
Pawns require possession to have input enabled. Consider something as simple as a character and a car. You don't want inputs in the character when you possess a car. Likewise when you exit the car and repossess the character, you don't want the car to drive off when you hold W expecting to run. Thus possession enables and disables input based on which pawn your playercontroller is currently possessing.
Well, require is a bad phrasing. They don't "require" it. But they do it automatically.
I need to watch some videos explaining this stuff
there's alot i dont know
#GameDevLife
the unreal learning library is so overwhelming though
where do you recommend I start?
Is this the place to start?
Is Blueprint composition the wrong path to be taking in Unreal? I am a new Unity convert and have been approaching Unreal designs using my Unity understanding, but have hit some walls I don't understand. I have built out two Blueprints; one for a "Collection Zone" that holds references to anything that overlaps it with a specific configurable component and one for a "Hand" that the "Collection Zone" would be attached to. I then created two "Player" Blueprints and added the "Hand" Blueprint to both as a child then added the "Collection Zone" Blueprint to each underneath the "Hand" Blueprint instance. In the "Player" Blueprints with the "Hand" and "Collection Zone" Blueprint instance children I cannot change any variables like the "Handedness" value on the "Hand" or the "Collection Zone" class to check for. Any pointers on how something like this would be done the "Unreal Way" (and not have to manually setup everything in each player)? Side Note: Both the "Collection Zone" and "Hand" Blueprints have Actor Components on them for their functionality.
Or this?
Honestly that is a loaded question no one can really answer. Many many factors. Personally I recommend just finding some shitty tutorial to follow for a couple days. Something with a bunch of short 30min sessions that has 10-30 in them. Some "Build a survival game" or "Build a city builder" thing. Follow them. Do exactly as they do. Immerse yourself in the engine. When you're done. Go back through it step by step and do it again but stop and pause to learn why things are being done. You have a lot of concepts to learn still and no single guide will cover them all.
For starts, a single player character blueprint. You can spawn multiple instances of this, one for each player.
If you cannot edit the properties of the component within it's actor tree, then the property in it's initial BP needs to be marked as InstanceEditable in it's own class.
does the projectil movement component affect the collision of the actor??
Affect, no. All any movement component does is sweep the root component of the actor.
ok so i had a root scene that was not good with a sphere. i guess there was an issue like that. i remve the scene and only keep the static mesh and it's ok
there should be a node for this
For what?
checking against table rowstruct
Not really sure there's a big point for it? You're already checking it with the GetDataTableRow.
unnecessarily checking against the hashmap to do so.
Data table row handles are a very neat feature, and would be worth fleshing out
You can check if the Datatable is not null and that the FName is not "None". There's a helper for that in C++. But it won't specifically tell you if that row actually exists in that datatable without checking it same as GetDataTableRow does.
I can make a custom thunk in c++ in an hour that will do exactly what I want. I'm mearly voicing an oppinion.
Does anyone know much about collisions? I am attaching an actor to my actor and setting that actors collision to query only but it's affecting the character movement as if it still have collision on
In blueprints, how would you move a primitive component around (with Set World Location etc) while keeping world collisions enabled?
The Sweep boolean works, but once a collision is detected it doesn't update until the collision is lifted
Lifted as in backtrack a bit?
I'm setting an objects location with the crosshair, and if I drag it into the ground it registers the collision when Sweep is true, but if I drag to the left or right from there nothing happens, until I lift the crosshair up from the ground
With Sweep off, the object just clips halfway through objects around it
Couldnt you offset it with the sweep result ?
If thats the behaviour you're looking for..
You are probably correct, I was just about to test it out ๐
When a collision is detected = Offset the primitive by a unit or something to keep it moving
I think you can figure out penetration debt from the sweep aswell ?
Probably, but I don't think I need it for what I'm doing. As long as the object keeps moving alongside the surface when the target vector is penetrating another object I will have achieved the intended behavior I'm looking for
Sigh. New to Unreal 5, the whole enhanced input is driving me crazy. I've used the old methods before but something as simple as moving a camera doesn't want to click for me. Yet to find a tutorial that just starts from scratch with oet yet either, even trying to reverse engineer the premade projects hasn't gotten me far
Input-Action Object == Actions as you would define them in the project settings.
Input-Mapping-Context Object replaces that entire menu
So you need to Add->Input->InputAction for every single key-press/Event/input action you need.
MoveForward, MoveRight, Jump, ect...
Bind all of them up in an Input-Mapping-Context
*Enhanced Input Local Player Subsystem needs to be called from a player controller
Nothing, if it's a shipping package
anyone know any tutorials to add button panning to increments of say 90 to rotate camera around person or could help me with code to do what i want it to do?
Hey.
I made an animation. My goal is to play animation on button press
The problem is with the first one
I dont know how to freeze it
At the last frame
I think if you want to freeze it like IA->press hold IA->release you would need to create a state machine.
Animation montages play single fire animations. If you want to hold a state you probably want to blend a pose in your animation blueprint
Notify events are events that fire in your animation BP. They are triggered from animation montages
Ah
might try this actually
these are in Anim bp
there is also this event in the character
If I were doing something like D&D stats, and I wanted to make each stat its own struct so I could modify it and track those modifications - could I slap all those structs into an object and put them on the character as a component?
I'm pretty sure I could and I could test quickly, but I like asking first so I don't feel disappointed when I dumb it up ๐
Arn't D&D stats as simple as an integer value?
Well, the stats themselves sure - but what if your item gives a bonus, a buff gives a bonus, whatever - you could probably stick those in as they go but I'd like to streamline that calculation
how do I change a widget size in the blueprints?
size box, set the width and height as variables
buffs have a lifetime, and items are equipable.
ok
In my mind your stat struct would look like {BaseValue=10,ItemValue=0,BuffValue=1}
I cant drag it into the text?
right click on the text, wrap with -> size box
and then getStat(ID){return BaseValue+ItemValue+BuffValue}
and how can i set the textsize wiht that?
I guess my question was more about the component aspect, as I haven't used them very often - I know how I'm setting up the stats and whatnot, but instead of putting them in as variables directly on the character base bp, I could make an object that has them, and add that object to the character base so I can call on those structs as needed instead of having them sit in the variables list
Components are good and useful lol. the lend towards a modular design.
It doesn't really matter where you put the logic
but like, that is how that works, right? info in object, add object as component to character
i guess I was looking for a very specific very dumb answer lol
My blueprints were messy as sin so I'm recreating them all in a new project and trying to make it more clean, now that i know it works
yea that's workable

on the text object itself, in the details panel - this might be a video you need to watch tbh, I don't have any widgets available to screenshot
probably not very scalable
i mean, there's not gonna be many ia -> play montages anyway
sounds like a situation of if it works it works
But there's a problem.
Animation doesn't play till the end, really. It's just playing to the half of all frames
In such flow
bro learn how the Notifies work
Like here xD
Even though it's full MM_Idle2
It doesnt play till the end ;-(
Ah maybe it's because of the blending out or something
you can create an animation sequence from a single pose.
and then add it into your state machine
or you can do the montage thing the way you have it setup, add a notify, and see if it spits out the right name
If you do it that way I would add an interface for the AnimBP add a three functions called Pose begin, PoseHold, and PoseEnd
select by enum, and utalize that pause montage function I showed earlier
that way you can hold the pose at any arbitrary location
So there is string to color
and it have a flag for returning false if it was unable to identify the color
there should then be a list of named colors that unreal use to check that against,
do anyone know where I can find that list of named colors?
scratch that I forgot you can add sections
When my character hits a trigger it starts simulating ragdoll physics, which works, but it also seems to get a large impulse applied. Any ideas?
oh i think i understood it wrong, saw it and assumed that "red" "black" "green" type sting would be used
yea, that doesn't seem to be the case
this looks to take in the actual rgb as text and parse it
Hello, the pedestrian is supposed to run away when a gunshot is fired, but currently he runs away at every sound. I wanted to control this via a report noise event with the tag Gushot but unfortunately the sound is not filtered - any ideas?
๐ค maybe you can use an EQS test to filter the sounds, havenโt tried it tho. Use #gameplay-ai for these questions, thereโs people there with more experience
Problem here is that I can fire this in the air
And the character freezes in air as long as I hold the button xD
The idea is to check first if the character is basically idle or something
or like in the state of being on floor
if that makes sense
Thereโs a built-in isFalling Boolean that goes True as soon as your char is in the air. Use it.
Hello, is there a way to create blueprints in my level that is separate from the Level Blueprint? I want to create a manager to assist my AI in the level. The idea is that the AI checks if a manager is present in the level and then spawns one if there isn't one. I know I can do it by spawning an actor in the level but that feels a bit hacky. Is there a better and cleaner way to do this?
I have a variable on my characters for spells to keep track of what spells they have. When I remove a spell from the array variable on the character and wipe save, the character has spells I didnt assign to it. Does anyone know if this could be because the array is a class reference as opposed to an object reference?
Does anybody know how I can reference this actor to set up a texture/material update?
The issue I'm running into is that this object isn't treated as a traditional mesh object and so the Dynamic Material Instance method (which seems to be the most common thing I find online) doesn't work for this particular object.
hey guys for a ledge detection system i was thinking of doing a sphere trace, if it hits something then do it again, and if it still hits something hit again until there is nothing that the sphere tracec
would this be performance heavy if its done every 3-5 seconds based on the ability cooldown?
I should rephrase my question
I meant edge detection, so if the player is aiming for a edge of a object, they are teleported to the objects surface instead
kinda like a aim assist
used in games like aragami 2 and spiderman ps4 as well as sekiro
@outer echo "This also leads me to believe that the event on tick is also working correctly." - Don't be led to believe ... put in a PrintString in the OnTick. If you see 50ish messages a second, you know that code's being called
I'll do that for sure
Eliminate 1 unknown at a time
Thanks for the input
np
I'm testing rn where or not manually changing the angle on the make rotator node is actually reflecting in game
also, I really do appreciate the swiftness and cordiality of your response. I wasn't expecting that and was expecting people to be much more difficult to work with
some people are, but there are also more ... understanding people ... we are all on the same road, at different points along it
Did you add the tracewrite? What happened?
I'm testing the printstring now. I'm kinda split attention wise between multiple things (kids) and this so it takes a minute
ok so here is what I came up with:
I think the sphere is only picking up the object once, even if its set to overlap
What happened to all the other nodes in the Tick?
oh, I disconnected them for simplicities sake
up to you ... didn't have to do that ... just insert a print string between the Tick and your first node
So this Event Tick is in the event graph, right?
yes, it is
what if I trace one upwards, then one inwards to see if the place is indeed a surface
have you dragged an instance of this blueprint into your scene?
@lunar sleet alright, replication works
or am I just reinvinting the function here
So, embarassingly, I can't get the scene to function at all. When I hit play, even before I made any changes, the whole thing stops responding, so I've been testing it by deploying the mod and running the game. However, all the other changes I've made work flawlessly
It freezes on Play-In-Editor?
Oh, well, it didn't this time, I just see a black screen and hear music. I'm using a world that someone else made for the mod that I'm now expanding upon
What's the game and what's the mod?
Mechwarrior 5 mercinaries, mechwarriorvr
Well I don't know ... you may be reaching a little outside the sphere of your current capabilities trying to mod a game like that. Debugging a situation like you've described, with black screens / freezing etc ... is probably a little beyond the scope of this forum. If it were a game you'd made, it would be a lot easier
with someone else's project it could be anything going wrong
I gotcha, I'll keep chipping away and see what's up. I've moddified another blueprint in the same mod and deployed it and it works flawlessly, so I'm optimistic
hello, how to check if a reference is empty or not ? I tried with is valid but it doesnt seem to work, my function here always goes to the print string function.
The function should simply check wich weapon slot is available and return 1 for primary, 2 for secondary, or 0 if both are referancing a weapon.
the final goal is to have a 2 weapon system for my fps game
make a print string with the name before it fires
if it gets the name then it understands the reference
I am dumb, I inverted true and false with both branch node for primary and secondary
thank you ahah
no problem. happens to the best of us. Glad you figured it out.
I have an array variable on my characters that tells the game what spells they have. I'm trying to add a spell in game, though a new spell is added, it doesnt seem to recognize the spell and its blank. Could someone tell me what I'm doing wrong here
sorry, I follow a tutorial in youtube, is from lisowi the inventory tutorial, and i want to ask for a method to only allow certain type of item to enter the hotbar, can someone help me pls?
also there are two versions of IsValid ... one is just a boolean .. the other one has a built-in execute node
can save a bit of space / less nodes
Est qu'il y a des gens qui parlent franรงais ici
I must be missing something really basic: Can anyone tell me why my line trace + niagara beam is not ending when it hits something given the logic that I've set up here?
For starters make sure your param name is exactly precise no extra spaces or whatnot. Then print the actual impact and see if you actually get what you want
Param name is correct!
S'il vous plaรฎt please si oui on peut m'aider a comprendre s'il vous plaรฎt
right so for some reason the impact point does not change which is confusing given the fact im moving the laser around the world.
Now you know what to debug
Also your line trace has an actual draw
Set it to duration or permanent to visually debug
yep that doesnt look right
I guess I am missunderstanding how to set the vector paramater node because if I break the execution line before that, it works exactly as intended, the debug draw and the actual beam are right on top of each other.
any better way to do this to allow the bucket to properly collide with physical cubes?
So apparently if I split the pins of impact point and take only the x value of that vector, the beam points into the intended direction agian but it still goes right through any object even though the impact point x is now the new beam end. I am not sure where I am going wrong right now.
are you locking the cube in place somehow so it doesn't bounce out? in my testing a physics actor normally just stays on top of a moving platform.
alternatively you could put in a box collision and move all actors in the collision along with the basket.
no im not locking anything, just for some reason it doesnt move up
im going to try a different aproach and attach the basket with a socket/constraint
currently its just a staticmesh child to the main body
I'm not sure if this is the answer, but try changing the tick group on the timeline to during physics or post physics.
ill give it a try thanks
Hello Is there an event when a controller is just plugged in?
sadly did not work :/
Okay after some further experimentation, I simply do not understand why impact point X is always the same even though the line trace is moving. Anyone has an idea why that might be?
if you just drive around without moving the basket up/down it stays in without glitching through and freely moves around within the basket?
yes
that is very odd
yeh i got nothing, because if it was the case that it simply doesn't detect the collisions of ur child mesh properly it would fall out when moving too, and moving it up should detect the collisions phasing into eachother and then pushing back out.
if changing it to a socketed mesh works idk if i'd be more or less confused.
im really inexperinced with socketed meshes. So things are NOT* going great with that lol
Okay so I figured out that the impact point was being detected INSIIDE the mesh of my enemy. I fixed that with the Actors to ignore input on the line trace by channel node.
However, this logic still does not seem do be shortening my niagara beam.
I can see that the impact point is being correctly detected now but me setting the vector parameter x value of the niagara system does not set the beams end point correctly. If anyone has a pointer I'd really appreciate it!
try hooking up Y and Z as well
that just seems to offset the entire beam in a really weird way instead of shortening it.
I think I may be missunderstanding how the paramater node works.
Have you tried taking the hit location away from the start location and getting the length of that vector?
And then using that as your X.
I'm assuming X is "forward" for the laser.
it is.
Will try that out now!
Okay so that is definitely working somewhat
But it is also creating some really wonky behavior
this is the logic I am using now.
Don't just use X.
Use the entire vector...
What you want to do is, on the output of that - node, use a vector length node.
And plug the result of that into your X parameter.
And use the entire vector, not just the length of X.
Thanks lol! Ill delete this one
That worked perfectly, thanks a bunch, I've been sitting on this for a while now!
I assumed that if I just plug the impact point from the break hit into the x param of my set vector param node it would work.
I have a health system and I'm wanting to increase max health without messing with the current HP How may I do that? (This is under a Pickup) Im pretty new and im trying to learn, any help is apricated!!
Right but how do I make the Varible Max Health actually effect the max HP?
max health should be the max hp. you might be meaning to ask how do you make the max health get reflected in the game ui?
so what I have done is create a variable in ThirdPersonCharacter called Max Health and set it as a Float. Then I went into my pick up-able and set what's in the image above. I also have a Debug Keybind to read current Health, So I pick up the max Hp pick up then heal my self using a healing box I made, yet the hp stays at 100 and does not go to 110
Id assume its bc I need to do something more with the variable?
Here is what it looks like currently
Do I need to set Max Health as the Health variable's max Healh?
how are you increasing the health when healing?
yeah, I just realized I put a cap in the healing box my bad. Im figuring out how to cap it to the max hp elsewhere rn
when healing compare health+heal amount to max health, if (health+heal amount) > max health set health to max health.
@bitter folio
Could just use a clamp node to always clamp the value of health to max health
had no idea that was a thing
How may make it so when this gives me health it updates my health bar?
You can have widget listen to the change using event dispatcher
Btw make your nodes less of a spaghetti, a few more nodes and it will be unreadable
Yeah sorry working on it, just started like 4 days ago with a friend, pretty enjoyable experience so far though
a item i want my character to place only show up in a certain hieght and i dont know how to fix
I can understand my own spaghetti fine even when it's true chaos, but I should probably still get better about commenting just so I can understand what the hell is going on when I'm plugging in something that someone else came up with, from a tutorial or forum post in 2015 or whatever...
also should probably start setting variables and using them instead of dragging whatever object or float off an event like ten times...
Functions help a lot with this, if you don't need latent nodes.
if you don't need something outside the scope of an event, you don't want to make it a variable.
You maybe want to make it a local variable in a function.
yea use lots of functions
you don't even need to make local variables for inputs
you can place them as get nodes as is
optimally you avoid wires long enough to even need a reroute
having trouble figuring out how to do this honestly ๐
Save PercentFull = HP / Max
Update max
set HP = Max * PercentFull
I have that understood, the issue is updating it to my widget when healed
When does your health bar update normally?
at the moment on damage
I had that thought tbh was hesitent to do it bc I had no idea if that was a no no xD
I always prefer to keep things consistent
The only thing that makes it feel weird is that the node is called Damage
if it was called ModifyHP then it'd be a no brainer
but I'd do it that way
why have 2 ways to change HP and trigger a UI update when you could have 1
well wait, maybe im just brain fried atm but im not using damage I dont think
just subtracting health
Im seriously overthinking this ๐
What happens when you subtract a negative number?
That looks fine, but you would instead want to use a clamp instead of that branch
Damage -> HP = Clamp(HP - Damage, 0, MaxHP) -> update bar -> if HP nearly equal 0 or whatever your test is -> kill self
yeah it still don't update it, I have the blueprints for "healing" in the blueprint for my healing box, I think I need to just cast what happens there to my health bar widget, But im soo lost on how to do it exactly, ive gotten a few responses but im not sure how to do it as I haven't used some of the things they are telling me to use before
thank you
Just have healing box do damage with a negative number
I think it is
Forgive me I'm somewhat of a noob, but I need to know how do you call the play or reverse from a timeline, that need to be connected to a branch so for example from the true branch you're going to call Reverse, and from false you're going to call play? Nvm, figured it out..
I mean literally call the add damage node
don't modify hp
ah
then it'll go through your current damage handling code, just with a healing number
Thank you so much, Have a wonderful day ๐
Though now if it ticks 2x it kills my character
Beginner here, anyone know how to make this rotation happen more gradually? I tried a timeline but couldn't get it working. Any tips would be appreciated
Timeline for fixed length,
Interpolate with tick if no fixed length
that's your only option
how do I get the return value of Z to affect the timeline. Its currently rotating an npc
You use timeline when you need to get from point A to point B at SPECIFIC lenght(time)
is that the goal here?
meaning, the start and the end rotation is already pre-determined before the timeline start
changing them on the fly will give different result
use Interpolation on tick if you are not trying to get to A to B in X seconds
Anyone have an idea to why giving my self negitive damage on the second tick it kills my character instead of healing it?
Sorry I am a bit confused, Ive got the rotation it needs to get to (which is the find look rotation), and I just want to rotate the npc to that direction
still haven't answer the question if that action needs to be done in specific time length or not
if you just need to look from A to B at constant speed, use interpolation
if fixed time (e.g. you want it to go from A to B in X seconds) then use timeline
I can't suggest to use timeline or to interpolate on tick unless you tell me what you want
It doesnt need to be done in a specific length of time, but also could be. Whichever is easiest. I just dont understand how I use the values when using a timeline, the only input is "new time"
It's not about easiest but using the right tool
I'm just repeating my self over and over now
Timeline only works if the length are specified. Length being the time in seconds
Any other use case interpolate on tick
How would I use the timeline, because the changing value is predetermined right? I need to be able to input my end point
Thank you for your help
Set the start rotation and the end rotation b4 you execute the timeline
Start rotation being the current rotation of the actor
End rotation would be the end rotation ( so the look at rotation ) in your case
Have a go at that then post your code @flat warren
@frosty heron I still don't understand how to connect them
You need to cache them as variable
Have a start and end rotation variable
Since you just care about the z you can use float here
Call it start z rotation and make another variable called end z rotation
So this is a pickup that increases the max hp of the player, how may I make it so it also updates the health progress bar to show?
Your UI should be trying to read its values from the relevant actor that has the health, or listen to event dispatchers that you would call when the value changes so that the UI can just update itself.
sorry, I follow a tutorial in youtube, is from lisowi the inventory tutorial, and i want to ask for a method to only allow certain type of item to enter the hotbar, can someone help me pls?
Look up blueprint communication video by matthew and some material/video on event dispatchers
Thank you
You want the widget to listen to event being broadcaster when the hp is changed
And ypu want to create a method for changing hp, so you always call the correct stuff when it changes ๐
"Look up blueprint communication video by matthew" Am I suppose to follow this? it seems kinda outdated, maybe My thing is set up poor but I cant do some things he does
the point is to understand how to communicate between different blueprints. It's not outdated, regardless of the date, the basic principle of OOP remain the same.
The one by Matthew is clearing up some things
for what you are doing, event dispatcher will do wonder here, but you will struggle to use it if you don't know how to communicate between different blueprint classes
I hear ya, I know this is beyond basic lol It'll probs take me a little for understand this
thank you for helping me
I had somthing funky going on, its all good now sorry
how i can get a local variable in other blueprint?
so does this Download Image node not support webp? Or am I missing something because this always fails
I did try directly pasting a working url into the pin too
I'm assuming it doesn't support webp, but I don't need it to since I replaced webp with png and it works
It's still odd how Discord uses webp for avatars, emoji and all kinds of stuff, yet you can't send webp images in chat 
Luckily they do have png versions 
How do I get a blueprint to update in the editor when an object it's referencing is tweaked?
In my case, I want to move an object in my blueprint using the transforms of a camera, which I'm referencing using a Cine Camera Actor object varaible. But the blueprint doesn't trigger when the reference camera is moved around, only when I directly edit variables using the details panel. I'm using a construction script, but it looks like none of the default triggers in the event graph would be helpful either, updating only during play (which doesn't help me in the editor).
Hi, how bad is using get all actors with interface? I've got an ability on my character that when active I want to send a message out to other actors so they can do their own stuff if the ability is active or not.. is it best to use an interface for this or event dispatchers? i'm trying to remove some dependencies because right now im making all the changes to these other actors from my character class when really the actors should be doing them themselves
Get all actors is just bad in general.
I'm not sure if interfaces are hash bucketed like regular classes, though.
What's the alternative to using get all actors, if you need to get all the actors? and how's best to do this kinda thing, i wanna send the message out that the ability is active so these other actors can react to it without having everything referenced making them all dependent on eachother which i dont think they should be
You may actually have a good use case for get all actors of class. It's rare people actually need all the actors of a certain class and just abuse it.
"get all actors of class for my main character" ๐
This honestly sounds like a thing for a dispatcher.
If you want to broadcast an event. If you're willing to go third party, there's also the gameplay message router, which allows communication between unrelated actors
So the dispatcher would go on my character class and call it when the ability is active, but then wouldn't every actor that needs to know about it need to be directly referencing my character class to bind to the dispatcher? i dont mind going third party either lol as long as it can do the things i want it too ๐
Sure, however a direct ref to the character is a lot better than the character directly reffing everything else.
Your character will always pretty much be loaded, the other thinfs won't be
Though I really don't know why gameplay message router isn't a core thing in the engine ๐
Your method will work, btw, I'm just giving alternatives
btw it's totally fine to have direct references to base classes, you could put the event dispatcher there and still call it on the actual actor that activated the ability
that only matters if youplan to go with his alternate method
Thats a good point actually i didn't think of it that way.. yeah i tried the interface method n it did work but i just wanna figure out what's the best method to use with performance in mind and trying to keep dependencies down
hi there
how can I change things then, the sphere don't rotate around the cube even if the cube moves fast?
the relationship between them is a simple physic constraint without any change.
sphere mass is too high but it seems that gravity could not handle it.
I want to sphere to be under my cube all the time. think that a helicopter is flying(cube) and moving some object(sphere).
would you help me?
I didn't use it before but I think there are variables in the physic constraint component
in the details panel
there are some and i have changed them but did not get the result i wanted
hello,
How can I get the object reference from the "Weapon to spawn" Class reference please ? On the second image it is used in the spawn actor node and it returns the object. But what If I want to object before spawning it ?
try to change the Angular Limits in the physics constraint component
I seem to not have the new ue5 mannequin in my 5.4.2 project. I cant seem to do the in engine animation. Anyone have an idea as to how I might fix this?
You may need to expand on what a "basic horror character" is.
the problem is sometimes the helicopter is in front of the object and I want to catch it so I should set the angular limit to at least 90 degrees. if I do it can rotate as well too! if I don't it won't go under my helicopter
idk what should i do
maybe i should set the location in Tick based on the helicopter location
Right so im trying to learn event dispatchers, I have an asset called HealthPickup and im trying to just play a sound for now when ever the character goes over it. This is what I have atm but it wont do anything, if anyone knows why that would be amazing
looks about right, tried calling the delegate again?
I need someone to tell I'm not the only one seeing this
wdym
the binding is setup on beginplay, so.-. are you sure the delegate is called after beginplay ?
oh, how might I go about fixing that?
well.. what is triggering your on overlap ?
if you had to walk somehwere for it to trigger, then you'd know it'd be after beginplay
you can add print strings at both places, and see which order they show up in
the lower one came first (so add context to the string being printed, so you know who's who)
Ohhhh that clears alot up, let me try to see if I can implement that
So as soon as I start the level The event BeginPlay one is firing instantly, how could I make this fire when I overlap with the pickup? Sorry I know in the scheme of things this is super beginner
you want to bind to the delegate as soon as possible usually
Well, you have the pickup right?
correct
which triggers some overlap and interaction with the character?
Hopefully through a public function ?
When player overlaps with it, the max health is increased
ah
you should encapsulate the logic that belongs to the character inside the character bp
while externals may call exposed functions (public ones) on your character, you shouldn't let them manipulate internal variables!
Reason being exactly this, in your example;
You want several things to happen when MaxHP Increases on the character
if you were to manipulate this externally, you'd need to make sure you update every single thing you expect to be updated, when this variable changes
While if you wrap it up in a function inside the character, it's done, forever!
Ohhh
and if you have a bug, or wanna expand it (call extra delegates, start auto regen or whatever), you only have to fix in one place.
I see my bad, i've been using tutorials online to figure out somthings then applying what I think I need to make things work, had no clue it should be like that
While they show you some ropes, they usually bring along bad practices
you may still follow them to get a grasp, but I'd at the very least suggest trying to always consider how the logic could be encapsulated into it's owning class
after all, thats why we have all these classes
So, should I make a event dispatcher to call the max hp being updated?
separation of concerns
At the moment my Hp Updates inside the Character off of damage
In this case you want to :
- Create a function for manipulating MaxHP in the
BP_ThirsPersonCharacter - Inside the function , you manipulate the MaxHP variable, and call the MaxHPChanged delegate
Inside the function , you manipulate the MaxHP variable, and call the MaxHPChanged delegate This being in the thirdperson character still?
Is that who owns the MaxHP variable?
yes
there's your answer ^^
encapsulating logic is a general principle, and I'd advice you to strive to follow it as best you can
then I can just bind the event to the HealthUp pickup right?
thank you
your binding can just stay as it is
not really sure which BP is binding to it, but it should normally work from beginplay (unless you start already overlapping the MaxHP booster thing)
It would of been this I think (this is in the thirdperson character)
Anyways thank you for your help, you have taught me alot just now ๐
which bp is this tho ?
?
xD
so
~~ encapsulating the pickup logic~~
The character shouldnt react to an overlap like this
since the character dont really know what iti's overlapping
so pushing MaxHPBarUp isn't something you wanna do
you only wanna broadcast it when MaxHP changes
and with your new encapsulation, that happens automatically by now
due to this;
which should call the AddMaxHP function
and not touch internal variables from externally*
You kinda just lost me ngl, I had not exactly set any of it to work yet, I was just trying to make them communicate first
So the MaxHp being changed from the pickup should be defined in the Player BP?
The underlying logic for changing MaxHP should reside in PlayerBP
so inside a function
then the pickup thing should call this function
gimme a sec ill open a dumpster project
thank you
In the PlayerBP;
Oh I see
and then inside the pickup thing;
Now if you were to... only have like 3 different pickups for max HP, I would take it one step further
Lets call them Small, Medium and Large
I would possibly create 3 more methods (or add some enum or gameplaytag to identify which one )
doing this would once again achieve that any update to these settings would only need to be changed 1 place
and this in each Bp for Small medium and large?
this example would still be inside the PlayerBP ,
then the pickup would simply call the correct one
third option with tag would use something like a switch internally
But only 1 of them spawns landscapes on tick.
dumb question , how do I create a variable proper to a function in blueprints ?
You mean a local variable? A variable that only exists within that function?
yes
hey, with a pawn, is there a way to find the number of the player controller that control that pawn?
With the function selected, you'll have an option for creating a local variable.
if i spawn pawn, for multiplayer (local) and i need to find the number of the controller that is used by the pawn.
I cant find it
Sorry it's when you have the function open.
oh nice, thank you
Why you cry Datura ? You dont like the tag to health switcheroo? ๐
Leave the poor cats alone you savage
Woops. No cats where harmed during the experiment !
yea painful T_T wish there was a select node that could take a gameplay tag.
Ah yeah that'd be something !
Found the solution. I was using complex collision. I made a simple collision box and it works. For some reason collision wont work when moving objects using set location with complex collision ๐
Edit: NVM not sure what fixed it... I some how broke it again
does the delay node in blueprints continue to time out if the game itself is paused?
hey guys need help
im trying to launch character away from a location (this not launches away from player)
(get player character location - target location) -> Normalize
is there a way to decrease the size of the red health when my max hp goes up without the bar getting bigger?
Its height?
no like say I have 100 hp then I gain 20 max hp, I'd like red being the current Health "lessen" and then there be room to get 20 more hp without bar size increasing
why do you wanna decrease the size when hp goes up ? like shouldnt hp be directly propotional to the bar ?
im having a hard time saying what but I think thats it
create a function , whenever your max hp increase set your bar's ratio to current / (max + hp gained)
The bar can always be thought of as a percentage, so a value between 0 and 1.
If you have 100 HP to start, and your max HP is 100, then the value is 1 as you're taking Current Health divided by Max health = 1.
If you increase your max HP to 120 but leave your current HP as 100, then the value would be 0.83.
So yea, as sherlock said, every time you modify either of your health values, you'd want to recalculate the percentage bar's displayed value by current divided by max.
I know theres def somthing wrong here, It seems like it updates the health to the max hp atm but the progress bar is not going above 100
have you updated the max health ?
wait
yes I have a pick up that sets it to 120
Id asume its bc the health bar widget is set up wrong?
why are you setting max health as max health / health ?
good question
๐ญ
๐
if you have updated max health no need to set it
instead health / max health and send that pin to the input of set percent
that should probably work
if you are setting it will be reducing the current health and that is something you shouldnt want
ok
good
now try
remove
no dice
the set pin
are you sure you have increased max hp ?
by 20 or whatever amount you wanna increase
yes I have a debug key to read current hp then when I go heal it heals to 120
hmm that should be working then
why is it multiplying ?
tutorials I watched said it would mess up without that
ok got it
would I not need to do somthing simular as I did for health in the widget?
Because percent of often represented as 0->1 instead of 0->100.
...for some mad reason.
i think this is wrong because you have used 0.01 to convert health into percentage but on increasing hp by 120 it will work still the same
so instead of using 0.01 go with the basic approc of dividing it by max health
for example if health is 90 percent will be 90*0.01 that is 0.9 but even if you increase your max hp that function works the same
yes
how might I be able to use the health Variable? do I just create one in this called health?
why not use one from event
can you show the increase max hp function once again?
like if I have full 100 hp before picking it up It does not look like anything happens but if im damaged and then I pick it up it sets my health in the bar to max but actual health is not changed
this is in the Third person character BP
where do you increase you max hp if not in this function ?
from the Player Bp I think
can you show ?
First is in player bp second is in the pick up
ah that set percent should not be there still
why are you setting percent here ? and if you do why create a new function
also dont set percent as max health
thats wrong
Yeah I was playing with it before asking its removed now
i would say in this function set percent to health / max health and remove the above function you wouldnt need that
should work
Ok it worked but, when healing once it remaxed out the bar
also seems like after taking damage the max health displayed it reset to 100
๐
Why is an interface involved?
You're making this way more complicated than it has to be
true
I dont know ๐ญ
I just followed a few tutorials over the week on how to set up basic things then did bunch on my own
Ok first off, when does the healthbar update?
show the damage code .. and healing as well
here is this, probs hard to read but at the bottem im doing the x.01 thing id imagine thats an issue
why does percent not depend on max health?
likely
First off, forget telling the hp bar to update, just have it poll for now
get it working before worrying about perf problems you don't have
hey, I have an issue here because I want to keep track the Current Weapon OBJECT, so I created a new variable to clone the value but its only cloning the reference. So when calling Destroy node, it also destroys the Old Current Weapon reference wich make sense.
How can I get a clone of the Current Weapon object ? In oriented object programming I would just create a clone method inside the object and make something like this : OldCurrentWeapon = CurrentWeapon.clone();
But what about blueprints ? Thank you !
? the health system works its just the bar thats the issue
use your max hp in the percent math
Sure that should do it assuming 1.0 is considered to be 100%
might need to multiply the whole thing by 100, not sure what range Set Percent expects, if its a 0-1.0 range or 0-100
You ditched my encapsulation comment already ๐ฆ
I did?
Once this is correct, you need to call the same code whenever you change health for any reason (changing the max for example)
make sure ALL changes in Health or MaxHealth make it to the Set Percent code
Well, i guess not since its in the correct bp. But add a function for chabging hp aswell.
Ill get to it these are from prior of me learning
Surely it'll be called from elsewhere aswell, so making sure the dispatcher always goes along with it is a good start
it seems that one change made everything work
In the future, dependenies like this are typically pretty brittle. A better design is to have the health system NOT CARE about a health bar at all. Either the bar queries for the values it needs, or the health system has a dispatcher it fires to let whatever cares know that its numbers have changed.
the bar depends on a health value, the health value does not depend on a bar
the health is independent of the health bar already tho
I just could not get it to display correct
no its not, go delete that health bar and see what happens when you take damage.
It'll try update percent on something that doesn't exist
Would some one please help with what I am missing if I am trying to build an array of data assets prferebly by class of a specific PrimaryDataAsset.... im in unreal 5 and trying GetAssetRegistry > get asset(s) by class but it seems to be returning nothing (This could be me failing to build the path as its completely different to any info i found previously if trying to use by path instead of class....)
oh I see what you mean
My bad
thank you everyone for your patience
If you're jsut starting out honestly just polling is fine
I started 5 ish days ago
hp bar just has to figure out what actor or component it cares about and it can just read the values on tick
ah
I wouldn't use polling if I was making WoW but if there's only a few dozen healthbars around it literally doesn't matter.
help
why do you wanna keep track of the object you destroyed ( sorry if thats a rubbish question im not so experienced )
Because I want to set it to the Primary or secondary weapon slot after the weapon switching
don't destroy
or if you do destroy, spawn it again later when you want it back
so cant you just use class instead to keep track ?
I don't think there's an actor clone node but you can store its class then respawn it later
the blue pins are just pointers.
Ok so I used the "Detach From Actor" node and it seem to be working
Many people having my address doesn't stop my house from being destroyed when it gets bombed
That just detaches, where does it go, just float there?
never understood better
so about it cant you just keep track of the class.....?
Yeah if you had to represent a stored item the class could work
assuming the class as default is how you want it spawned
or you can just hide it
It'd still exist, just be hidden
I mean, switching weapon is just attaching and dettaching from the "Hand" Socket no, and keeping track of the correct weapon with a "current weapon" reference right ?
That can work, where does the detached one go?
I dont know ahah
how about you send it to some random location no one can see
this is my current function
You can leave it attached but hide it, or attach to a back slot, or whatever
You should find out where they are going on detach tho
My guess is either they float where they last were or snap to 0,0,0 world coords
Get owner pawn -> cast to firstpersonchar -> bind to healthUpdated etc
whats that for
what happens to detach components usualy ... like they fell off right ...?
if you wanted the health bar to be notified of when health is updated without the owning thing knowing or caring
if they're simulating physics sure
look around
oh
print location on tick in weapon
I am looking but cant find an answer
i 'll try
So char doesnt care about ui, but ui cares abput char ๐ one way link , the right way
this is a function?
yes it goes to 0 0 0
In widgets, yes, get owner pawn is a function
@faint pasture @patent mango thanks a lot btw
Requires owning controller to be plugged in when you create it tho (Create Widget, that is)
I still wish a widget had a way to figure out it's inside a widget component and therefor find its actor
I haven't sorted out how to do that
