#blueprint
402296 messages Β· Page 930 of 403
you implement it on any number of classes and can test "Does implement interface" on an object to test in a similar way to a cast success. Much more efficient
Huh, didn't think of that.
So I just need to tie an interface to the squads for it to register?
how would i actually reshape the collision things? so far i only figured out how to move and delete them
toggle through these options
you would probably put an interface on whatever actors you might want them to see
bruh
but none of them lets me move the vertices
you can deform the individual collision volumes to change their shape
deform?
in the scaling tool, yes
collision data is a bunch of individual shapes. Just modify those shapes to fit how you need
looks good to me
you can't manipulate the form of a convex collision
ohh ok
if you want to do this, you have to make your own collision mesh in blender or similar
How can I react to physics overlap event in my blueprint? It seems that none of the events are available (Static Mesh Component)?
does not exist
when you right click the component in the hierarchy, the events dont show up?
End Play is the only override I can find
onComponentBeginOverlap
right click the component in the hierarchy
in the contextmenu theres an option to add events specifically for that component
that's an instance, not the blueprint....
ah
I see, so if I multiply by -1 and then add 50 to that will it move backwards by 50?
well I can't find the hierarchy on the blueprint
in main menu, window => components
why are you like this?
click the window in main menue while you have opened the blueprint
like what? I can't find it...
wait
it depends on if you want to move the character in 3d space or not
sorry
If you mean the window with the viewport, it also does not have anything about components
what the heck is that blueprint
what is the parent class? it shows on top right corner
Yes backward in relation to forward rotation in 3d space
he probably moved tabs around for whatever reason
It says "Static Mesh Component"
then yeah, it should be fine
do you want to make your own static mesh component class?
Can anyone help find out why my break vector and break rotators aren't working...?
or do you rather want an actor with a static mesh?
aren't working in what way?
So I noticed a little... issue with this approach. Well with detection in general.
The Squad is doing the detecting but is seeing all of the characters that are a part of the squad.
Any way to create an ignore list?
Hm, kinda, not sure. I basically want a building component that adds the shape of a building and some behavior, then my hope is to add tons more of those components to my city actor. I'm doing it this way because I heard in some video that if you have lots of meshes it's better to have them as component instead of actor. Not sure if that is true though (or even possible)? @spark steppe
The vector and rotator values going in are fine, but are zeroed out on the X Y an Z outputs, giving me Accessed None errors
are you testing if they implement the interface?
Yes. My concern is more the sheer amount of calls regardless of the branch outcome.
I believe that DII checks are less costly than casting
indeed I don't want to do that. So I'm guessing actor is the way?
yes
Alright, thanks a lot! π
it shouldn't give accessed none if it's a float. Are you setting and that's invalid or something?
You said. But I mean the pawn sensing is calling its event regardless of how I'm checking validity.
And its going to be doing it a lot
I'm not really the person to ask about AI, but isn't there a stimuli you add to individual actors who should be sensed?
Hmm, might need to look into that.
Well, I checked using 0's for the transforms and it ran without any accessed none, so I'm assuming it's the rotator and vectors
it's the widget that's invalid
so tick fires immediately, and it's probably racing your widget creation
that I don't know, but my guess as soon as looking at it is that the tick is calling the widget or its owner too soon
if you right click an object node, you can convert it from a pure node to a "Validated Get", meaning it's basically an "is valid" check and a branch node together. I'd test it with that if I were you
I'll check that out, but as you can see, widget is being used for other things and it works fine. I might experiment with the timing though.
I would definitely check that out first
Also, further complicating things, this is for a VR game, so some objects just aren't created, like the hands
I won't even pretend to know anything about VR
I mean I just started doing this unreal stuff 1 day ago haha
You have prior experience with programming?
Yeah, courses of java at uni
Hmmm..
1st year was pretty much just the basics, and this year we went upto javafx, database control, serialisation etc
you know, typical uni crap
I only ask cuz neither VR nor multi-player is something I'd pick as a beginner
Adds alot of complexity before you're comfortable with the engine
Hey guys.
I'm working on something specific. I need people to be able to importe there own textures and use those for materials.
So I need to know if there is any way to let people import a PNG file Into the project. at runtime. thanks
yes, there is a way
what do i use to destroy a weapon that get attach to the enemy. when i destroy the enemy the weapon still floats, i simply try just getting all the remaining weapons and destroying them but for some reason that didnt work
Are you destroying the enemy actor right away? No calling event?
im getting all the actors in the arry , getting the length and then destroying them using a interface event
Destroy the attached weapon first before you destroy the enemy actor itself
thanks makoto it work deleting the weapon first
is it possible to recreate the farming system from Farming Simulator using blueprints? I'm interested in doing the planting, fertilizing and harvesting
I'm not particularly knowledgeable about Farming Simulator, but I can't see why not? Is there some specific part about it that you're worried about, or just generally unsure about how much you can do with blueprints?
I'm unsure how much I'm able to do with the blueprints and that's why I wanted to ask if it's possible
Unless there's something very strange going on in farming sim, blueprints can generally do just about any game mechanic
they might be slightly less efficient for performance, but I'd say it should be doable just fine
does any one has idea how to work with camera post processiong setting relating to DOF control in character BP. ?
Nothing that strange, driving with a certain vehicle will turn that portion of the plot into the crop plot which grows overtime, and the harvesting does the harvesting. What method should I use for this?
can I make it so the vehicle paints a different terrain texture over certain types of terrains?
You definitely can, but how to go about it is a more difficult question
So basically all you need (beyond obviously needing the whole vehicle thing first)
is a collider attached to the vehicle that when overlapping the plot converts it either to crops or grown crops into a collected resource?
how to efficiently handle the crops/plot is a bit out of my element
but this is definitely blueprint doable, might just take some research to find the best angle
Is it possible for the terrain to change by itself after a set amount of time? I would like to have multiple crop growing stages. As for the crops to not use many resources, they are gonna be similar to how plants in minecraft are made. 1 texture file overlapping another using intersecting lines.
Yes absolutely
Changing the landscape itself would be tough, but a million instanced static meshes for your plants will be fine.
You'd have to work your way up though, if you're asking the question, you're not gonna make it right out the gate. Start by trying to make a plant actor that has internal stats and grows over time.
Also, for a farming game where you might be far away from the growing things for a long amount of time, you won't really want your growth function to be stateful
That is, PlantStatsDay2 should not depend on PlantStatsDay1, but instead be a function that can be evaluated at any time
I want the growing to be spontaneous into another stage not linearly
Wouldn't it be less resource intensive if I tie the different stages of the crop to a certain terrain texture?
Hi, does anyone know how to change a float from double-precision to single-precision?
There's all sorts of ways to tackle it. Start with getting something to "grow" over time.
The final thing would probably look like fields as actors with a size and stats and growth levels etc, but it all depends.
I would not go 1 actor per plant though, you could easily have all your plants just be a bigass array of raw data that's interpreted by something else. Start small though.
TArray<FPlantStruct> MyPlants
PlantStruct:
-vector Location
-name Species
-float Nutrients
-float Water
-float Sun
-float Disease
-float Growth
-float Yield
Is there a way in BPs to easily figure out what the parent of a built-in class is? Like say I'm looking at the humble MeshComponent here and I want to find out what it subclasses
You want to find its subclasses or its parent classes?
Then you have some system (Subsystem or GameMode or GameState or wherever) that can update all your plants on some timer or whatever.
That is the model. What you see in the game is your view, which interprets the model to show the meshes for the plants within visible range etc.
Parent class
Like for the longest time I had no idea that StaticMesh and SkeletalMesh had a common parent. I assumed they should but I had no idea how to find it
IDK about in engine but you can cruise the docs.
ugghhh docs
If you have chrome, I have an amazing ide chrome extension too.
I just realized for the first time in like a decade I don't have any IDE installed anyways
What site is this anyways? I've got this page but it's honestly useless https://docs.unrealengine.com/5.0/en-US/BlueprintAPI/
That's the docs for you.
The real docs are pretty much the source code itself.
Yeah so.... the statement "you can cruise the docs" is not entirely accurate
It's accurate if you can sight read C++ code
StaticMeshComponent is used to create an instance of a UStaticMesh.
That's well and good for this instance, but I feel like the moment I use the search box I get transported to a different, worse website
||apparently it's based on bing||
Yikes.
Like if I wanted to know something like "what's the original class that declares OnComponentHit" the search gets me nowhere
The new api search page is fucking awful.
And why don't the blueprint docs link to other things in the blueprint docs like c++ stuff does?
The worst part about the search is, sometimes, if you put in an exact class name, the first result isn't that class
So awful.
^^^ the statement "if you want to get decent documentation for blueprints, you gotta be able to read C++", while it might be true, is fucking stupid. Luckily I can, but aren't BPs in general supposed to make it easy for people who can't?
The turn tables when you search with Google.
Most of the time the first result is the typename you want
Yeah I might just end up having a site:docs.unrealengine.com/* bookmark like I do with reddit
https://www.google.com/search?q=ustaticmesh+inurl%3Adocs.unrealengine.com i think I'ma change my search prefix to this.
Also credit where credit is due, the docs for C++ API tells what module it comes from and what to include
site: even better
What's the difference between inurl and site anyways?
inurl can be anywhere in the url.
www.test.com/docs.unrealengine.com would also qualify
I'm assuming site tests the host
God nothing about BPs quite bugs me like the lack of generics. I could do such clever shit.
hey guys
i am using Timelines here , the timeline on the Day event works fine but the timeline on the night event does not work for some reason it is kind of stuck on 0.055556
any idea why is this happening?
any solution?
Why two timelines?
why not 1 timeline, and night event reverses it
that's probably your problem btw, you got two places where you're setting Intensity, so it keeps being set back to 0 if both timelines are playing at the same time
ok got it i will try this
Anyone know how to properly work with browser pop up windows if used? I have managed to open the pop up but when itβs finished thereβs nothing I found that closes it (the overlay) or even returns back to the last screen as it usually would vanish and present back the main page with new info added.
@spark steppe hey, so could you tell me more about the way you can use to let people import there own textures ?
So I can look into it and lurn how to use it ? π
yes i could
can someone describe this phenomenon for me?
well you "delay" the camera vehicle rotation
so it lags behind the actual vehicle camera rotation
how to do it then?
what's your goal?
I want to add some delay to the mesh when I rotate it to the forward vector of the camera.
K so camera drives TARGET ROTATION.
You RInterp ACTUAL ROTATION towards TARGET
You have 2 rotations
where you wanna be
and where you are
where you are smoothly interpolates towards where you wanna be
Camera (control rotation actually but whatever) drives where you wanna be
interpolation speed controls how fast where you are chases where you wanna be
yea why does camera rotation drive your vehicle rotation?
Personal choice I guess, for mouse steering Halo style
I actually want to do it more like in The Forest
Show a clip of what you're trying to achieve
and/or you have to limit the camera rotation
so that it can't drift to far off the vehicle rotation
Introducing the Log Sled! Only available in limited quantities in The Forest. Order today to avoid dissapointment!
All recorded in v0.12. Enjoy and use use responsibly. Please note The Forest is currently an early alpha game (thus all the bugs and glitches at the moment)
Please subscribe to my channel - CaptureRapture - http://www.youtube.com/...
do they use chaos physics? π
That looks like a fairly free camera and the sled mechanics steering the sled towards the camera orientation. I'd split the 2 up, make a vehicle that can steer towards an orientation, and then just feed the vehicle your desired orientation from ControlRotation when you're riding it.
isn't the sledge a pawn anyways?
it is
posses it when the player interacts with it, so you can have your own control logic on the sledge
π
ok, then don't rotate the camera with you player input, but the sledge
and interp to the control rotation
and let the camera just inherit the mesh rotation
Ok I will process this and come back probably earlier than you think
What's the cleanest way to figure out which of two GUIDs is larger? I promise this isn't as stupid as it sounds.
Larger in what way?
I know they've got a ToString but I can't figure out how to compare strings
Doesn't actually matter so long as it's consistent
You have 4 ints
go nuts
I've got an edge case where two different handlers will both try to handle audio for a collision, so I figure assign all audio handlers a GUID and in this case they check each other's guids and the one with the "larger" one handles audio and the one with the "smaller" one gracefully exits
Hmm. Weird.
Just compare one pair of the ints then
this is not #blueprint territory tho
Well, it is insofar as I'm doing this with blueprints lol
Are your only conversion options to string?
Looks like it. No break node either.
Why not use mass or something
They could easily be different instances of the same object. In fact, that's the most likely case
Really it's kinda weird that there's no way to compare strings in BPs. How do you sort a string array?
Don't do all that.
it is, GUIDs are editor only data
What's runtime unique, display name? there's gotta be something
I'm using FGUID for inventory but it's a totally different scenario
I'm pretttty sure they're not. I've used them as the keys on a map before
Maybe... World location? What are the odds they occupy the exact same space?
yes
They both have the hit
They have inverse normals right?
we are the hit
It's kind of a fun problem. Two identical objects hit. They know everything about each other, but they can't talk. They both have to pick the same one as the "winner"
Sign(HitNormal.Z)?
anyway I can stop these errors? its just a simple stop(sequence) node but its technically stopping sequences that aren't declared yet so it leads to errors, nothing is crashing but it is annoying
I just don't want the errors
then don't call stop
Just check if it's valid before you call
"accessed none" means a node is trying to get data that doesn't exist, like from an unset variable or w/e
***but its technically stopping sequences that aren't declared yet so it leads to errors, nothing is crashing but it is annoying
Yeah, use an IsValid node
.....why would you connect "is not valid" to anything lol
xD
IsValid node needs an input to check. You're checking if there's data there or not
ok slow
you have an animation sequence variable
rightclick that, and chose "convert to validated get"
then, replace the isValid you have with it, and only connect the isValid pin to the stop call
Also just in general connecting two exit pins from a macro to the same thing should raise alarm bells. There are very few good reasons to ever have a graph that looks like this
ok
wdym by that
@spark steppe Then could you explain plz ?
You've literally made this
it's really not hard to figure out, like really not (with a bit of effort, like a 20 second google search)
"The illusion... of control flow"
ok it took me more than 20 seconds
People wont have acess to any file or editor , I want people to be able to import things from there own pc from a fully build app.
So i need to use something like a factory, and import assets nodes ?
because the web is full of idiots who are too stupid to drag and drop an texture in the content browser...
long story short, theres a blueprint node for it
look kid I'm talking about a fully build app instead of trolling people just read properly
So there is like 20 nodes for "import assets things"
Some are requiring a reference to a "Factory"
ok now im out
This is not a matter of drag and drop wtf
Is there a way to get a reference to max int in a BP?
type a ton of 9s and it'll autoset it to maxint for the input field that you are typing in
Bro your literally trolling and insulting people on the internet you cant be surprised people get triggered
but there's no real reference other than that
eeeeeewww
@silk hinge i'm pretty aware of what you want to do, i just revoke my comment that its 20 seconds of google search because i was wrong
as it mostly shows stuff about how to import textures in the editor...
but whatever, kid is out, hope for someone else to answer your question
You still took time to troll me twice so I guess kid is okay x)
indeed
Anyway I'm there to lurn, not getting trolled.
There is many nodes indeed, I Just dont understand those who asked me for "Factory" "Asset Tools" references etc...
Hi, anyone knows how to change a float from double-precision to single-precision?
you dont
Cast? Not sure if possible in BP tho
this is for a healthbar widget
in unreal 4 it was working perfectly
but when I moved to ue5 it stopped working
have you tried creating a new bind?
but also iirc that was quite buggy for some time...
but hold up
how do I create a new bind, I'm really new to blueprints
not only that a bind is suboptimal, your implementation is probably the worst it can get
you shouldn't call get all actors of class each tick (which you do with a bind)
a better (but not ideal) solution would be to store a reference to your witch in the widget once, and use that reference
a good solution would be an event dispatcher on your WitchBP which your widget could subscribe to (so your text / statusbar only updates when the health changes)
nice, I'm going to try it, thanks! π
when u say to store a reference u mean to create a variable that is a reference of the witch?
that doesnt work
Is there a way to search for a comment throughout all my blueprints? I'm looking for stuff but i'm not sure at which blueprint it is
same error
yes
i highly recommend you to watch and try to understand those two videos
https://www.youtube.com/watch?v=ayCEqL7XFZY
https://www.youtube.com/watch?v=sEcoWGrF1Hg
okay
it's around 15mins total, but can and will save you a lot of time in the long run
thanks!
specially cpu time π
Like this? Something is still wrong, the sledge is still spinning.
I want to use force because I will put logs in it and I want the logs mass to influence the total mass.
you would add the input to your controller
e.g. player controller => add rotation
then on tick you use controller => control rotation as target reference
sorry for my brainfart, controller is correct
I am confused tbh
i had to doublecheck in unreal, sorry π
my entire life I was confused but now I reached a whole new level
I am so confused that I will react to my own statement of confusion
I think that the problem is about the double precision not the binding, yesterday I opened the project and it said single-precision today it changed to double, maybe its a bug
still thanks for the help
@warm glacier somehow like this i guess
don't take that solution for granted, it's mostly from memory π
even tho, it may auto turn to the control rotation, depending on how you set it up
that stuff is confusing, yes, because there's probably several ways to archive what you want
Ok the Mouse X thing doesn't work anymore now that I changed it
that may be different in your project
also check the details panel of your sledge pawn and search control rotation they should probably be all disabled
https://forums.unrealengine.com/t/unable-to-bind-doubleproperty/565425 found the solution if anyone has the same issue
next update they might break again
i guess they just forgot to change them to double precision, too
honestly, you should get rid of that binding... @dry lynx
and how do I make my camera to inherit controller rotation?
for now its a reference.. Im trying to understand the dispatchers
Hi im new, does anyone know a quick way to make my stamina bar change colour and stop letting me run when it hits 0 and goes up?
Like the security breach stamina bar, when it reaches the end it turns red and you cant run until it reaches 100
Does anyone know what's wrong with this?
I think I tried that too... maybe I can't do a line trace from a widget?
pretty sure you can
anyone?
Which node do I need to use when rotating a plane? Because I get the wrong nodes where the plane moves sideways or something. I want to move the plane in a 3D space
Is there any way to do some kind of "Curve Trace by channel" ? instead of Line traces ?
Yeah like instead of tracing a line,
Tracing a curve for a bullet in a game, kinda like Arma debug thing if you see what I mean
I found it, Add Relative Rotation
Ok there is one problem, I can't fly upside down
If I go straight up I don't do a "flip" it just points 90 up instead doing a flip π¦
.
Oh boi this is math i know how but bruh
Never tackled this myself but you'll want to look into quaternions. Unlike classic euler rotations, they don't have the "gimbal lock" issue when their pitch hits +/- 90Β°
Flight/space sims use quaternions, I've read
Have you thought about this even?
Then i need to use set world rotation right?
Is there a problem if I use simulating physics?
Gimbal lock is the crux of the issue regarding a vehicle flipping ...that's all I can say. Google from there
i'm a physics noob, so not sure
Ok so let me explain to you.
You have a minimal value, max value and a rate value.
Anything you multiply with "Delta Seconds" becomes "X number / second"
So if your min value is 0 and your max is 1000 and rate is 100 means you can sprint for 10s.
So you divide your rate 100 by delta seconds and you do this "on tick" node.
Then you can create a boolean that says "canSprint" to true if it's above 0 but if it's under 0 you set boolean to false
yeah guess what
It was physics
I'll have to use torque I believe
good afternoon
Assistance in implementation
I have a fly that moves using BT (moves to a random location)
How can I make it so that when moving it moves up and down
exclusively with the help of drawings
i suggest getting a flyswatter
is there any way to modify an actor's components and variables from the client completely clientside?
https://blueprintue.com/blueprint/qifwhf8a/
this event is from the player proxy but it seems as if these changes affect other players in game
oh you mean bullet drop and stuff? that can be done witha series of line traces or a projectile
Why is add relative rotation locked to 90 ?
Just so that I don't re-type this I just want to post this link here so I could hopefully get some help. Thanks. https://forums.unrealengine.com/t/upgradeable-ai-parking-lot/586089
Hello, I am trying to find out the best approach to what I want in my game. In my game you are a store manager, responsible for placing shelves and buying products for you or your workers to stock. One of the upgrades I want is for you to be able to upgrade the parking lot (Essentially increasing your stores capacity). Now, the parking lot w...
When I used UE4 I could freely move my text inside the canvas and in UE5 I can't why?
is it because you chose out-hit component instead of actor?
on UE5 widgets bps don't automatically have a canvas anymore
But it looks like it wraps my text in some sort of a box
I added a widget and also my touch controls stopped working nice
Can anyone help or am I stuck with this for a week now? π¦
When I uncheck the "add to Viewport" it works, I can fly around. When I connect "add to viewport" then I can click on the widget but I can't move my pawn
Why do I get 'accessed none trying to read' when I use remove from parent instead of remove all widgets (Doesn't show up when I use removeall)? Is this something that you'd need to see the BP for or am I just not using it right
You usually need to specify the InputMode. Somewhere central preferred. That can either be UI, Game or Game And UI.
Your case sounds like you want to set Game and UI
You get Accessed None warnings when you access a Null Pointer.
Or in BP terms an empty reference variable
Or pending kill fwiw
But I think then it actually says it's pending kill
Then it must be that I can't tell the difference remove all and remove from, any idea on how I would go about making it work?
Uff that looks horrible haha
The blue wires are for example interesting here
The ones that go out of the screen
Usually you have to keep track of the return value by saving it to a variable
If you have to keep track of more than one then it's also a case for a array
And then you can use that variable to call RemoveFromParent
Yeah that is a really really bad setup
It was previously removeall for each of those remove froms, but the one who made this didn't consider the UI that I would put in
E.g. you are calling RemoveFromParent on 4 different return values, where in the first case the other 3 aren't even existing yet
so if I were to do an extra branch on each to see if they exist it could work?
You should save them into each their own variable
Hi, thanks, will this also allow me to move and press buttons? Like for example in other mobile games?
And then check these variables for when they are valid (with IsValid) and only then call remove on them
Again the setup you have there is really tricky to patchwork like this
Mobile games use specific on screen constrols which UE has some special UI for. But you should be able to interact with UI too
Where can I fund the special UI?
E.g. your setup if the value is below 15 adds both widegts and tries to remove them again. You should rethink this whole part of your code. You won't get happy with this otherwise.
On tick with delays too
You mean this circle thing? yes all of this works until I use a widget
Probably cause your widget fully overlays the screen
And takes the touch input away
But how do I make it small then?
Idk what your widget is
Do I need to make the widget the size of the text?
But one option is to ensure that the visibility of that specific part of the Widget is hit test invisible
It shows only the speed of the air plane
Idk I added the TEXT and it made it so big
Yeah cause you have no parent widget that constraints the size
In UE4 when i dragged text into the canvas it was like a tiny element
Then wrap it with a canvas
Rightclick it and go to the wrap option and select canvas panel
this?
aa ok
Thanks π Did they change this or did I do something wrong?
Idk but if you didn't remove the canvas then they might have changed it so that newly created widget don't have a canvas panel anymore
Cause they aren't always needed.
Yeah, UE4 came with a canvas on new widget, UE5 does not
Could you give an example when?
I usually only have it in my main widget that I add to the viewport
Any nested widget I don't use them for
So you put a widget into a widget?
That's how it's meant to be done yes
You cut your UI in smaller reusable widgets and put them into each other
As opposed to having one giant widget
So like with classes? It extends/inherits ?
I thought one widget is better than multiple widgets
The design tres doesn't allow extending it in child classes. But you can put one widget into the other. A text is also just another widget
Na
There is obviously limits.
Think of it kinda like a shelf. Your main widget is the shelf system, all the other widgets you place onto the shelf
So I should separate them like "Airplane stats" "chat widget" "buttons controlls" etc?
Yes
But I will still show them all :x
I mean I understand "Inventory" etc
You also have a character with multiple components :P
Because inventory is like a window that opens
And not a character with everything in it
It's not about opening and closing
It's about makingg sure your code is designed in a way that Objects handle themselves
multiple components? I have a Base pawn and then i inherit from it to make like JET and Bomber planes
OH so it's like convenience and not like a performance thing?
A ye i know this from webdesign π You create modules or components
So like Facebook is done in React and it's split into components
React uses the same sort of widget-like setup
Where you split your UI into self contained and reusable components
One widget might be your whole HUD. But the elements inside or widgets themselces
E.g. a timer
A health ar
Bar*
A weapon selection
Ammo counter
Capture the flag indicator
And what not
Crosshair
You make single userwidgets for them and code their logic there. And then you add them to the bigger HUD widget
Keeps things clean and easily extendable
And those single userwidgets might have other userwidgets in them again. Depends on the specific case
Can I also make a widget some sort of a "template"? so if I have like a flag indicator and split it into A B C bases so it displays A B C
Widgets can have variables exposed on spawn for when you create the runtime, but also instance editable so the variables will show up in the details panel
So you can make one widget and give it a text variable that you use for the text
Add it 3 times to the HUD and give it 3 different texts
You do have to somehow hook up the widget instance with which flag it represense but that's a different story
That's usually what you do with custom buttons
Where you have a fancy custom button user widget with a text and other variables exposed
So something like if you click on an item in your inventory and it shows stats etc?
And you can use Event Dispatchers to forward the button press event etc
Yeah for example
Or a buff icon with cooldown
Where you add it runtime when you get buffed and the text shows the time remaining and the icon behind it of that buff
So a WB_Buff in a WB_BuffRow widget where the BuffRow takes care of creating and adding the buff widgets to itself and you place the BuffRow onto your HUD where you need it
I will head to bed now though (: I'm sure you'll get behind the best usecases for splitting your UI into multiple widgets
Ok, good night, it helped a lot, Thanks π
alright, before i get started- I AM NEW
so i want to check to see if you are hitting a coin, and if you are, it adds up. i already tried testing to see if the collision is being triggered or wtv (by putting a print string after true) and it didnt do anything. idk if im using the right out hit hit something or another, and yes the player does collide with the coin (if you were wondering)
does the coin react to a visibility channel?}
wdym?
in your collision
the sphere trace?
there are no collision checks or anything in the coin
SORRY I AM LITERALLY CLUELESS LMFAO
no, but your coin needs collision
does the collision react to visibility as well as your other things like the player
i think so
check
idk what u mean when you say that it can react to visibility
oh nvm i see it
in the collision presets
ye
yeah it is overlap all
needs to be block all
i j tried that a sec ago
a trace only hits blocking objects
you could try checking when it overlaps with a collision sphere or the player's collision perhaps?
the coin has a collision sphere and it is block all so i dont know why the players sphere trace isnt detecting it
set coin to overlap all, then OnActorBeginOverlap on your player check if it overlaps
if it does voila
whats the setup for your sphere trace look like
is the node just called onactorbeginoverlap?
its an event
you just want one that checks if you have overlapped the coin
whether that be specific to the capsule collision or actorbeginoverlap it doesnt really matter
ok so in this check am i doing it in the player event graph or the coin's
you could do either
chekc in the coin if the player overlaps
but it would be better in the player likely
@thin panther traces do not only hit blocks however a block will stop the trace from hitting anything else
oh is that so?
in that case its probably blocking on the ground first
i thought it was only the multi that reacted to overlaps
Overlap let's you use multi trace and check through walls etc..
Regular should too, but it only returns the first one so it doesn't matter
alr would this be right
its possible the sphere trace is reacting to the ground or player then
i have no idea
there is a node for overlapping
yes
also you dont need to do the set afterwarss
afterwards*
its not harmful but it is redundant
the little diamond connection means by reference, so you directly modify the variable rather than a copy
ohh ok
so you are doing
coins = coins + 1;
coins = coins;
show the collision setup for the coin
so if that isnt on overlap it wont overlap the player
alr i tried overlap and it still did nothing
show again
and the player bp
there isnt actually like
any collision stuff
on the player
now that i think about it
that may be a little bit of an issue
theres a collision cylinder
show it
scroll down on that capsule and click the plus on begin overlap
alr
should i just make a collision sphere on the head?
that is where the sphere trace is
uh oh i think ue crashed
nah wtf
its not letting me minimize it
and i tried win d and the lil button at the bottom right of my monitor
ok i restarted it and did the begin overlap for the collision sphere on his head
@thin panther
this doesnt work
print a string on cast failed
also how do you know it isnt working
you arent showing the variable anywhere
ok that worked
so the cast is failing?
yes the cast is failing when i collide with anything besides the coin
which is good
then its working
wait im gonna try smt rq
this is the text
for the hud
that shoiws you
how many coins you have
ok?
well you said this
I've got what I'm sure is a very simple problem, but it's been stuck as an issue for a long time now: I'm simply trying to move components of a blueprint after rotating a valve. Valve works fine, it will do everything except move those components. Anyone able to clue me as to why I can't get it to work?
OH SHIT IK THE ISSUE NOW
IT DOESNT MOVE WITH THE COIN
I HAVE TO MAKE THE SPHERE A CHILD OF THE MESH
i got it to work
!
Caps is bad mmm'kay
Okay getting an "Accessed None trying to read return value" error on this SpawnActor node.
Weird part is that the actor does spawn in game and the array shows that it was populated.
Ideas?
Hell even dragging off the return value and doing an is-valid returns true.
Are you sure it's the spawn node returning an invalid ref? Not one of the inputs in to the spawn node?
No other node even has Pawn in the name.
Yeah misunderstood when it was telling me the problematic node was the SpawnActor itself.
Oddly, the transform works even without controlled pawn.
SpawnActor has the error, but it's caused by get pawn!
Transform on a null actor would just be a default transform
0,0,0 0,0,0 1,1,1
That would make sense.
Yeah giving it a make transform with default values seems to clear the error so I think you're right.
Good catch, thanks
nP
@mental trellis sorry to bother, I've just got what I assume is incorrect casting? Any chance you could have a look?
Thats my guess. Where are you setting the water rise actor ref
I'm not sure, but MoveComponentTo might be a node you need to keep calling every tick until it's done (or use a timeline)
I really have no idea, sorry.
However.
Nah it runs itself
If you just want the plank to raise with the water
Just parent the plank to the water.
It's just an actor variable I made to put on the cast to since it needs something there
not using it anywhere else
So it's empty
nope
apologies for my lack of knowledge
Couldn't find a video that simply shows how to move a blueprint with another blueprint
so I can't seem to search for the right things either
Casting is changing the level of classification of a variable. You are an object("actor" in unreal), organic, human, a race, a gender, an individual. varying information applies to each of these classifications. The concept of death applies to all organic things. The concept of your house only applies to you the individual. The level of classification determines the available information. If I have an object type reference to you, I can access object(actor) level information (such as location). If I cast to the organic level, and if you are organic, then the cast will succeed and I can get that organic level information.
Okay, so, you have a base class in UE, it's called Object. Everything is a subclass of Object. When you subclass an object, you add stuff onto it and make a new class (or blueprint.) So everything in the base class is there plus your new stuff. You do that again and you get another load of new shit in your third class.
Its okay we all start out somewhere.
i also like to think of a cast like a type check, it takes a general actor reference and makes sure its the specific thing we need
Because, let's say, your blueprint (I'll do it SeaBP for now) is based on Actor and Actor is based on Object, you can use variables of type Object or Actor to store that copy of your SeaBP
like okay, i cant tell its an actor, but what we need is a house, so is this referencing a house
thats a cast
But if you have a variable of type Actor and you want to see if you've stored a SeaBP in there, you cast it to the subclass and see if it works.
But it could, in theory, be any other type of actor or subclass of actor.
Unless you need to move up and down the hierarchy like that, you don't need to use Cast
I thought casting was just allowing variables or other things from one blueprint to be used in another
Nope.
Casting changes the type that the program sees your variable as - if it's not compatible with the type you suggest, it will fail.
I have a weird movement bug, not sure if it's because of touch (mobile) or if it's just UE doing this.
So I have a Airplane and when I move left or right (add local rotation) the plane doesn't really move just left but it has some weird slight rotation to it
Rotation doesn't move something. It rotates it.
I fly the plane left and right so I move the plane forward and turn with it so it's not just rotation but movement smartass
That doesn't mean shit if your movement isn't based on your plane's rotation.
Now now children
Which axis are you rotating around? Yaw, pitch or roll?
I suspect this is where the idea of "cast to use a blueprint in another blueprint" comes from.
If the cast succeeds then that means the object you're plugging in is of that type or a class derived from that type.
Basically you can use the functionality and variables of the class you're casting it against. Which is why the output pin from the cast allows you to call said functionality.
Z Yaw
You have grasped casting 100% successfully.
And how do you move your plane?
yes i commonly see people being confused when they dont know what to plug into the object of a cast, and get confused when we say that you already need to have a reference to the object to cast it
Hey everyone my apologies for jumping in here, scratching my head on this one wonder if anyone can give me some help. I have a class that is attaching the skeletal mesh to my first person arms. This is working fine on a server/host but the client has the wrong rotation. I had set it to snap target to fix this on the host (orignally had this issue on the server too) but snap target does not seem to be working for the client. Any ideas?
i remember those days, casting confused the hell out of me until i learned oop independently
There's a thing to note here too; if the object you're casting is a child of the class you're casting against, example here would be a character object tested against a pawn cast, it will still succeed because a character (being a child of pawn) will contain everything the pawn has. You'll only have access to the stuff in pawn though, because the cast doesn't know if you're pawn or something derived from pawn.
So what would I need to do to to make the objects in one blueprint be able to move after something happens in another? Can't really visualise it from the explanation
Having my entire understanding of something I thought I was sure of change only makes it more frustrating π
A lot of people seem to think that casting is will search out an object from the game and just use it somehow.
yeah i did too when i was a newbie jumping in without trying to learn it
Oh damn, thanks for the help... not
Why are you changing the owner?
but in hindsight it seems really dumb when you learn, because how would the game know what you want if theres more than one
Im setting the owner. Seting the weapon to be owned by the player
I think it's a really key question in your plane not moving correctly, to be fair
cant have a magic solution, you kind need to show some code
if the movement isnt working, how can we diagnose without knowing how you made your plane move
its like trying to get the doctor to give you medication for your problem without ever talking to him
I'm more questioning why it isn't already owned by the player.
I saw a lot of really bad misconceptions when I was at University because most people were going in as designers or very high-level scripting rather than computer scientists. The lessons never focused on programming principles either so I think everyone took a "if it does what I want it to at a surface level then that's good enough" approach.
Because it was just spawned by the server
I found the issue but don't know how to solve it, so my plane has a spring arm and a camera, I have the camera little above my plane so it looks cooler. But it actually causes the plane to fly weirdly and adds some rotation. I don't understand how to fix that
yeah my course that used unreal engine in college only really covered principles at the end of the second year, which was a bit late when we had spent a year in the engine
Lucky you actually getting taught principles haha
i think its very important to learn programming for this stuff, because ti really helps with the abstraction and decomposition of problems
That said, its always fun teaching people what the different design patterns are and how to use them.
When you spawn stuff, you can set the owner on the spawn parameters, I'm pretty sure
Like their eyes have suddenly been opened to much easier ways of doing things
i say taught, the teacher did nothing all lesson and we had to get our assignment altered the week before handin, basically we got pity grades and the teacher was let go
my uni is much much different tho
10/10#
Lol
ignoring my hilariously awkward stumbling through the engine right now, that's a design issue more than anything
oh yeah thats what it was like for me, i swear it was like opening a 3rd eye
suppose you are correct, not sure that would solve my issue though? im not sure XD
nto even having to touch a tutorial in ages
Might do. Who knows the gremlins you might encounter with replication.
Ouch. I had a tutor like that, first time any of us used C++ and the guy had literally no idea how to program in it so we all pretty much self-taught the language.
Before I try, from first person character can I make normal objects in a level move? It sounds like it'd be much easier than faffing around with multiple blueprints
It migth skip our replicating something because of race conditions.
im now imaging that replication is done by tiny flying gremlins from server to client
hmm ill give it a go, got nothing too lose
thank you for that
What do you mean by "normal object" exactly? An actor?
yeah i self taught myself c++ throughout that time
although it did help for uni
In computer networking, IP over Avian Carriers (IPoAC) is a proposal to carry Internet Protocol (IP) traffic by birds such as homing pigeons. IP over Avian Carriers was initially described in RFC 1149 issued by the Internet Engineering Task Force (IETF), written by D. Waitzman, and released on April 1, 1990. It is one of several April Fools' D...
static mesh actor
Found the solution, not sure how many bugs it caused but for now it will do
that did not work sadly π¦
From what I thought I was aware it would just be casting to level blueprint in order to be able to refer to those objects
I got surprisingly good grades on that assignment, interestingly enough. And I have done C++ projects before, I just use Blueprints for the prototyping first.
What was it? Not using your plane's forward vector?
is that legit, i feel like im being really gullible xD
Can you even cast to a level bp? Those things are like in a zone of their own.
It's legit, brother.
you cannot cast to a level bp
"Unintentional encapsulation in hawks has been known to occur, with decapsulation being messy and the packets mangled."
oh my god
Oh right, forgot you couldn't, tried that earlier today
this is amazing
I have a problem with the blueprint that was left on the map, although it is removed in the files, so the game crashes and I can't do anything, any ideas?
In that case, are you simply able to cast to a static mesh actor from a blueprint that isn't level blueprint
Are you unable to select it? (to delete it)
if your bp needs to move its better off in an actor class
a static mesh is exatly that
a ....static... mesh
unless its something like picking stuff up with physics
like grabbing an item
I can click on it, but there are no options
if its something more general, like a moving platform
Static Mesh = geometry/model. Static Mesh Component = renders said static mesh. Static Mesh Actor = houses that component in the world.
Delete key?
god its like Blueprints, Blueprints and blueprints
one being a laguage, one being interchangable with actor and the otehr being used by construction workers
The "static" part of the static mesh means the mesh itself is static, not that its actor is. I.e. It has no moving parts, it's not a skeletal mesh, etc.
It doesn't work
a lot of things that need to move are better off in actors
as they tend to be reusable
and encapsulation etc etc
Try selecting multiple actors with your broken one and deleting them all?
Nothing in a level isn't inside an actor. Except actors themselves.
again my bad on not being more specific
it should be in your own custom subclass of actor
e.g. subclassing an actor for a moving platform
for reusability
the terminology is like walking on eggshells π
So why doesn't this bp set work?
all because I used an actor variable to fill the cast object?
debug output?
can never get enough print strings
Pring strings
ah
Are you sure your plank isn't starting at the coordinates you've given?
If it's already there, it won't move.
Change your variable type to be the correct type and you won't have to cast.
How do I cancel this out? The second connection doesn't restore movement to my character
You mean like doing a .5sec line trace and then doing another with another angle something like that ?
self is a player controller right?
yes
So what is the problem, exactly?
Does the second bit even trigger?
Have you added a breakpoint to check?
Or a debug string?
So the key press doesn't work?
it does, but then the release doesn't even work -_-
Probably because the key press is part of the game input mode
So making it UI only, you're disabling your input binds.
I see
You're right. So how would you do the same thing? Just disable input on the player's mesh?
I liked how it stopped the player moving before
If I want to get static mesh components stored in a different blueprint to reference in another bp, what do I put in the cast to so it succeeds?
that different bp
Set input made to game and ui and set an additional bool to false (enable player controls - check on every input)
cast to the other bp -> get the mesh
Or just let people move their characters while in the menu (unless it's a full screen menu)
i do like being able to move and edit inv ngl
It'll only allow me to get the entire bp when choosing the object, I can only refer to the water and plank I need on 'as BP'
Ok
So get the full bp
Then get the mesh reference
You cant cast to the component
You could get the nth component from the base actor reference and cast that.
(just to be pedantic)
Cant beat being pedantic
Technically correct is the best kind of correct.
Of course
nth component?
1st, 2nd, 3rd, ..., nth
Line trace per tick
n represents any number.
Oh I did not know this node thanks
Velocity = Velocity + Acceleration * DeltaSeconds
NextPosition = Position + Velocity * DeltaSeconds
Trace from Position to NextPosition, process hit if it happened
Position = NextPosition
suvat all over again
Aha but what if n is 1
Ya cant have a 1th anything
or the 2th thing...
You're missing a * DeltaSeconds when adding the acceleration
3th?
should be nst/nd/rd/th
I will definitly write that to remember thanks
What would I set as target?
Whatever you want, however you want to get the BP_Water_rise
line trace, get actor of class, already have the ref, whatever
Again you are fundamnetally misunderstanding casts
Yes I'm sure I am
Bruh I have to say that almost every day.
You need a ref to BP_water_rise, then you cast to it, then you can access its components
@serene pike this isn't a class problem, this is a composition problem.
You can't cast an object to get a part of that object.
Since water and plank arent bp water rise, nor are they the parent of it, they cannot be used to cast to it
You have to cast the object and then get what you want from it.
Tutorials just seem to show a way of using things without explaining, and I took the word from college tutors as being what it is so years of belief is wrong
Hence my name
If these nodes were the opposite way around, it would work.
Cast on the left, those nodes on the right.
Yeah that's what had me mention it
I've no idea where to properly get the information
what are you trying to do again?
Tutorials on object oriented programming and polymorphism is what you want.
Yes learning oop here is what you need
I can't cast to plank or water though, so how would I mention the static mesh components in the first place
also what is the point of the sequence node? Over just chaining things together
Learning the principles of the type of programming the engine uses is essential to using the engine
@serene pikeCasting is a question. It's checking if a thing of one type is another type.
Say you had a line trace. It hit something. All you'd know is that you hit an Actor. What if you wanted to know if you hit a door or a pawn or a tree or a wall? You would cast the ACTOR to the specific subclass you want.
Thats why i disagree with the allure of "make games without code"
Ghettoprints
Say you have an Animal. You want to make it bark. Well, only Dogs bark. So you'd cast the Animal to Dog to see if it's a dog, and if it is, then you can do Dog stuff with it.
I always wondered why a linetrace or collision event can't just return the correct type right away
From that analogy all I get is that I need to cast to the bp itself π
You have an Actor. You want to do BP_Water_rise stuff with it. You cast it to BP_Water_rise to check if it even is one of those, and if it is, you can do BP_Water_rise stuff with it.
Yes because thats what you need to do
Instead it just goes "lul I hit actor cast it now bozo"
The fact is, you have to start with the Animal in the first place or you can't do anything.
Because it has to return something of a type.
all you're guaranteed is that it's an Actor
Okay, then return the right type right away
It's not like the engine doesn't know anyways
Assuming I'm using the correct technical terms then: how do I move statich mesh components in one blueprint using a different blueprint?
I mean you could return the type in the trace, but then you're just moving the cast to the trace side of things and now all your traces are doing all this extra work.
When you very often don't care what type it is.
Cast to the blueprint then get the components, and move them
What I don't get is why if a linetrace happens the hit result just has a pointer to that actor but isn't smart enough to auto-cast it to the correct type
99% of the times the first thing you do on a hitresult is try to cast it to something
it's something like it always needs to cast, and it not casting by default is it giving you the option for cases in which you wouldn't need to. Line tracing on animation timing for foot step sounds, for an example of when you don't need it
Gameplay-wise, what are you trying to do
I do up to 2,000 traces per tick and casting is not a thing for any of them.
Rotate a valve (works) to make water and a plank move upwards
In my case, I just care about the distance
This is correct, but you're missing a step. You have to start with something to cast. A variable that has been assigned a value.
Break it up. Don't directly rotate the valve. Have some timeline that gets played based on an Activate event.
Your very specific situation isn't the point here
are they all just for distance? I know it's just a query, but isn't the overhead on 2k somewhat high?
There is zero reason a node like GetActorType doesn't exist
Nah Unreals collision system is pretty robust. It's for line of sight calculations.
I also do it in a tight loop and not spread out over thousands of actors.
I know line traces are somewhat free, but I never guessed more than hundreds per tick was free
and in C++. In BP it was over 100x slower, and it was all in the math. The trace was just as fast.
the reason is that it would need to cast in order to get the type, probably
What would this change though? Everything works fine up until when I try to refer to the water rise bp to move the other objects.
2k is a worst case scenario, it varies a lot throughout gameplay. Also, the scene they're tracing against is all in 2d so I'm assuming there's a lot of octree pruning happening.
Pretty sure the engine knows what the underlying type is
yeah but if it was set up to communicate that value, then it would do so
How do you want to GET the water BP?
Why wouldn't it be though, again @solar sequoia
Just all the time, with a line trace (interaction style), with some overlap, what?
Just took a step back from that
Because it's a generic node and the output needs a specific type. That's how BP works.
BP is shit like that.
What is the SPECIFIC gameplay thing you're doing. Tell the story, the player does what, and what happens?
No dynamic typing.
Even c++ is strictly typed, though, it's just more flexible.
Player linetrace hits the valve, that triggers the valve to rotate, I want a nearby block of water and the plank on top of it to rise up
ok so
Line Trace -> cast hit actor to your valve class -> call some event on it
wait does something like auto treeactor = cast<auto>(ActorPointer*) exist @mental trellis ?
No
Or is that voodoo dark sorcery
That sort of shit is the purview of scripting languages
is that a level BP kind of thing, or is that too restrictive?
I see now it knows about the valve because of the linetrace, but I can't think of how to mention the other
you can reference instanced actors to call custom events. Would probably make your life easier in this case
Still, the engine knows about that pointer and all it's properties so technically it could exist
True
I've got an event in bp rise but I'm blank on how to refer to it in any way
That's why interpretted languages like php can do that.
Wait tho if I'm referencing a pointer to some actor in the world (when casting to it) the cast has to happen after the actor exists
ergo the engine would know about it at runtine wouldn't it?
But that's irrelevant.
you need a reference to an instance of the BP that the red event node is placed in
It's the node that does the casting. The node is created at compile time.
something like "give me the type of that actor, which I know is in the world because I spawned it earlier or whatever"
you can do it in your level bp @serene pike . Probably the best way if you only need it for that level
That's just not how computers work. They can't intuit the demands of the user.
I just told you
you said you're doing a line trace
do the line trace, cast the HIT ACTOR to BP WATER WHATEVER
@serene pike Easiest way is an Actor reference var in the Valve for the other BP, drag and drop the specific instance of that object that exists in the world as a reference
that's your test for "did I just hit the valve thingy?"
I'm literally telling the computer to give me some information he has to know at runtime, otherwise the actor wouldn't exist
No guesswork involved
How many conversations are happening right now lol
It's 2:30am I'm dropping this semantics lol just help the water valve guy
You cannot set a default value for actor refs as their memory location changes
If the thing doesn't exist, on spawn = set reference
I believe that his or her case is more like the valve triggers an event in a different actor
@serene pike For an actual scenario of this, check out the 'Content Examples' that UE provides
I can go through it with you in voice if you want
@serene pike if you accept my friend rq i can teach you a bit about casting with diagrams and stuff, i dont wanna flood the chat
That'd be awesome, thanks.
So character linetraces to the valve. If hit result is good, cast to bp_valve and call an event "rotate and activate" inside the valve. This event uses a reference to the water inside it and sets the height of said water @serene pike
You need an object reference for the water in your valve bp btw
i think its better in the present moment to teach how casting works rather than solve the problem directly
because this is a fundamental concpet
and without knowing it will just happen again in 5m
@wintry geyser just hopped in parlor
but yeah some oop practice could help
any ideas?
casting used to confuse the shit out of me as well. Helps to know ways to get a reference tho, like a trace for instance.
People over-explaining shit is all. lol
That's exactly what I was thinking when reading through this
well yea but casting from a button to a lamp for instance that does something can be quite confusing for people. Cause how will the button get the reference to the lamp?
Casting = try to treat something as one particular class
and then people are like ''casting bad use bpi'' and they get even more confused lol
Pedantic guys can cringe all they want
By creating a reference variable to Object 2 inside of your successfully interacted Object 1 , then set that reference by public pointing to it, or any method you want really.
yea once I figured out you can make variables public and manually put shit in there from the editor my mind was blown lol
For real. Seriously don't skip Content Examples.
In some cases, yeah.
from what ive gathered as long as you dont do it on tick its alright? I have no idea I barely cast anymore. bpi's are so usefull lol
Casting something already in memory is practically harmless, really.
@icy dragon yup
like if you made it a variable? oh alright
Yeah, didn't we already prove that the cpu cost is negligible, and the thing you really need to worry about is AMOUNT of different actors/components, so it mostly can be memory intensive.
Sanity check - shouldn't Attach Actor To Component lock the actor to follow the components location?
Also, you don't need to cast if your public var is lean to the specific class you're calling. If your reference var is just 'Actor' then yeah you'd cast and have that reference be the Object input.
Example: If I interact with a light switch and want it to turn on a light that exists in the map, I just set the light as an object reference of that specific actor directly in the 'light' public var and call an event off of it, no casting necessary.
Like this
@blissful graildid you set snap to target?
can I see the whole BP?
@wintry geyseroh thats sick I didnt even know that
It works as expected if I do actor to actor though. But for w/e reason, attaching to the component is not
then do actor to actor? π