#blueprint
402296 messages Β· Page 516 of 403
I'd put at least a character filter on your GetOverlappingActors, and the top one won't ever register correctly without two actors since you're asking if it's greater than one.
Yea that was a mistake, fixed it, the greater than one
i tried putting casts on them, i'll give it another shot. Thanks again
so strange, the main one fires, then nothing for the second one
oh well, it's late:) Thanks again for the help, i'll keep trying
The casts will only make sure that it only fires if the character overlaps it. There's a class filter on the GetOverlappingActors that'll make sure that the length coming out of that will only be for characters. So if you have a beachball roll over your triggervolumes, it won't assume that there's an actor there.
I'm also not sure that print will ever work without the end overlaps. Since you beginoverlapping, there's always going to be a character there, so it'll always return true.
Please forgive me if this is difficult to read, here I am getting hunger and thirst, I'm not sure how to make my UI Progress bar collect the percentage, does anyone know?
@humble scarab If it's something that moves often, you could bind it. You'd need to know your max hunger and current hunger and be able to get those inside of the widget that the progressbar is in.
In C# or other programming languages, I'd have just a class with static functions for utilities, a collection of random useful functions.
Is there something similar for blueprints? Like in my blueprint, anywhere I can call the functions utilities
yes , you can basically create a function library in blueprint form, and call it anywhere within any blueprint
it can be found under blueprint > blueprint function library
So, usually I am a stickler for blueprint being nice and tidy. I just found this old gem in one of my old backups:
Hi ! Excuse-me, I have a problem with my blueprint : I need to send an object implementing an interface in a function, but, when I try to create this object with Create Object Of Class or even a variable, it's still null, and I can't create, what did I do wrong?
Is there a way in bp to tell if a struct variable is valid? π€
@bleak vector you would have to define your own "rules" as to what constitutes it being valid and then logic for validating the value. Structs can't be null
if you just want to know whether a struct value was returned, or was passed as a parameter, include a secondary boolean value that indicates that
yeah I just rewrote my function so it's a bool instead of void π
Any idea how to spawn these type of cone line trace manually by using LineTraceSingleByChannel?
hey. How can i get all the objects from my array?
Now i have get from array and i can put a single integer. I want to have for example 16 objects from my array. If i put 16 it just affects the 16th one.
@trim matrix You can use a Foreach to iterate into the array
Im using the for each loop.. doesnot work π
How do you use it?
how can i set a variable thats inside the spawned actor
You can set the variable as "expose on spawn" in its settings and it'll pop up as a pin in the Spawn node, or just set the value on the spawned actor from its pin as you would do normally
but it doesnt pop up because it is an actor reference not that specific actor reference
You would have to cast to a more specific class or cast the created actor
for example if the spawned actors always share a certain base class, you can cast the class into that, and it should expose the pins from the base class
yeah parent blueprint
a small question, how do I set the mouse position at the center of the screen when launching the game ? this dosen't seem to work
because the click events dosen't work properly if i click on the right edge of the window for example, it'll set the point i clicked as the click event spot...
is there anyway to make this so on Hold instead of pressed it sets throttle to 1 but on release it takes it back to 0???
@formal prairie That should set your mouse cursor at the top left of the screen. To get the center, you need to get your viewport size and divide by two.
okay, so this is what i got. it still dosen't work though
to better explain, when i open a new PIE window or viewport, when I click on the game to get into it, the spot i clicked will become the click event spot
Guys, is that possible to set array element by loop, but only once per 1 frame. Like we set [i =0] as X for frame, as example #34, when set [i = 1] by Y for frame #35 and so on.
Sure, you could use a counter
or just look at the array length
keep in mind that framerate is not guaranteed to be always the same so don't use that for anything that has to happen at a consistent rate
@formal prairie I'm not sure where you're calling that from. Initially I'd say to double check that your HUD exists when you do, or the viewport size will return zero.
How can I make an object rotate to face another objecT?
looks like "find look at rotation" works
but it's rotated incorrectly
@maiden wadi this is into the FPS_Pawn blueprint. when the game starts, the HUD exists (the watermark and help are present)
Sure, you could use a counter
@earnest tangle yeah looks like timer are best for such task
Guys Is there a way to get all actors/components that are physics enabled with blueprints ?!
how many are there @blazing vale ?
@trim matrix ah yeah I was thinking of tagging. seems like the way to go Thanks
π
btw in which areas if any are BPs noticeably less efficient than C++, i.e. where does it become a problem?
i ask because i'm doing preliminary research into a replay system for an FPS
@ripe rose I read that mathematical expressions are quicker in C++
loops specially
iirc calling bp nodes has a constant overhead, so more nodes you call more overhead it will have
Hey folks, I'm having a issue with grabbing my box and it jumping forward. Any tips on rotation or anything?
If anyone has any tips, please @ me π
Does someone have a solution for when you have spawned a physics constraints and bound it to a target.
(just one constrain) how to control the length of that constraint? I can't for the life of me figure out a good way to do it.
The decreasing the limit seems to get me half-way, since you can't go below 0. I mean I simply just want to have a constraint and be able to adjust the length of it. Ie Distance between the Source and the Target.
Any ideas guys? O_o
Simplest answer to the performance question is, C++ is always faster than BPs in all regards. Some areas aren't worth fussing over. Most gameplay design is perfectly fine in BP, maybe even all of it. I'd probably say that purely event driven gameplay would never really notice much of a difference. Ticks hurt BPs a bit once you start getting into the hundreds of actors running complex ticks. C++ can solve this some, but it's also worth looking into other solutions. Some operations like searching Datatables is interestingly slow in BP comparing to C++. Large datatables can take seconds to write to an array in BP and it's nearly instant in C++. Another funny fact about BP performance is macros vs functions. If you do tick ALWAYS try to use macros where possible. Functions take extra time to call than a macro does. Drawback being that you can't call a macro on a class like you can a function.
Just to note, i'm unable to replicate the crash using a default template with no changes
it seems that setting the bone name to anything but "None" will cause the crash
guys what happened to my faces on the top???
it doesn't look like that on blender
wtf
Check mesh normals. By default Blender displays faces as two sided, so you probably just have to flip them
I exported the geometry as "face" not "normals only" so idk
I saw from tut you had to that to remove the smoothing group error
i still cant get this to work
;-;
i try and set up a refrence
but then it says cast is not needed
so i guess the ref and nothing happens
you need an object to cast to you cookie!
i've put that in before
hey it doesnt work because it doesnt have the actor reference that u need, so you need to create an actor variable here, expose on spawn, then go to the blueprint where you Create this widget, refresh that node and you can see an Actor pin below it. U can plug the audio managemnet actor into that pin
and then get that actor variable here and plug it in into your object
before you can cast
assuming you're calling it from the audio management actor, in that case just get a "reference to self"
@random stratus why are there missing faces in my object?
i imported it from blender so
i'm not sure i dont use blender...
Do you know the reason?
it could be face normals issue
and how would you fix that?
not on blender, but i know how to fix it in maya
ok plug self into that audio managemet actor pin
Hey guys, I'm getting some weird results from "Make Rotator from Axes" I am drawing my axes and I can see they're correct x,y,z directions, but the rotator does not align with them
right click and type self
the cast worked!
finally
i spent all of yesterday trying to get it to work thank you
π
How many box components is to many box components in a actor?
depends on what you use the box components for.. are they all going to generate overlap events or hits? then it can get heavy
Hey guy, not sure if this is a blueprint problem but I hope someone can help me. I want the camera to be locked and not like this, what can I do?
What does this do?
What does it set IsActive to?
I was surprised it compiled
I'm just gonna change it to this. Much clearer.
I'm just gonna change it to this. Much clearer.
@tight venture i truly hope you're joking
about what
you see what it's meant to do, right? Just flip the value of IsActive, then do something based on what the old value was
I had constructed the FlipFlop way and then looked at it and thought it was probably not what I wanted
@thin rapids just spit it out. what is the problem
you're setting this https://cdn.discordapp.com/attachments/221798862938046464/746071565703315526/unknown.png to the inverse of what its being set but to do that you need to set it first but you're setting the result of the set and so on. ITS A PARADOX
That would work just fine. The out pin of a SET node is basically just an in-line GET
π€ huh interesting
yeah, that's totally fine Daniell
yeah, that's totally fine Daniell
@tight venture ok sorry my bad π¬
That SET node is equivalent to IsActive = !IsActive;
np we all learning π
What I was curious about was the behavior of the one using the FlipFlop
now that one seems like a paradox to me
I'd still use a GET and keep the wires straight just to prevent spaghetti, but that's just personal preference
https://cdn.discordapp.com/attachments/221798862938046464/746070595342565466/unknown.png how does this work though π€
I guess the FlipFlop is just changing between A and B independently of what IsActive is
It only looks like a paradox if you assume that the FlipFlop carries the value of IsActive somehow
So that would be dangerous, cuz I'd want the FlipFlop's A to coincide with IsActive == true, but there'd be no way of guaranteeing that
The first time this executes, Setting Is Active reads the default value of the boolean, which is probably false.
After that, it is set to what the boolean was the previous frame.
Just put the SET after both A and B, and plug Is A into both of them
Hey so I'm trying to make a red dot on a widget turn it's visabity on and off for 1 seccond but I need a loop how do I make a loop in blueprints
use a widget animation
How do i do that
Open up your widget, it's the panels at the bottom
at the bottom left, click Add Animation, name it, then click on it and then in the next panel to its right, click Add Track, choose the thing that you want to animate (the red dot)
then you add keyframes, one for visible and one for not, then make sure the loop button is selected
See where it says "No looping"? That's the tooltip for the looping button
Then just call your animation from an event:
Another funny fact about BP performance is macros vs functions. If you do tick ALWAYS try to use macros where possible. Functions take extra time to call than a macro does. Drawback being that you can't call a macro on a class like you can a function.
@maiden wadi But functions are the base of OOP. You want to change something? Call a function π
or, if it's always supposed to blink, then connect it to BeginPlay or something
Ok thank u
np
I think the macro vs function in OnTick is very dependent on what exactly you're doing in OnTick and what exactly the function/macro would do
You can change things in a macro too. Just not from outside of the class.
That's an optimization that should be considered only right before shipping, IMO
use a function until then
Eh. I just make it a habit. If it doesn't need to be called from outside of the class, just macro it. Think of it like an internal private function with slightly better performance.
Then again I've been learning a lot of C++. So, most of my blueprint these days is either just glue or UMG.
So i want to speed up my create widgets a little bit more but if I remove the delay it just goes so fast u can't see it my delay is 0.0 how do I make it faster without making it go like that
Hi folks! I have a question about the blueprint routine "ConvertTransformFromRelative". I am trying to get the transform of a camera placed via spring arm in one character and copy it to another pawn's camera so I can keep its camera placement in sync. The code snippet in the picture below results in giving me a transform that is the inverse of what I expected. Googling turned up a thread (here: https://answers.unrealengine.com/questions/320558/bug-wrepro-convert-transform-to-relative-incorrect.html) with people claiming the parameters are reversed and this is a bug. I can confirm that swapping the inputs results in the output transform I expected.
My question is, is this really something that is broken or is this intended behavior? If it is intended behavior, would anyone have any tips/advice that could help me understand why the output would be the inverse of what I expected?
If anyone here is knowledgeable about UMG, I'm having a problem that I asked in #umg, but I think I'm the only living soul in there lol
Is there a way to make screenshots with visible hud widget?
I'm trying to create a character-cloning blueprint. so when you press a button, it should spawn two clones of the player that you can control along with the player itself. the problem is that it works on singleplayer (offline mode) but it doesn't on multiplayer (client mode). I'm attaching a picture with the blueprint that i've made. the data that goes in "move forward" and "move right" (in the big blueprint) is going to the "clone" blueprint so if I move left, the clones move left as well, if I move forward they move forward as well. the main issue is that on multiplayer, my character keeps teleporting like it's lag or it has some input lag and I don't know how to solve it. maybe I'm doing something wrong. can you please help me out?
first picture: the main blueprint, second picture: clones' blueprint
Nvm I got it figured out
What's the difference between GetActorLocation and GetWorldLocation?
so uhm, what's the deal with this? im integrating ALS and i've migrated all the input code for ALS from the character over to my controller
but for some reason, the movement input code is messed up
nevermind, im a dumbass, didnt call player movement input node
from the controller
ofc it wouldnt move xD
still, just using the ALS' default of getting the axis values directly doesn't seem to work for some reason
o.o
atleast not if it's called from the controller
rather than the character
and im not getting ANY errors, which makes it all the weirder
Anyone know how I'd check what the current state of an Enum is so I can use it for transitions in my AnimBP? I want to check if the Enum is in X state, do X transition.
NVM, figured it out π
switch on <enum name> is probably what you're looking for
Hey guys I'm still wondering how do I make the delay go faster then 0.0 but not make it go too fast
Clamp node?
I created a child blueprint of the template default third person character and wanted to add input events (in my case press the '1' key to do an ability), but for some reason that event isn't triggering when I press 1. I put a print node to check if it would trigger and it didnt. Any idea as to why this might be the case?
is there a tutorial for an inventory system that has a pickup mechanic that doesn't use linetracing?
Epicly still sad about my problem
So I have made my item slicing a procedural mesh. I want to destroy it after a delay? what do I put? Destroy actor and destroy component wont work π¦
tried casting to the sliceable mesh also but nothing.. :S
@late gorge how do you get your blueprint spaghetti to look straight like that
what is this sorcery
:O
Just to check, if I want to make a save game system, do I have to manually save everything as variables in a save game blueprint ? Is there no way to say "see that bunch of objects ? when I reload I want them to there again and in the same place" ?
mmm you need to create that yourself @sick galleon
so nobody knows how to destroy procedural mesh in ue4?
Help
@trim matrix if you mean clearing a mesh, theres something like remove section I think
I want it completely out of my level? is that sufficient?
Destroy Actor ?
I am slicing a proc mesh. after delay i want it out from level. yep destroy actor dont work
Anyone want to help.
or destroy component
@trim matrix that seems a little week for an engine like Unreal ... I mean thats basically the "write everything into a text file" approach
I would have thought they'd have more automated tools for that
Yatta
tag them
Help
Please don't spam help over and over again
Sorry
jesus christ
I said sorry
yeah people saw your message, they just dont have an answer
If nobody is helping, its probably because we don't know the answer.
I said I'm sorry
please dont spam sorry :D
yeah that would be nice
maybe dont even ue if u cant do that xD
Why are u guys bring mean
Im using my phone because my pc can handle one thing at a time
I wasn't spamming I just said it because u guys didn't believe me
@trim matrix what did you mean by suggesting tags ? does that have something to do with the saving system ?
make a system that what you see will tag the "stuff"
then get all actors with that tag
and voila
And how is saying that I said sorry spamming
now Im confused, I think you've read my question wrong :p
see that bunch of objects ? when I reload I want them to there again and in the same place" ?
thats what u said
and generalisation like that would not get you any good help
I know how to get actors, but say I have an actor with procedural mesh in it, and relations to others actors, im not sure how to save the whole thing in a savegame object
if you want precise help give us precise problem.
And u need to stop accusing me of spamming
I just said I was sorry how is that spamming?
you are so blocked π
Wow what a nice community here
Very nice
obv troll is obv
I'm not a troll
I'm genuinely being honest
It seems my timing for asking about the vehicle was very bad π€£
Should I better post it later again?
is it attached?
Oml, @trim matrix we saw your question, we didn't know the answer. Saying help over and over again does nothing good, and is annoying when were trying to help other people.
I stopped first
Seccond I said sorry
maybe just rotate it counterclokwise
π
Thank you for saying sorry
when it rotates rotate it negatively
we can drop that there
Well I'm sorry
We understand, you said it already
._.
@trim matrix It was attached to a socket. But the screenshot is from the standart AdvancedVehicle Template a fresh project without socket. I just added it without hirachy for testing. It seems like the physic is rotating everyting.
so constraint it and lock to position? no?
No nothing. I even tried those settings inside the particle effect.
The question is what drives the suspension when brake into the corner. I donΒ΄t even know how to tell the particle effect to rotate counterwise when the car is steering in that direction.
well first of all your problem initially there is written very weirdly. I dont even know what you want
Hello, question for the pros here, if I have a blueprint and in side an event that has a FVector location as a parameter, it then AsyncLoadClassAsset, the completed function gets correctly called, but it seems I need to capture the Location parameter. Outside of writing a custom C++ node, does anyone have any suggestions on how to achieve this?
e.g.
and did you try it with particle effect? particles behave a bit different when rotating etc.
Oh sorry. There are 4 particle effects for 4 tire skid marks. And when I deactivate the Depricated Offspring Mode in VehicleMovement. The car suspension is a lot more realistic. But the chassis rotates to the right when driving to the left (like in real), then the tire skid mark on the right is pressing with the rotation of the chassis into the floor. I know itΒ΄s a bit difficult to describe in text.
Essentially what I think might be needed is a way to capture the parameters, like when we do things such as lambdas.
Ik the argument is over but I want to address these things before I move on nullvoid don't block me I'm not a troll and yatta I have a problem saying sorry too much in irl that's why I keep saying it
I just wanted to address this so I'll stop talking about the argument now
Hey guys, say I have a World Map, comprised of separate static meshes, each country has its own static mesh. What approach would be best when I have to iterate through all of them and bind events and set materials etc. Should I just drop all of them in an actor under root? Or should I do them one by one from c++ instead?
I'm sure that this could also be solved by reordering the process that calls SpawnPOI event to just incur the loading and when it comes back then spawn with a supplied transform. But I'm just curious if there is a way to do in a single shot like the image above
@slender idol could you make them self registering with a known instantiated class that does the binding and material lookup and setting there?
is there a reason the the marketplace website has descriptions on product pages written in white on a white background ?
@wet surge Hmm thats how I was doing it so far I think, I had this bp_world actor and all the static mesh components were dropped in there, I would iterate once through them and bind materials and everything in that one for loop. I was looking into ways of moving the mesh parts to C++ but I really don't want to manually add them one by one (they are like 211 in total). BP makes it so much easier cus I can drag and drop the models in.
When you say move to C++ what do you mean? Also the self-registering I meant make a parent class, override it's BeginPlay that calls into a known class, say for example GameInstance. Call a method on GameInstance or something that is like RegisterMyCountryMesh(StaticMesh* Mymesh). Inside that function it could then do the binding setup and material stuff?
Something to that effect? Or are you referring to manually adding these via the editor and not wanting to do that?
if you are also adding them via the content browser, perhaps creating a data asset and having a structure of TArray<StaticMesh> as a field, filling that out and then using wherever you want to might work?
So what I have so far is an actor, with all the mesh components in the extended BP part. The c++ base class contains all the binding logic and the for loop that I do once at startup. I was just wondering if there would be a more proper way of handling like 211 meshes that comprise something that also need to be individually accessed.
But if you are adding from an actual level, then all I can immediately think of is self-registering with some manager like class that could exist on the gameinstasnce
nono, Im only adding from the editor, drag and drop the models in the bp
the binding is done programatically
i see, so maybe a data asset would work for you?
since you have to define the structure of the data asset in C++ you have access to it's structure in both worlds
C++ and BP
np, hope it helps
is it possible to pick a item with highest property (like vector etc) from an array?
priority queue
hi! how to convert BoxPosition and BoxExtent to Min and Max pins of MakeBox funtion?
@fallow orchid Not sure, but wouldnt that be BoxPosition - BoxExtent for min, and BoxPosition + BoxExtent for max ?
@fallow orchid Not sure, but wouldnt that be BoxPosition - BoxExtent for min, and BoxPosition + BoxExtent for max ?
@sick galleon thanks, Genius, its works.
Can someone with a working PS4 and/or Xbox controller test this blueprint script out?
In UE4 that is
This script is to test the timing when you move your left analog stick from neutral to full tilt as well as from full tilt back to neutral
thus it gives you the total amount of milliseconds.
For my situation I tried installing DS4 on my PC but somehow it messes up the PS4 inputs.
You need to run ThirdPerson Example and replace the ThirdPersonCharcter Blueprint script with the one I've uploaded.
How in the heck can I destroy my procedural meshes after I have sliced them from another bp?
how can I attach a model/emitter blueprint to a spline point and then move the spline point around by moving the emitter model around?
Did anyone download the script?
Does anyone have a Xbox controller or PS4 controller?
Hey, I have a root motion animations and camera in my pawn is moving legitly with its animations how can I make it independent from the anims and just move when it from players input?
Can I have a parent class be an actor but the child class be a character?
Characters inherit from actors
So can I say that a character is an actor but an actor isnt a character?
yes
Is it ok if I ask a game specific problem question regarding this issue?
yes
Im trying to use the "AttachActortoComponent" node but when I make a blueprint class the child of a character class, the game becomes hella buggy. Whereas, if I make the blueprint class a child of "nothing" (not technically nothing but you know what i'm saying) and of type actor, the game behaves as expected. I can send screenshots of both cases if you'd like.
send them
This is how it looks like in the second case (ideal case)
And this is the first case
I suspect that the camera is somehow attached to the sword in his hand but I'm not sure why this is the case
This is the hierarchy of classes
Everything under character is of character type
So this would be for the first case
In the second case, Sword would not be connected to this chain of classes and be of actor type only
Also worth noting, CharacterController is the default third person character
Hey, i have a blueprint class from another game but when i put it in my project it doesn't show up
Can anyone who have version 4.23 or above try putting this blueprint in their project and see if it will appear?
How can i click and drag an object around on an xy axis during play?
Is there anyway to make this "While Pressing Key" instead of Pressed once
You have a Pressed and Released state for the InputAction.
If the Action has been Pressed but not Released then it is by definition being held down.
yeh ik....but how do i do that?? is there a node for that??
coz when I press a key...the Tank moves for a half a sec and then stops
i have to keep spamming W to make it keep moving
You can either use a looping timer that you disable when the Action is Released
Or use a boolean variable flag in conjunction with Tick to call IntendTurnRight while it is Pressed.
sry for the stupid questions.....i found this while loop...but the conition is a red input...is there a way i can put the Released option in it?? coz according to me that kinda makes sense to me idk
@trim matrix yeah it's the ElectronicNodes package
@maiden wadi I managed to get the timings from a fully tilt analog stick back to neutral position
the only thing I find a bit off is when I add the time it takes for an analog stick to go from neutral to full tilt then from full tilt back to neutral.
I have two macro functions
One is for neutral to full tilt
the other from full tilt back to neutral
then there's the event graph which adds two variables the results don't add up
@proven mason I'll admit that I haven't fully wrapped my mind around your script but I do notice your axis breakpoints are above 0.9 and then a perfect 0, which might be too much precision to ask from real world thumbsticks. Maybe if you tried +/- 0.1 or something as a neutral... Have some amount of "deadzone" in other words.
Still looking through it, but that's a good point. Anything involving floats should almost never use ==. NearlyEqual is your floaty friend.
ok @tight schooner noted
btw I don't have Xbox controller; I do have a PS4 controller but somehow when I install DS4 driver it totally f'd up my PS4 controller's inputs
I have a Wooting One keyboard that emulates the analog functionality of a Xbox 360 controller.
btw can I say <= 0.1?
or >= -0.1?
instead of == 0
Well, controllers aside, floats are bad for ==. You're reliant on how precise the function checks the decimal points. After all 0.0000001, is not equal to 0.0000002. But some checks might pass in some programs because they only check to the third or so decimal.
And yeah, <= and >= are good for that.
@jovial elm your sword inherits from character, or is a child actor of a character?
@proven mason https://docs.unrealengine.com/en-US/BlueprintAPI/Math/Float/NearlyEqual_float/index.html
Nearly Equal (float)
or you can use an abs node (absolute value) on the float first before checking if it's < 0.1 or w/e
oh, UE actually has some built-in deadzoning on the thumbsticks. (Project settings)
I was looking at the raw output from my thumbsticks and it did seem pre-deadzoned...
so Epic already knows that thumbsticks are imprecise, heh
@trim matrix get mouse position, set your objects location to ur mouse pos on tick
I still wouldn't rely on it though. Always program with the assumptions that something's going to do something stupid. Good to have, bad to rely on.
@flat raft Its a child of a character type class
so it inherits from character
character has no scripts in it tho its literally empty
so it really shouldnt be inheriting anything besides the character type
@proven mason What are you expecting it to print? As far as I can see it should first print the time you made it to full tilt in milliseconds, then the time it took to go back to zero in milliseconds.
so I'll explain
when you go from neutral to full tilt it will print in blue the time it takes.
try using input axis rather than input action. If you want to use loops, look into Is Input Key Down. @thin apex
when you do the reverse you see the time in red
when you add the blue and red values it's supposed return the total value which is in purple (if you move the thumbstick along the y-axis) or green (if you move the thumbstick along the x-axis).
when you look at total (either purple or green) you get a total number that doesn't add up.
that's where I'm sorta scratching my head on that one.
@jovial elm you have a knight in your screenshot. I assume he is a character type. Then you are adding a sword to his hand which is also a character.
Seems like your controller is trying to posses the sword.
If your sword is a weapon for the knight, it should be of type actor, not character.
@proven mason Oh. I see your issue now I think. So. That print after the macros, when does that show? Initially it looks like it should show up right after you fully tilt? The pink or green one.
after the full tilt when the stick reaches back to neutral.
That makes sense. How can I change its type while still keeping it as a child of character? @flat raft
Technically a character is an actor so shouldnβt it be possible?
Yes... and no
There is some under the hood stuff going on.
When you make a character, it adds a whole bunch of code..getting ur object ready to be possessed by the controller
There is also the huge movement component it comes with :P
So that prevents it from using its inherited actor components?
Yes.. you are giving your sword the ability to jump, and swim... it's too much.
so uhhh, while you guys are discussing some low level stuff... anyone happen to know what Get <axis name> functions don't work in controllers?
So the solution would be to remove it from that entire hierarchy and just make it a separate actor class
You can make your sword a character, then delete all the components, and set don't auto posses or something like that.
Oh didnβt know I could do that I should probably do that same process for the rest of my hierarchy lol
Currently, everything in that chain is of type character
But you're basically using the wrong class. Swords should be actors
Yea I only used character because making the player controlled character a child of an actor caused issues
So I made the parents all characters too
@late gorge Why are your input events not in the character?
You can make your sword a character, then delete all the components, and set don't auto posses or something like that.
@flat raft so basically do this for all the parents then?
why would they be? im using the character class for NPCs
And change their type to actor
so having that input code seems to be dead weigth
Okay, usually the code to control an actor is in that actor
npcs and player character (pawn) come from shared parent
im going the route of controller class having the input code, coz of different pawns
@jovial elm change them all to actors. Your knight is a character.
so i just swap out the controller depending on the pawn type
(this is tied to level loading)
Not a reason, but sure. Make sure your Controller isn't consuming the input, then it might work
think ship vs stickman
Well specially that would be Input in the pawns :P
i kinda want it to consume input, don't want stray marketplace asset input code to fuck shit up π
@proven mason I see where you were going with that, but you're missing a variable. Right now you've only got the very current time(At the end of the full tilt and back), the time at which you made a full tilt, and because of those the time it took to go from full to neutral. Thus, you have no way of knowing when you started, just when you made a full tilt. Right now your full time equation is (CurrentTime - TimeAtFullTilt) + (CurrentTime - TimeAtFullTilt). This means you're only getting the time from full tilt to neutral multiplied by two. Your Time from Neutral to Full Tilt is missing.
@jovial elm there are a few tutorials on attaching weapons to hands and stuff...check em out
Yea sorry, thatβs what I meant. The issue is when I tried doing that, while also maintaining that entire hierarchy, the knight would end up being an actor. Can I change its type after setting it as a child of an actor
- why would NPC character classes have input code... seems so wasteful
Oh yea Iβve seen one already the issue was the dude had an entire system built up that was really bad for scalability so I decided to make some changes to his blueprint class system
@late gorge You have inheritance. Move the input into a child class that represents your playable character
@jovial elm if you want your knight to be controlled by the player, it should be a character.
the setup of the rest of the codebase makes that a bit difficult
you have character base (directly off actor) that implements all the stuff neccesary for AI to work (so u can have humanoids, monsters, ships etc.)
then it branches off into rig base characters
one of which is ALS' setup
another would be for creatures (different animation setup)
another for ship (no animation setup, different controls)
Just saying how it is supposed to be handled
Right, but how can I make him of character type if he is a child of an actor? By default his type would be actor. Wouldnβt I have to break the entire hierarchy I built up or do what you suggested before and remove the character components from the parent classes?
If your setup doesn't support it then that's up to you. :P
@jovial elm What hierarchy are you talking about...
Let me repost the image i posted earlier
Sword and your Player have nothing in common called "Hierarchy"
how is it supposed to be handled then? coz different input setups and going the way of inputs on characters directly has ALWAYS caused serious spaghetti once you go down the line
Despite the sword being attached to the players component hierarchy
@proven mason I see where you were going with that, but you're missing a variable. Right now you've only got the very current time(At the end of the full tilt and back), the time at which you made a full tilt, and because of those the time it took to go from full to neutral. Thus, you have no way of knowing when you started, just when you made a full tilt. Right now your full time equation is (CurrentTime - TimeAtFullTilt) + (CurrentTime - TimeAtFullTilt). This means you're only getting the time from full tilt to neutral multiplied by two. Your Time from Neutral to Full Tilt is missing.
@maiden wadi ah dat's right.
@jovial elm But that's a made up hierarchy from you. I don't see that being related to what parent to use
if you setup different controllers (with say UI controls on parent controller) and then setup child controllers off that + making sure controllers consume input (to prevent any stray character input code from interfering) has yielded better results for me so far
well better... less prone to failure :) aight, i guess it's a bit of a tomato tomato discussion :p both ways seem to do the same thing
In here, since the parent clsss character is of type character, all child classes by default become characters. The initial reason I had it set up this way was because I wanted charactercontroller (the knight) to be of type character. I didnβt know how to make a child class of a different type from the parent.
alright I'll fix that tomorrow it's late already
@jovial elm you are confusing Class inheritance and Object Hierarchy
just never had good experience going with urs :p and ye, not meant to be an argument heheh :p just wanted to hear a more detailed explanation
Sorry about that, I only just started looking into object oriented programming still not used to all the terminology
@jovial elm Why can your knight not be a character and your sword be an actor
It goes beyond me where you misunderstood it
They are very different
Is your knight and the sword one and the same mesh?
@jovial elm i've recently set up a full melee combat system, the weapon was a completely custom class... based off Actor directly
No it isnβt
Or what stops you from splitting them?
with a collision and a mesh attached
Then make an actor with the sword mesh etc and that's it
i don't see either why it would need to be a character
Hi Guys,Looking hardly for Blueprint Dev's. I followed a Tutorial on UE4 Youtube official from 2016 about Minion Wave Sapwn. its 3 x almost 2h long Series of a "how to " set up Minions like Paragon. I stuck at the 2. Part. My Minions move, Waves work correctly.But they don reach any Waypionts or Lanes. They are just walking to the middle of the NavMeshBox. - Is anyone kind and able to help me via Teamviewer or something ? i jus want that minions walking right Waypoints so i can follow the rest of the Turorial series. Thanks all - I think for an experienced eye its a work of max. 10 min to fix this. thanks all
***in return, i can donate something or whatever
alright thanx @tight schooner & @maiden wadi; gotta get some rest it's like 2:12 AM in Canada
I just wanted it to fit into that structure of classes I posted but didnβt know how. Youβre right in saying I can just make it an actor and be done with it but I feel like that solution isnβt future proof for when the scale of the game increases and I add features
Talent entails unpaid stuff. You can ask for smaller things here but your post reads like you need bigger help from one individual
@jovial elm I suggest you make a brand new blueprint of type character. Add your skeletal mesh, and controls..get him running around and doing stuff. Then, make a new bp, of type actor. That will be your sword.
@trim matrix maybe i misunderstood
Alright Iβll try that thank you guys π
for an "experienced eye" its a work of max. 10 min. But ok, i will look at Talented channel. All Good π
sorry jumping between conversation
@trim matrix don't worry. I read it more like a job related post about helping with something bigger. If it's just a small issue then leave it
@jovial elm very simplified...Object Hierarchy, means move one object, and anything parented to it will move. You're basically passing transforms down. Class Hierarchy or Inheritance is when one object gets all the functionality of its parent. Class passes Data down. Make your own class, and you'll immediately understand how unreal deals with classes.
from 2016 to now is so much changed in UE, maybe i missed a hit box to make the NavMesh working with the waypoints i dont know...is really harashing me ^^ but i postet in career so i hope this will work, thanks navigate me right way Cedric π
@trim matrix He didn't mean #career-chat. He meant the #looking-for-talent bot. But he also realized you were not looking to hire a tutor or professional and that you were just looking for general help with your project. So feel free to post simpler questions in here.
Career chat is meant for discussing working or looking for work in the design industry.
Can anyone who have version 4.23 or above try putting this blueprint in their project and see if it will appear?
@sly finch can anyone help me with that?
@sly finch What blueprint?
It's a camera shake blueprint
I tried putting another blueprints but none of them appeared in my project
I want to make sure if it was because of the old version i have
Hey guys , if i have 300 lights that need to be turned on and off all at once , would it be better to use an interface or an event dispatcher to turn them all on and off?
I feel like event dispatchers and Interfaces have VERY similar functionality , can someone help clarify when i should use one over the other?
@short coral An interface and an event dispatcher are nothing alike. Interface is meant to call the same function/event in different actors that do not inherit from a close common parent class. A Dispatcher sends a call to the instances of a class that have asked it to make that call. In your case, definitely a dispatcher. The difference is that with an interface, you flip the switch and you need to make 300 calls through the interface. With a dispatcher, each light asks that switch to tell it when that dispatch is called, switch is flipped and it only makes one call.
Is it true that a Event is listening for calls, where a Interface is more like a tag ?
Isn't 300 lights polling a call more taxing, than an interface?
That's why i'm kinda stumped , maybe i'll try both approaches and see which hurts my FPS more
Haha , thank you @maiden wadi
lemme know also, plzzz... I'm not sure π
Aight
Btw, use the debugger to see how the signal flows. Maybe more info than looking at the fps.
That's not the way Dispatchers work. They aren't polling and waiting for the event to be called. The lights in this case tell the switch, "Hey call me when you change". The switch takes down a note of the instance of the light and nothing happens after that until the event is called.
Gotcha! Thanks!
The light switch though would have to have a reference to the light. Would all the lights need to be referenced or just 1?
The dispatcher handles that stuff internally. Presumably it'd have a memory pointer to the lights.
I looked it up, my thinking was the opposite of what it actually was. The light needs a reference to the switch. Not the other way around.
If you're interested @short coral https://youtu.be/EM_HYqQdToE
Announce Post: https://forums.unrealengine.com/showthread.php?101051
This Training Stream takes a look at Blueprint Communication. We find that Unreal Developers of all levels can sometimes struggle through the concepts behind moving data between objects. So in this video we'...
Thanks Arthaer
Can confirm dispatchers are better in this scenario
Transition between turning them off and on was much better in dispatchers , in the interface case there was a bit of a stutter
There was an Average of around 4 ~ 5 frames in difference between the 2
@flat raft where does the left mouse click come in?
if im in top down view and I want to drag a box around on screen by left click holding it, how would that work?
@trim matrix https://youtu.be/x0Xwz0pySDw
Welcome to the 23rd Lesson in creating a Real Time Strategy Game in #UnrealEngine.
In this lesson, in #UE4, we will set up our Marquee Selector. In this episode we should be able to draw the marquee onto our game space.
Please note there are unit portraits available below!
...
This might help
uhh thats just selection square
has nothing to do with what i wrote
just wanna left click hold and drag a box around in top down view
like a 3D box in game space lol
oh i see what you thought hahaha
I just made one of those. 3d selection box.
@trim matrix You're trying to do the same thing, except in 3d space, right?
Or are you meaning that you want to click drag a static mesh around?
yeah i wanna click and drag a static mesh aroun
or a static mesh blueprint actor basically
There are no drag events, so I'd probably say make a small function that detects if you mouse moves a few pixels when you left click. On left click, save 2d location variable, start tick. On tick get current mouse location, if more than certain distance from the saved 2d vector, start dragging the object.
You can start dragging by doing a trace from your saved location on the screen. If an object of your draggable type is there, set it, if not, stop the tick til you click again.
If you do hit a draggable type, set it ONCE as a pointer variable and use that pointer variable to update it's world location to the mouse location by tracing from the mouse on tick.
If you want it more smooth, you can lerp it too.
@maiden wadi oooh boy ok, thats a lot at once. How do I detect if the mouse moves a few pixels when you click (and what is the point of that?)
User friendliness. You don't want an object flying if you just click on it. But when you drag it.
oh ok
why my proc mesh goes thru everything, like it has no collision. I copied the bp from my first procmeshes that act right. the second one wont collide with nothing. just changed mesh and made sure settings are same in collision and cpu access. ? whats wrong?
@trim matrix First note of difference is that you changed the mesh. I'd check your collision on it.
If your object's collision channels are correct, then the only other issue is whether the mesh itself has collision.
I'm a newbie at unreal engine , I'm stuck at this, someone help me pls
Even though I put spring arm at 2000 distance
With camera
It's just soo closee
@maiden wadi
I just said that I checked the collisions on it.
they are identical i made two windows and meticulously checked them.
Yes the mesh has collision and works fine perfectly on its own.
btw what the hell is wrong with people taking screenshots of their screen? and then even expecting help? and top of all the picture is obscure and the problem it self.... jesus christ.
first of all YO
you dont even describe your problem and not even the desired end result
secondly help will come if it is to come
like i mentioned it above
i set the spring arm at 2000
but when i play the game
the camera is close to the met sphere
@crisp dune You're sure nothing is blocking your spring arm?
@maiden wadi u were right lol im so dumb
If you want that length no matter what, and to allow the camera to go through walls or sky stuff, you can disable the spring arm's collision.
Tysmm
can i get CapsuleHalfSize from Character class?
@sour urchin from the Character you can get a reference to the Capsule Component and then get the capsule half size from it
Hey everybody i have something weird going on, I have one zombie skeletal mesh with a physical material called "Flesh" placed in each of its materials, similarly I have put the same physical material in my human base male skel mesh's materials, but the thing is when i shoot the zombie skel mesh, it prints out the hit physical material "flesh" and spawns the blood splatter emitter, but when I shoot the human skel mesh, it prints out the default physical material, spawning a concrete blast emitter ( which is set as the default phys material emitter )
I am using a projectile based bullet btw
Is there any low-level way to edit assets? Low-level as in without any consistency constraints or dependency loading. Just modifying raw values.
Say I have a Blueprint that references a structure that no longer exists, so it crashes the editor on load. Would there be any way to manually create a matching structure and replace the referenced in the Blueprint so they point to the alternative one?
Hey everybody, i'm using a behavior tree for my AI to move to a specific end location. Now i wanted to make my AI move through several fixed waypoints but i'm not getting the correct result. This is the code my AI runs to move to a location
It just skips the first waypoint and immediatly moves to the second
My behavior tree is super simple
@meager vessel The AI moves to the second waypoint? With that logic, it should move to the last waypoint, since you're looping through all the waypoints. The last member will be the one used for the "move to location" node.
You'll want to track which waypoint is the current goal, and when reaching it, get the next waypoint. Not just loop through it all. In case you don't know, a foreachloop happens in one frame, not over time.
Might be best to put a service on that. On tick if moving actor is within distance to destination, remove index 0 from vector array, set blackboard desired location to the new index 0 of array.
Then have your moveto watch the value of the blackboard for when it changes.
Add a Decorator that asks if your array has any locations to move to and don't run any of it if array length <= 0
@trim matrix If your project crashes because you deleted a struct that was referenced, I think your best bet is to go to your UE project folder, Saved, Autosaves or backup and find your struct asset there, copy it to the proper content folder, rename it to its original name and try launching.
Then remove its references before deleting it.
@elfin hazel, thanks. I was using that scenario as an example of a thing that would require low-level asset editing. Usually things are more complicated. Like warnings about missing assets when packaging the project, while those assets haven't existed for months. I would like to find the place where they are referenced and erase them from there, if possible.
Ah I see. Don't really know about that aspect.
There is the Fix Redirectors, if it could be a result of moving assets around.
hey wassssssupppp
Don't got problems but just wanted to see what was happening here
hey @unique finch π
well I've been on my ue4 journey for about 3 weeks now I guess?
so everything is new
hey wassssssupppp
hello
@thin rapids how do you make room properly like i legit have been trying to make an easier way for myself for literally hours but i cant find it
I'm trying to make a progress bar for a Control Point, I create the widget and variable in the CP BP but, I can't cast to it. Any thoughts welcome
@zenith sun Are you trying to reset input settings during runtime? If not, you can use the import button in Project Settings > Engine - Input. Best to set up the default mappings, then export that so it can be imported any time in the future.
To do it during runtime, you need to put your action mappings into a blueprint to be referenced when needed.
@thick pewter You really should do the functionality in a control point actor and just get the current/max capture amount and get the percent from that to update the widget.
@maiden wadi Sorry for the confusion that is what I'm trying to do, that timeline is in the control point actor
@zenith sun Here is what I use to get all the mappings into 3 arrays. I couldn't figure out how to get speech mappings using blueprint nodes though. I then made a struct to hold those 3 arrays so I can put that struct into a map of input profiles. I have an input profile called Default that can not be modified unless very specific conditions are met (game update to default key mappings).
@thick pewter Ah. My bad. But that leads to another confusing question. Why is it replicated?
@maiden wadi the game is multiplayer, do I not need to replicate such values?
UI elements shouldn't need to be replicated, however, the info that is used to fill the UI may need to be replicated.
So for a progress bar, it's value may need to be replicated.
Yeah. UI should NEVER be replicated. For any reason. Only ever use UI to display what that machine has for values. It'll make your game cleaner, and also help your development because your values on different machines will make sense.
As for another reason for this. A lot of people keep their UI in their player controllers. I personally like the HUD class that resides in the PlayerController. Since only one player controller ever exists per client, you only ever have one HUD. Thus, GetPlayerController at index 0, and then GetHUD will always return the local client's hud class. If you keep your widget references in there, it makes it very easy to get from any actor you need to get them from.
However, in your specific case. You should be updating your control point on the server and then replicating a float variable to clients. Then what you could do, is have your control point on the client's side tell your client's UI to display that widget. As you do this, you can also pass in a reference to self(self being the actor on the client), which your widget can use to update it's percent variable.
By doing this, you minimize network traffic down to one float replication, and your clients can handle all of their own stuff visually.
@maiden wadi @proud hull Thank you for the info! I'll take a crack at it. I do have the capture progress on the server (value wise) just have to get the actual UI to work.
Hey, I am trying to make a top down tower defense ish type game, and i want to be able to use click and drag to move the camera around. I currently have a system where when you click it sets your last cursor location, then in tick it subtracts that from your current cursor location, adds offset, then sets the last cursor location to your current one. But, when I do this, after dragging for a short distance it gets really glitchy. Does anyone know how to do this correctly?
nvm, found the issue lol
I'm getting this warning all over the place:
Mobility of /UEDPIE_1_Frontiers.Frontiers:PersistentLevel.BP_Rock3_38 : StaticMeshComponent0 has to be 'Movable' if you'd like to move.
What can be causing this? They're just static items with no code whatsoever, just directly inheriting from StaticMesh
@dense isle this one is easy
but i will not tell ! (until I grab a screenshot)
oh wait
ok I didnt read carefully. Still I assume something must be happening to them if you get that warning
are they attached to a root actor that has a bp ? or maybe some other script collects all StaticMeshs or Actors and try to do seomthing with them ?
Hmmm. Does anyone know if there's a way to to a timeline lerp for adding forces instead of event tick? With my tornado physics I have to call in event tick but it's a massive resource hog. Is there a way to call a custom event and create a timeline for it instead. I have been trying but haven't figured it out.
Screenshot 1
Screenshot 2
Screenshot 3
Screenshot 4
Now from the one placed on the world outliner:
Placed on world 1
Placed on world 2
Please someone help me here, I'm loosing my mind
This is on the world outliner, no owning actor
are they attached to a root actor that has a bp ? or maybe some other script collects all StaticMeshs or Actors and try to do seomthing with them ?
@sick galleon This is not the case, there's no procedural generation at all
Is there a way to take actor location and rotation, then pass them to player box render transform or something similar
@mental robin It is not a massive resource hog. Forces occur per frame by definition
I just want to be able to control in a timeline π
@mental robin So you want the tornado to vary it's behavior over a couple seconds or what?
@dense isle sorry man, looking at the screenshots I dont get any clue either. You sure you're not using any script that could affect those actors ? Like a global save game system or something else ?
@mental robin So you want the tornado to vary it's behavior over a couple seconds or what?
@faint pasture Whatever object it's applying forces to I only want it to apply the force to it for a predertmined time
predetermined
Just remove them from the array after that time. Or adjust the tornados collider so they naturally fly out of it.
Guys, when im trying to save project, one of BP are causing error and says what he cannot be saved. Why this can happen?
@past swan you might have your editor open twice. Or check your task manager, there might be an old ue4editor.exe still running
@dense isle sorry man, looking at the screenshots I dont get any clue either. You sure you're not using any script that could affect those actors ? Like a global save game system or something else ?
@sick galleon Nope. Nothing is scripted about the level
this image is sad
@dense isle Hey, the warning you have is probably because you try to do a physics interaction with them^^
Like whichone
@past swan you might have your editor open twice. Or check your task manager, there might be an old ue4editor.exe still running
@boreal ether Yeah. Old UE4.exe. π₯Ί Thanks! π
hi! any way to control and move multiple pawns at the same time - by using only WASD for all of them?
@barren frigate cant you just set them to use player controller? i havent tried doing anything similar, but that might do the trick. Or a very simple way would be to get all actors of class and run for each loop on "add movement input"
Question : During PIE you can copy actors, and then paste them out of PIE as new actors in your scene. You can also paste that in a text file as readable data.
Can this behaviour be used for a save system ?
My problem is that I will have many actors with many variables that need to be saved/loaded with blueprints still being worked so updating specific savegame blueprints for each one would be hell
How can I make construction script fire not in beginning of game?
why do you want to do that?
@ruby basin Cause I have a proc mesh but i want it moving with my tweener. So I have to disable the the construction script. but when my slicer hits the mesh I want it to make copy of it for a proc mesh and that means it needs to be constructed.
but if its constructed I cant move my procmesh or am i missing something?
@trim matrix just leave your construction script blank
Sure you can
well i fire it from begin play or button press nothing happens
Fire it from your slice
You can do it at runtime... add components, but I think it's slower.
Performance wise.
Really depends on the mesh and how much geo it has.
and how much u slice it π
Welll... its will already be a proc mesh. So maybe slicing a second or third time is fine.
Question : During PIE you can copy actors, and then paste them out of PIE as new actors in your scene. You can also paste that in a text file as readable data.
Can this behaviour be used for a save system ?
@sick galleon You can make a parent bp, and all ur child can inherit the save game stuff.
@trim matrix if you slice a proc mesh, the resulting geos should be proc mesh.
yes?
well I managed to do what I wanted my way...
so just make normal mesh and make it move and when I hit it, It will spawn proc meshbp which it self constructs itself
and it destroys itself as soon as its hit
@flat raft Thank you for the input. Appreciate very much. β€οΈ
I have a socket/bone on a skeletal mesh of a character, but can't find how to attach something to it within the blueprint of the character
I have a blueprint that can't select a certain player controller class as its parent. But when I create a brand new blueprint it can. The former blueprint used to have the player controller I want as its parent but I think a bad perforce merge messed it up. Why can't I see the class anymore?
Also how do I avoid corrupting blueprints? They seem so fragile, this is the second time where I've done something seemingly harmless and a blueprint is completely corrupted.
how are they corrupt?
The first time I described it in detail here
basically a blueprint can get stuck with NULL default values that are inaccessible from the editor
and in my case I had to remake the blueprint
for this situation though I don't know if it's a corruption but it feels like it a bit, I'm not sure why this blueprint in particular cannot see player controller classes but all the others can
Are there any conditions in which blueprint or C++ classes might be filtered out / not appear as potential parent classes?
Can anyone try opening these blueprint classes in their project? Because they doesn't show up in my project
I took them from another game
I have version 4.21 of UE and i think i can't open them in that version
Can someone helpme out. I am trying to run a custom event in a widget (cartesian data plot) from Kantan..it's a plugin. I am not sure how to reference the widget. I did a cast to and set the variable..but the object keeps saying 'none' and throws an error when running. I have an onbeginoverlap event in my BP that fires the custom event in the widget..but it doesnt work...it's to do with my reference..i am doing it improperly but have no idea how to do it
@waxen trench I find unreal has trouble tracking things, or update things. A recent example I had is that I imported assets, sorted them into different folders, and it made copies of the same asset in duplicated folders. It also locked the folders some how making deleting them impossible. In some cases I restart the engine, I make and move another folder (to hopefully clear a cache?..maybe) , and lastly if all that fails, I delete it from explorer.
Yeah I've had to go through things like that to varying degrees as well - I'll just try to remake the blueprints π
A good way to check if Unreal has registered your asset, is to right click and show in content browser, or find in explorer(if u suspect something is wrong). I found that sometimes there is a icon in the content browser, but not on ur hdd as a asset.
Moving stuff around in windows, should be the very last thing you do to fix things. Just FYI... it makes things worse. π
I just keep in mind Unreal is a beast of a software, and things will sometimes break for no apparent reason.
@maiden wadi thanks for the info
void HandleRoll()
{
Vector3 flatRight = transform.right;
flatRight.y = 0f;
flatRight = flatRight.normalized;
rollAngle = Vector3.SignedAngle(transform.right, flatRight, transform.forward);
Vector3 rollTorque = input.Roll * rollSpeed * transform.forward;
rb.AddTorque(rollTorque);
}
Can someone help me translate this to blueprint?
the SignedAngle function does not exist in unreal
Definition
C# if it wasn't obvious
If there's no blueprint node for it, then simply apply the maths yourself
You should be able to convert the two vectors into an angle around that axis
And then subtract the one from the other
If I'm understanding what the function does
Problem is that my own understanding of this is way beyond me π I have no clue where to start
for my combat system i have a few different components that can react to each other. For example, my health component binds to an event dispatcher in my stats component to adjust my health whenever my health stat is modified, and my stats component binds to an event in my buffs component to modify stats when buffs that modify stats are applied, etc.
what's the best way to initialize everything in the right order? there isn't a construction script for components, which is where i'd like to do stuff like "set current health to max health," before binding events to react the stats component. I'd want the stats component to set each stat to its default value before recalculating everything based on the buffs component, etc.
currently i have a "master" component that tells all other components to Initialize Pre-Enable vars, then bind to each other's events, then do Post-Enable events like recalculating stats or applying passive buffs. I would like to avoid having to add an extra component to every actor that can use any of these components, as some of the components are kind of unrelated and i don't want them to depend on this master component if no other ones are present, etc.
its fine for actors themselves to setup the component bindings
i'd also recommend a base component for component such as health that does all the stats hookups there
i have a similar setup
the difference is that i found buff component completely redundant
the idea was that i could plug and play any number of the components on any actor (i've made them in a way that they don't fail if they can't react to the other components, they just won't get extra functionality), so having to put that kind of thing in the actor isn't ideal.
interesting, how did you handle buffs?
as it falls completely under single responsibility for my AttributeComponent, managing buffs
ah. attribute component is your stats manager?
well, you actually have the functionality for just one component there
you need a stats container, buff container and logic to update stats based on buffs
that is material for one, not two separate classes
i separated them as buffs can do things other than modify stats (such as deal damage over time, or just act as a custom trigger for mechanics, or apply crowd control). i suppose my buffs component could handle adding and removing buffs as well as all the effects of them
my buffs can do anything, they are UObjects
mine are actors because i didn't know if i'd run into replication issues with objects instead but yheah
if they modify attributes, they broadcast a delegate that causes attribute component to recalculate only the attributes that particular buff affects
but they can just as easily cause target of the "buff" to take 4x damage on the next hit
yeah i have a similar system, the buffs component was just a container for buffs and broadcast their addition, stacking, refreshing, and removal, and other interested components could then react if the buff was relevant
by intercepting the damage functions and modifying their output
without affecting stats
very curious how you setup damage calculations with buffs, do you query buffs when calculating damage to see if any are relevant, or do you use some kind of delegate/list of interested objects setup to ask only things that have specifically requested that they want to affect a damage event?
right now i use an event dispatcher that passes an object around to collect any modifications and then it reads back any mods and applies them
damage functions have a single cast delegate
if its bound, they execute it before applying damage
then unbind it
i pass my FDamage by reference via that delegate to the function modifying it
and thats pretty much it
did you set that up in cpp?
i cant get passing structs by ref through delegates to work at all.
but i don't even have blueprints, except for specific buffs
even more considering its a multiplayer game
would never do networking in blueprint
i taught myself ue4 in blueprint exclusively, didn't do any coding until very recently, so suffice it to say it takes me about 20x longer to do anything in code
definitely some things that are obnoxious about not using c++ though
well, you can't replicate UObjects in BP to start with
yeah
requires c++
that's why my buffs are actors π
which is obviously more overhead, but
saves me time right now
also, there are things like FFastArraySerializer, that are kinda like replicated arrays, but are capable of per item callbacks on clients for add/remove/change
buffs being Actors, in a MP game, will never hold up to production specs
atm the game is only 4 players max
just the extra stress on the server CPU to evaluate buff Actors for replication is a death sentence
well that's disheartening
UObjects don't get their own channel to replicate over
they use the Outer Actor's
so i can have 50 buffs on one character, and its still 1 Actor to consider
in your setup its 51
there is a significant difference between the two
yeah π¦
wish i had been into programming a long time ago
wouldn't feel retarded trying to do basic things
replicating UObjects in c++ is fairly simple
you can just read ActorComponent code and you'll notice what you need to override and where
its not any specific functionality, its that in blueprints i can make a ton of stuff in a day and its super easy to diagnose issues. in c++ i have so much trouble just figuring out where to even start looking when things aren't working
as that is an example of replicating non-Actor UObject
eh
i made my attribute/buff system 2 years ago
right now, i know it doesn't have bugs, and that it supports all required functionality
and the entire system is 1 custom ActorComponent, 1 custom UObject base and about a dozen or so structs
besides, even with moderate practice in c++
managing collections of any kind is so much faster and simpler in c++ then in BP
you can literally one line functions that sort, filter and transform the array using a lambda, and its 2 monitors worth of space in BP, at least
as well as 4-10x slower π
that too, BP performance in large loops is... not ideal
I have a character that implements ITargetable.
In blueprint, I do a line trace which gets various Actors, I do a check Does Implement Interface for ITargetable. I only want to continue processing Actors that implement ITargetable.
I have a Branch after Does Implement Interface, so I know for sure this particular Actor does implement it. Then to call the interface function, I Cast to ITargetable. Is there a better way to do it? Must I always cast? (I heard casting is slow)
its not particularly slow
but you can do a less verbose version in BP
by sending an interface message
it basically calls a function on the interface, if the target implements the interface
the interface implementation is checked under the hood
alternatively, you can use a separate collision ObjectType for your targetables and approach it that way @pale blade
I think interface message is what I'm looking for, let me look into it some more
Thanks
note that performance won't really be affected either way
just verbosity of the code
Howdy! I had a quick question: What is the "best practices" procedure for storing variables which will be targeted to be under player control in a final build: Example here being Inverted Y Axis for camera controls.
@still trellis you can use uobjects. you dont need to replicate them from the server, you only really need to replicate their existence on the client. i use uobjects in bp, spawn them on the server, then send an RPC to the client that it exists and for how long or w/e. You can run any effects off of that RPC
you can also just do a struct bp buff system. i just found objects to be easier to work with.
ive been able to get a c++/bp hybrid uobject buff system, bp buff uobject, and bp struct buff system. all worked fine without a massive impact to the server
that might be an option, have the actual buff exist on the server and a struct representing the buff object on clients, and any buff functionality i can multicast or owning client rpc.
Most of them are doing stuff that the clients either don't care about or only need ot be aware of. some things you need to yell at the client for (like a move speed debuff or something)
but a lot of buffs are server authoritative stuff anyway
Zlo is right though. using actors is probably going to be very heavy if you end up spawning and destroying tons of them. with a 4 player deathmatch or w/e though, its probably ok π
probably
ironically (is it irony?) even in c++, I do something kinda similar like that for my inventory. I don't replicate the UObjects themselves, i just use a fastarrayserializer, which just contains the basic few things that need runtime update; a name, stack count, slot. The client side just creates it's own versions of the actual UObject for stuff like ammo for a gun to show on hud / work with prediction.
and for drag and drop visualization in umg, etc.
exactly
i ran into what you did a few years ago @still trellis and after running into issues with the struct buff system, i built a hybrid c++/bp system. then i just built a bp system that pretty much does what @whole rose came up with
like a dummy buff on the client
manage buffs as uobjects on the server, pass the dummy info in a struct to the client, create dummy uobject buff (or just use the struct itself)
just dont use BP structs if you want to nativize code. you need to make them in c++
same goes for enums
So I have a "add buoyancy" blueprint script from a plugin, but it requires an actor as target. however for the mod im doing i need to make it affect a specific component of the player actor (a specific building brick inside the player vehicle) how could i go about doing this?
OK now the question has changed to how do i get a specific static mesh component from an actor? i cant do it with get component by tag, it doesnt show up as an option!
@scenic scroll can you not just cast to the vehicle actor?
despite reading the documentation about casting, i never really underestood how it works :(
ah
you really need to learn about that and how it works
Its very very mega super important
Although it can be a bit tricky to understand at first, it makes perfect and easy sense afterwards
right! maybe there's some good tutorials online that explain it simply
so i'll watch those
hm yea i think the unreal blueprint communication tuturial might do it
Announce Post: https://forums.unrealengine.com/showthread.php?101051
This Training Stream takes a look at Blueprint Communication. We find that Unreal Developers of all levels can sometimes struggle through the concepts behind moving data between objects. So in this video we'...
I think this one explained it well
thanks! i'll watch that and see if it clarifies things
kk gl
thanks!
it goes into more depth about alot of other very important things as well
Its very much worth watching
even know its long
Howdy! I had a quick question: What is the "best practices" procedure for storing variables which will be targeted to be under player control in a final build: Example here being Inverted Y Axis for camera controls. Would these be set under the Game Mode?
@crystal bison something like preferences would be stored in either the player controller or player state
I have a BP that disables input (using variables, not the Input node), blends the view target from my FPS camera to a camera component, then after a short time blends it back and re enables input. I'd like to still have limited control of the camera while in it's blended state. So trigger>camera blend A to B>player can look around just a little>camera blend B to A>player has full control again. I just can't figure out how to transfer control of the camera from the main fps camera to the camera component. Any ideas?
Hi,
I'm a little confuse about the best professional way for making RPG character system
currently, I made one actor which contain everything inside it
but in the future, the player should be able to switch between multiple types of actors
like: human, jet, and robot (which it had some similarities and differences)
so, I read about player controllers, child blueprint
but I don't know what, when, and how is the best way to use them
so I came to you here, hoping you can save me π
if there is any easy to follow tutorial I'll be thankful
@terse garnet What you're facing is called Class Inheritance. In short, you put the most functionality you can in parent classes without being too specific. The simplest example of this might be for something like your car vs a human. Both are Pawns, they both need to move and receive input. But neither are simple enough to be just pawns. So one turns into a Character class. I don't know of any tutorials, but if you read up on the generalized concepts of object oriented programming and class inheritance, it should clear a lot of that up.
yea thanks, actually I came from 7 years+ of OOP programming, so I know this concept, however, I don't know what to put where, and do I need to use one player controller or more, or even do I need to use controllers or parent and child blueprint is enough.
PlayerControllers are just a virtual representation of the player in the game world. They should be used for any non specific input required. Player controllers "possess" Pawns, which also allows the player to input directly into the pawn class so that you don't have to program all of the input functionality in the controller. For example, if you possess a character. You would program the WASD in the character itself and not in the controller. In the controller, you might put keys that bring up UI like an options menu that can be reached even if there is no current character possesed.
Unreal is a different place. Confusing at first, but the design environment is amazing and really starts making sense once you've gotten a hold of it after a bit.
thank you @maiden wadi , you are right
Reframing my earlier question, what's the best way to temporarily take control of an actors camera component?
Let me see what ViewTarget actually moves.
You can possess unpossess a pawn camera. But I'm not sure if you can control it tho
Thinking about my options, I could pipe in the float values of my mouse axis as variables through a BP interface, or maybe copy my fps cameras world rotation over to the other camera, or is there someway to just enable input on the actor and go from there?
@simple lantern you'd either have to possess the new camera or send inputs to it from the currently possessed pawn or player controller
Okay cool i'll take a look at those things
There a node called Get Actor Eyes View Point, which grabs the camera rotation from the player controller
So that's convenient
I'm totally confused, I have a 1 second delay node that's firing twice, one right after another. is that supposed to happen?
as in 1 sec delay > fire, another 1 sec delay > another fire
Depends on your logic setup.
I have an BP interface event, which makes its way into a delay down the line
i'm just going to pull apart this set up so I can isolate the issue
seems to happen right after a timeline
Okay solved my own problem, the delay was connected to a Timeline's Update pin, and both the delay and the Timeline had the same duration, so the delay got executed, then after it's duration finished the timeline's update I guess executed it again sending out another pulse, but they both ended simultaneously so I couldn't figure out what the problem was
my timer by event does not trigger in gamemode BP...
SpawnEvent does not trigger
Solved by myself: Timer for "ReadyCheck" was restarting the timer for "SpawnEvent"
took hours to realise timers restart when they receive exec again
LogScript: Warning: Script Msg: DateTime in bad format (year 1, month 1, day 32, hour 7, minute 0, second 0, millisecond 0). E.g. year, month and day can't be zero.
well, I guess DateTime is not smart enough to roll over to the next month if I try to set the day to 32
that would have been super handy but I guess not then :P
I'm trying to get a BP interface event in my Anim BP but it won't work. The exact same node setup in my Character BP works fine, but inside my Anim BP it doesn't fire off. Do BP interfaces not work in the Anim BP?
Does anyone know why my Lookup here isn't working ?
turn is working as it's suppsed to be
but lookup just does nothing
@barren frigate cant you just set them to use player controller? i havent tried doing anything similar, but that might do the trick. Or a very simple way would be to get all actors of class and run for each loop on "add movement input"
@white crypt thank you for your help. I've tried your method but it doesn't seem to work..
I'm trying to get a BP interface event in my Anim BP but it won't work. The exact same node setup in my Character BP works fine, but inside my Anim BP it doesn't fire off. Do BP interfaces not work in the Anim BP?
Still trying to figure this out. I have a BP Interface event in my AnimBP that isn't getting fired off, and the exact same setup in a different BP works fine (all of them have the interface correctly set up). What gives
can someone explain me how is this thing working?
It's the best I could find for clamping my camera but I can't understand it
Is the Construction Script event supposed to fire by default when you move a blueprint in the editor?
Ah, nvm... it running, it just not doing those pulsing orange things
It should run any time you move an actor in editor, or commit an edited variable.
@trim matrix That is.. the strangest implementation I've seen of that. Are you still looking for a solution to your camera issue?
yea lol
Single or multiplayer? And show me how you're moving your camera in the first place without the clamp.
Singleplayer
How are you moving the camera at the moment?
I use pawn control rotation
and I use 3 modify bones in anim graph to move spine 01, 02 and 03
based on the rotation I made
It's working on jogging / sprinting but when I crouch and jump I can see through my body
and I don't really know how to modify the clamp
and also I have two cameras that I toggle with a button
first person and third person
I dunno. Without seeing what you're doing, it's hard to say. Initially I'd say that if you're relying on Control Rotation, I'd just make a tick function that checks if the control rotation is outside of your bounds, if so, move it back. Probably only need to check pitch for a general fps. Roll isn't really used and Yaw is usually meant to be 360 degress.
Lemme try
@elfin hazel regarding my waypoint problem: the second was the last waypoint. There were only 2. I actually tried it with a while loop to see if the AI was close enough to my waypoint but that somehow ended in an infinite loop. Can i fix it Inside that for each loop or is it better to create that loop in the behaviour tree?
Hey guys, I have a problem with my AI pawns. They are flying AI and the "move to location" works perfectly fine if I place them manually in the level.
However when I spawn them via a blueprint, I get an "Accessed None trying to read property CallFunc_GetAIController_ReturnValue" error. Does anyone know why this is happening?
@teal dove You're likely spawning them with the wrong function. You're calling SpawnActorFromClass?
@maiden wadi Yes, this way
@teal dove Use SpawnAIFromClass. SpawnActor doesn't assign that actor a controller.
Oooh okay, I will try that !
No, still same error π¦
Hmm well it seems something was wrong in my AI pawn blueprint, now it works with a newly created pawn
Not sure what is the problem with this..
Do you have an AIcontroller set in the pawn's class?
Yes. When I place the pawn manually in the level it works fine, it only doesn't work if I spawn it
And now it also doesn't work anymore with the new pawn..
I love it when unreal is acting strange like this π
I guess I have to make a bug report for this..
how to get world context in asset bluetility (Asset Action Utility)
? I want to use CanvasRenderTarget functions and they need worldcontext
@teal dove It's not likely a bug. Show me your Pawn settings for the AI, and how you're spawning it.
@maiden wadi This is how I spawn it
I'll take a screenshot of the pawn settings
And this is my flying pawn that I just newly created.
I managed to get rid of the "accessed none" error when setting "Auto Possess AI" to "Either Placed or Spawned" but it's still not moving when spawned via the blueprint
Only when placed manually into the level
Not sure then. Did the same thing. My AI have valid controllers right at beginplay. It might be worth noting that the movetolocation function still doesn't work.
What do you mean it does not work, it's bugged?
Yeah it's really weird
Oh, my bad. My Behavior tree was affecting it. If I disable my BT, the move to works.
I guess a bug report it is then π¦
If they even bother to look at it, they're just going to tell you to try to reproduce it in a clean empty project. I'd do that first.
I'll quickly do that
is there an easier way to make a tile cordinates based movement?
Or i have to manually create lots of actors and place them in the tile center position ? to be able to access the location later for moving the pawn ?
i can only get the center position from the level blueprint
Hey guys, i have 2 waypoints my AI should run to. Somehow that BP makes the AI run to the second waypoint first and then move to the first one. The print actually prints out the first Waypoint first and then the second one. So the order in the array is correct. Why does my AI run in the wrong order though?
does anyone know why If I make changes to a parent and play in editor, children of the parent atre not properly updated? I have to manually press compile on them each time I update the parent, it's frustrating :/
How can I make a bp where pressing on W makes the mesh move forward?
I want to make a plane, but i dont know how to setup first input
@fallen glade Are you compiling & saving the parent after each change?
anyone know the system dead matter uses for there aiming?
How can I make so UE plays the character as specific BP
idk if this works that way but so it chooses the pawn to be starting point
@fallen glade Are you compiling & saving the parent after each change?
@teal dove yeah π¦
@stiff gulch You should have an abstract representation of the playfield. IDK what you're asking though, it's as simple as only moving to multiples of your tile distance.
guys can anybody dm me how to make a lean in and out function this one i made doesn't seem smooth at all!
Heyo. I have a blueprint that has child actors blueprints. For some reason I cant access those children blueprints properties, even tough they're marked to appear in editor. Any idea why ?
somebody HELP
@unique finch show the float curve
ok
@faint pasture pls help
i also need to disable some of the inputs when i lean
so if you could help with that that would be nice :DD
Are you 100% sure the starting rotation matches up with the non lean rotation? Is it snapping during the lean or at start?
Does anyone know how to make a tarkov style inventory?
or a tutorial that can teach
@unique finch temporarily make that curve totally flat, does it move at all or does it still do something?
@faint pasture somebody told me to lerp, but i don't think that is working
uh
Why?
It makes it un-smooth
Then something's off with your math. I bet at the 0 curve output it doesn't match up with whatever the relative rotation and position are by default.
@faint pasture you are a man of patience ._.
@sick galleon are you trying to get properties on the child actor components or on their spawned actors?
@faint pasture not 100% sure of the difference, so heres what I have
im selecting the parent actor, then the child component in the actor in details
That's just the component, the component spawns an actor at runtime, you need to get it to touch the actual actor
wait so if a blue print as a child actor, it means its not actually part of the blueprint, but something that has to be spawned when the parent blueprint spawns ?
@faint pasture how do i disable inputs btw when i lean?
there is really no such thing as a child actor, it is a child actor component. The component spawns an actor.
@unique finch have some sort of Boolean that could set true when you lean and false when you aren't leaning, and use that where you handle the inputs to see if you do anything with them or not
hmm ok
So when my "prefab" blueprint spawns, other non-attached actors should spawn along it, as defined by the child attached components ?
@sick galleon yes, but they are not the components. They are seperate actors. There's some sort of link thru the components but they are actors themselves.
@sick galleon Godot actually does the approach you're thinking of. Everything is a scene. You can go world -> character -> gun -> bullet all nested. Very interesting architecture.
the whole nested actor thing is super confusing in UE tbh
you can attach actors to other actors in runtime
but you can't do it in the BP editor for some reason
There really is no nesting. There's a world, actors, components. You can attach them, but they are not nested within
The Godot approach is like components all the way down.
I have to admit that behavior is a bit confusing to me. Im trying to do a door prefab, that includes two pathnodes actors (own pathing system) to force a connection through the door. Is making a blueprint of the door with pathnodes child actor the right way to do that ?
yeah I come from unity and nesting was intuitive, here its ... weird.
like you delete an actor from the editor, and the attached actors arent destroyed
@sick galleon I've worked a lot with sub actors and I do not use child actor components at all. I just spawn things at runtime or in the constructor
Child actor component might have the functionality that if you delete the parent, the children go with it. But that functionality is enabled to by the child actor component itself
it's pretty tricky if you have a more complex actors tbh, in one of my projects I have a spaceship where you can move about and move the entire ship, but there's also complex components that you can interact with within the ship itself
@sick galleon In your case, why aren't the pathfinding nodes scene components?
there just doesn't seem to be any very good way of doing that in UE... child actor components sort of work but they need a lot of boilerplate
Im really not sure how a scene component should be used
I'm working on a Kerbal space program style vehicle builder and I just spawn the actors and attach.
@sick galleon a scene component is just an actor component that has a transform. No rendering or anything, it's just a bundle of variables and logic that has a location
@earnest tangle it appears so. Its a really weird decision to me as most software handling 3D objects manage nesting of object pretty much the same way. I guess there are some technical reasons because related to engine architecture ?
@faint pasture so you're saying my pathnodes are actor blueprints, but should be scene component blueprints ?
It depends, can a path note ever exist by itself or is it always added to an actor?
good question. I would think they can exist by themselves but Im not sure I can figure out a case where I need this. Maybe if I need some more dynamical pathfinding and have pathnodes affected by - but not attached to - moving physics objects
For example, in my game, the dungeon room prefabs or blueprints have a bunch of spawn location components. They are really simple, just a location and a list of enemy types possible and maybe percentage chances.
In your actor outliner, everything that you can see in 3D and move around is a scene component. Actor components would be like a HP component or Movement component.
what are touch over events?
So, if I add a actor child component in my blueprint, its really a scene component that says "spawn this actor here". I see.
I have to say its a somewhat disappointing system to me. Not as disappointing as the vanilla save system (or basically lack of) but still ...
im doing this but it keeps giving that error even tho i have the class selected. why is that??
@thin apex SET is not plugged in, is that normal ?
@sick galleon idk....im just watching a youtube video to learn this and i have no idea wts going on...all i know is why he wants to do it like this
@thin apex all nodes with a action input / output have to be wired to actually do something
question. After setting the BP and the gamemode, why does my camera suddenly goes to weird position once it starts playing?
its like you're telling the script that it needs to do something, but not telling when to do it
first pic before, second pic after running
doesnt the Event Begin Play do that???
@thin apex basically, you follow the white line from the event you chose to use, and anything thats the white lines enters is actually used
some nodes dont have white line input/output, its because they're not actions but values, they will be read used when an "action" node need them
so basically they're passive
you might want to watch a quick video on the basics of blueprints, that will save you a lot of time lost in confusion
@thin apex SET is not plugged in, is that normal ?
@sick galleon ahhh im sry...i just read this again and im blind TwT...yes i had to plug in SET.....and i get what u mean so ty for explaingin that
yw
Can Someone help me figure out why my bp doesnt work
The basic bluprint looks like this, but whenever I run (Gamemode defaultpawn set to that bp), it just glitches into one spot and I cannot move anything, camera nor pawn
@rustic steppe you're sure you dont have another camera in your level ?
idk, does playerstart count as a camera?
im just frustrated that for some unknown reason camera just snaps on one position
i dont know if its because of event graph or something else
i dont have anything on event graph yet
maybe that is the reason
@rustic steppe check whatever actor is at the position your camera get stuck at, must be that. If you switch back to editor mode while in PIE did your spaceship move ?
says camera actor
but where the camera actor belongs to is something I dont know
it just
is this a Get(a copy) or Get (by reference)??