#blueprint

402296 messages Β· Page 930 of 403

astral epoch
#

So say a squad of 25 characters walks into view, that's gonna trigger 26 times.

solar sequoia
#

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

astral epoch
#

Huh, didn't think of that.

#

So I just need to tie an interface to the squads for it to register?

limber parcel
#

how would i actually reshape the collision things? so far i only figured out how to move and delete them

solar sequoia
limber parcel
solar sequoia
#

or you can press w/e/r to toggle through them

limber parcel
#

but none of them lets me move the vertices

solar sequoia
limber parcel
#

deform?

solar sequoia
#

collision data is a bunch of individual shapes. Just modify those shapes to fit how you need

limber parcel
#

i added a simple capsule collision now and adjusted it to fit the tree

solar sequoia
#

looks good to me

spark steppe
#

you can't manipulate the form of a convex collision

spark steppe
#

if you want to do this, you have to make your own collision mesh in blender or similar

gentle fog
#

How can I react to physics overlap event in my blueprint? It seems that none of the events are available (Static Mesh Component)?

limber parcel
#

search for event start overlap

#

or check the overrides

gentle fog
#

does not exist

spark steppe
gentle fog
#

End Play is the only override I can find

spark steppe
#

onComponentBeginOverlap

gentle fog
spark steppe
#

right click the component in the hierarchy

#

in the contextmenu theres an option to add events specifically for that component

gentle fog
#

(sorry im noob)

spark steppe
#

that's an instance, not the blueprint....

gentle fog
#

ah

lofty hound
#

I see, so if I multiply by -1 and then add 50 to that will it move backwards by 50?

gentle fog
#

well I can't find the hierarchy on the blueprint

spark steppe
#

top left usually

#

components list

gentle fog
spark steppe
#

in main menu, window => components

gentle fog
spark steppe
#

why are you like this?

#

click the window in main menue while you have opened the blueprint

gentle fog
#

like what? I can't find it...

spark steppe
#

wait

solar sequoia
spark steppe
#

sorry

gentle fog
#

If you mean the window with the viewport, it also does not have anything about components

spark steppe
#

what the heck is that blueprint

#

what is the parent class? it shows on top right corner

lofty hound
solar sequoia
gentle fog
#

It says "Static Mesh Component"

solar sequoia
spark steppe
#

do you want to make your own static mesh component class?

brazen crystal
#

Can anyone help find out why my break vector and break rotators aren't working...?

spark steppe
#

or do you rather want an actor with a static mesh?

astral epoch
#

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?

gentle fog
#

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

brazen crystal
solar sequoia
astral epoch
spark steppe
#

thats bullshit πŸ˜„

#

you dont want to make a whole city in one blueprint

solar sequoia
brazen crystal
gentle fog
#

indeed I don't want to do that. So I'm guessing actor is the way?

spark steppe
#

yes

gentle fog
#

Alright, thanks a lot! πŸ™‚

solar sequoia
# brazen crystal

it shouldn't give accessed none if it's a float. Are you setting and that's invalid or something?

astral epoch
#

And its going to be doing it a lot

solar sequoia
astral epoch
#

Hmm, might need to look into that.

brazen crystal
solar sequoia
#

so tick fires immediately, and it's probably racing your widget creation

brazen crystal
#

Even though the Input vector seems to have the correct value?

#

(1st sc)

solar sequoia
#

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

brazen crystal
#

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.

solar sequoia
brazen crystal
#

Also, further complicating things, this is for a VR game, so some objects just aren't created, like the hands

solar sequoia
#

I won't even pretend to know anything about VR

brazen crystal
#

I mean I just started doing this unreal stuff 1 day ago haha

tawdry surge
#

You have prior experience with programming?

brazen crystal
#

Yeah, courses of java at uni

paper galleon
#

Hmmm..

brazen crystal
#

1st year was pretty much just the basics, and this year we went upto javafx, database control, serialisation etc

#

you know, typical uni crap

tawdry surge
#

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

silk hinge
#

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

spark steppe
#

yes, there is a way

unborn maple
#

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

icy dragon
unborn maple
#

im getting all the actors in the arry , getting the length and then destroying them using a interface event

icy dragon
unborn maple
#

thanks makoto it work deleting the weapon first

snow hatch
#

is it possible to recreate the farming system from Farming Simulator using blueprints? I'm interested in doing the planting, fertilizing and harvesting

foggy dew
snow hatch
#

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

foggy dew
vapid grotto
#

does any one has idea how to work with camera post processiong setting relating to DOF control in character BP. ?

snow hatch
#

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?

foggy dew
# snow hatch can I make it so the vehicle paints a different terrain texture over certain typ...

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

snow hatch
#

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.

faint pasture
#

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

snow hatch
#

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?

dry lynx
#

Hi, does anyone know how to change a float from double-precision to single-precision?

faint pasture
#

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

flat coral
#

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

mental trellis
#

You want to find its subclasses or its parent classes?

faint pasture
#

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.

flat coral
#

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

faint pasture
mental trellis
#

Well, I'd use the API.

#

Yeah.

flat coral
#

ugghhh docs

mental trellis
#

If you have chrome, I have an amazing ide chrome extension too.

flat coral
#

I just realized for the first time in like a decade I don't have any IDE installed anyways

flat coral
icy dragon
#

The real docs are pretty much the source code itself.

flat coral
#

Yeah so.... the statement "you can cruise the docs" is not entirely accurate

icy dragon
flat coral
#

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

icy dragon
#

||apparently it's based on bing||

flat coral
#

Yikes.

#

Like if I wanted to know something like "what's the original class that declares OnComponentHit" the search gets me nowhere

mental trellis
#

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.

flat coral
icy dragon
#

The turn tables when you search with Google.

#

Most of the time the first result is the typename you want

flat coral
#

Yeah I might just end up having a site:docs.unrealengine.com/* bookmark like I do with reddit

mental trellis
icy dragon
#

Also credit where credit is due, the docs for C++ API tells what module it comes from and what to include

mental trellis
#

site: even better

flat coral
#

What's the difference between inurl and site anyways?

mental trellis
#

inurl can be anywhere in the url.

#

I'm assuming site tests the host

flat coral
#

God nothing about BPs quite bugs me like the lack of generics. I could do such clever shit.

lone arch
#

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?

faint pasture
#

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

lone arch
#

ok got it i will try this

lapis saddle
#

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.

silk hinge
#

@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 ? πŸ™‚

spark steppe
#

yes i could

warm glacier
spark steppe
#

well you "delay" the camera vehicle rotation

#

so it lags behind the actual vehicle camera rotation

warm glacier
#

how to do it then?

spark steppe
#

what's your goal?

warm glacier
#

I want to add some delay to the mesh when I rotate it to the forward vector of the camera.

faint pasture
#

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

spark steppe
#

yea why does camera rotation drive your vehicle rotation?

faint pasture
warm glacier
#

I actually want to do it more like in The Forest

spark steppe
#

yea but it should drive the vehicle

#

the camera should rotate with the vehicle

faint pasture
spark steppe
#

and/or you have to limit the camera rotation

#

so that it can't drift to far off the vehicle rotation

warm glacier
# faint pasture Show a clip of what you're trying to achieve

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/...

β–Ά Play video
spark steppe
#

do they use chaos physics? πŸ˜„

faint pasture
spark steppe
#

isn't the sledge a pawn anyways?

warm glacier
#

it is

spark steppe
#

posses it when the player interacts with it, so you can have your own control logic on the sledge

warm glacier
#

I already did that

#

magically I could do that without errors

spark steppe
#

πŸ˜„

#

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

warm glacier
#

Ok I will process this and come back probably earlier than you think

flat coral
#

What's the cleanest way to figure out which of two GUIDs is larger? I promise this isn't as stupid as it sounds.

flat coral
#

I know they've got a ToString but I can't figure out how to compare strings

flat coral
faint pasture
#

You have 4 ints

#

go nuts

flat coral
#

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.

faint pasture
flat coral
#

Well, it is insofar as I'm doing this with blueprints lol

faint pasture
#

Are your only conversion options to string?

flat coral
#

Looks like it. No break node either.

faint pasture
flat coral
#

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?

spark steppe
faint pasture
#

What's runtime unique, display name? there's gotta be something

#

I'm using FGUID for inventory but it's a totally different scenario

flat coral
tight schooner
#

Maybe... World location? What are the odds they occupy the exact same space?

spark steppe
#

yes

faint pasture
#

Or hit normal

#

you got the hit right?

flat coral
#

They both have the hit

faint pasture
#

They have inverse normals right?

spark steppe
#

we are the hit

flat coral
#

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"

faint pasture
#

Sign(HitNormal.Z)?

junior hedge
#

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

spark steppe
#

then don't call stop

flat coral
spark steppe
#

or maybe make an isValid check before

#

both valid options

tight schooner
#

"accessed none" means a node is trying to get data that doesn't exist, like from an unset variable or w/e

junior hedge
tight schooner
#

Yeah, use an IsValid node

junior hedge
#

like this?

#

or after it

flat coral
#

.....why would you connect "is not valid" to anything lol

spark steppe
#

xD

tight schooner
#

IsValid node needs an input to check. You're checking if there's data there or not

spark steppe
#

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

flat coral
# junior hedge

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

junior hedge
#

ok

junior hedge
silk hinge
#

@spark steppe Then could you explain plz ?

flat coral
spark steppe
flat coral
#

"The illusion... of control flow"

spark steppe
#

ok it took me more than 20 seconds

silk hinge
#

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 ?

spark steppe
#

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

silk hinge
#

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"

spark steppe
#

ok now im out

silk hinge
#

This is not a matter of drag and drop wtf

spark steppe
#

i was about to hand you the link to the docs, but whatever

#

go on

flat coral
#

Is there a way to get a reference to max int in a BP?

spark steppe
#

type a ton of 9s and it'll autoset it to maxint for the input field that you are typing in

silk hinge
#

Bro your literally trolling and insulting people on the internet you cant be surprised people get triggered

spark steppe
#

but there's no real reference other than that

flat coral
#

eeeeeewww

spark steppe
#

@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

silk hinge
#

You still took time to troll me twice so I guess kid is okay x)

spark steppe
#

indeed

silk hinge
#

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...

dry lynx
#

Hi, anyone knows how to change a float from double-precision to single-precision?

faint pasture
dry lynx
#

this is for a healthbar widget

#

in unreal 4 it was working perfectly

#

but when I moved to ue5 it stopped working

spark steppe
#

have you tried creating a new bind?

#

but also iirc that was quite buggy for some time...

#

but hold up

dry lynx
#

how do I create a new bind, I'm really new to blueprints

spark steppe
#

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)

dry lynx
#

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

jolly surge
#

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

dry lynx
#

same error

dry lynx
#

okay

spark steppe
#

it's around 15mins total, but can and will save you a lot of time in the long run

dry lynx
#

thanks!

spark steppe
#

specially cpu time πŸ˜„

warm glacier
spark steppe
#

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

warm glacier
#

I am confused tbh

spark steppe
#

i had to doublecheck in unreal, sorry πŸ˜„

warm glacier
#

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

dry lynx
#

still thanks for the help

spark steppe
#

@warm glacier somehow like this i guess

#

don't take that solution for granted, it's mostly from memory πŸ˜„

warm glacier
#

oh so I set the whole actor rotation

#

that makes sense

spark steppe
#

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

warm glacier
#

Ok the Mouse X thing doesn't work anymore now that I changed it

spark steppe
#

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

dry lynx
spark steppe
#

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

warm glacier
#

and how do I make my camera to inherit controller rotation?

dry lynx
outer elbow
#

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

fleet cedar
#

Does anyone know what's wrong with this?

spark steppe
#

there's a get hit result under cursor node

#

maybe that works for your usecase?

fleet cedar
#

I think I tried that too... maybe I can't do a line trace from a widget?

spark steppe
#

pretty sure you can

devout dove
#

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

thin panther
#

Add rotation?

#

If it moves on the wrong axis you are rotating on the wrong axis

silk hinge
#

Is there any way to do some kind of "Curve Trace by channel" ? instead of Line traces ?

thin panther
#

Wdym vurve trace

#

You want a curving line?

#

Or like a sphere

silk hinge
#

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

devout dove
#

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 😦

devout dove
tight schooner
#

Flight/space sims use quaternions, I've read

devout dove
devout dove
warm glacier
tight schooner
#

Gimbal lock is the crux of the issue regarding a vehicle flipping ...that's all I can say. Google from there

spark steppe
devout dove
# outer elbow .

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

warm glacier
#

It was physics

#

I'll have to use torque I believe

minor nest
#

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

limber parcel
#

i suggest getting a flyswatter

cinder comet
thin panther
devout dove
#

Why is add relative rotation locked to 90 ?

prisma stag
#

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

devout dove
#

When I used UE4 I could freely move my text inside the canvas and in UE5 I can't why?

thorny acorn
thorny acorn
devout dove
#

I added a widget and also my touch controls stopped working nice

devout dove
#

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

fleet cedar
#

Help please!

#

Why no trace result

serene pike
#

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

surreal peak
surreal peak
#

Or in BP terms an empty reference variable

#

Or pending kill fwiw

#

But I think then it actually says it's pending kill

serene pike
#

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?

surreal peak
#

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

serene pike
surreal peak
#

Yeah that is a really really bad setup

serene pike
#

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

surreal peak
#

E.g. you are calling RemoveFromParent on 4 different return values, where in the first case the other 3 aren't even existing yet

serene pike
#

so if I were to do an extra branch on each to see if they exist it could work?

surreal peak
#

You should save them into each their own variable

devout dove
surreal peak
#

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

surreal peak
devout dove
surreal peak
# serene pike

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.

tawdry surge
#

On tick with delays too

devout dove
surreal peak
#

Probably cause your widget fully overlays the screen

#

And takes the touch input away

devout dove
#

But how do I make it small then?

surreal peak
#

Idk what your widget is

devout dove
#

Do I need to make the widget the size of the text?

surreal peak
#

But one option is to ensure that the visibility of that specific part of the Widget is hit test invisible

devout dove
surreal peak
#

This covers the whole screen?

#

Why?

#

Where is the text supposed to be?

devout dove
#

Idk I added the TEXT and it made it so big

surreal peak
#

Yeah cause you have no parent widget that constraints the size

devout dove
#

In UE4 when i dragged text into the canvas it was like a tiny element

surreal peak
#

Then wrap it with a canvas

#

Rightclick it and go to the wrap option and select canvas panel

devout dove
surreal peak
#

Wrap with

#

Right above it

devout dove
#

aa ok

devout dove
surreal peak
#

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.

hybrid horizon
#

Yeah, UE4 came with a canvas on new widget, UE5 does not

devout dove
surreal peak
#

I usually only have it in my main widget that I add to the viewport

#

Any nested widget I don't use them for

devout dove
#

So you put a widget into a widget?

surreal peak
#

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

devout dove
surreal peak
#

They partially support inheritance

#

Like similar to BPs

devout dove
#

I thought one widget is better than multiple widgets

surreal peak
#

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

surreal peak
#

There is obviously limits.

hybrid horizon
devout dove
#

So I should separate them like "Airplane stats" "chat widget" "buttons controlls" etc?

surreal peak
#

Yes

devout dove
#

But I will still show them all :x

surreal peak
#

InventoryWidget, InventorySlotWidget

#

That's fine

devout dove
#

I mean I understand "Inventory" etc

surreal peak
#

You also have a character with multiple components :P

devout dove
#

Because inventory is like a window that opens

surreal peak
#

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

devout dove
#

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

surreal peak
#

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

devout dove
#

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

surreal peak
#

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

devout dove
#

So something like if you click on an item in your inventory and it shows stats etc?

surreal peak
#

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

devout dove
ancient siren
#

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)

thin panther
#

does the coin react to a visibility channel?}

ancient siren
thin panther
#

in your collision

ancient siren
#

the sphere trace?

thin panther
#

no

#

the coin

ancient siren
#

there are no collision checks or anything in the coin

#

SORRY I AM LITERALLY CLUELESS LMFAO

thin panther
#

no, but your coin needs collision

#

does the collision react to visibility as well as your other things like the player

ancient siren
#

i think so

thin panther
#

check

ancient siren
#

idk what u mean when you say that it can react to visibility

#

oh nvm i see it

#

in the collision presets

thin panther
#

ye

ancient siren
#

yeah it is overlap all

thin panther
#

needs to be block all

ancient siren
#

i j tried that a sec ago

thin panther
#

a trace only hits blocking objects

#

you could try checking when it overlaps with a collision sphere or the player's collision perhaps?

ancient siren
thin panther
#

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

ancient siren
thin panther
#

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

ancient siren
#

ok so in this check am i doing it in the player event graph or the coin's

thin panther
#

you could do either

#

chekc in the coin if the player overlaps

#

but it would be better in the player likely

tawdry surge
#

@thin panther traces do not only hit blocks however a block will stop the trace from hitting anything else

thin panther
#

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

tawdry surge
#

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

thin panther
#

ah fair enough

#

anyway

ancient siren
#

alr would this be right

thin panther
#

its possible the sphere trace is reacting to the ground or player then

thin panther
#

why are you binding an event

ancient siren
#

i have no idea

thin panther
#

there is a node for overlapping

ancient siren
thin panther
#

yes

#

also you dont need to do the set afterwarss

#

afterwards*

#

its not harmful but it is redundant

ancient siren
#

alr

#

im gonna try it rq

thin panther
#

the little diamond connection means by reference, so you directly modify the variable rather than a copy

ancient siren
#

ohh ok

thin panther
#

so you are doing
coins = coins + 1;
coins = coins;

ancient siren
#

lmao ok

#

btw it didnt work

thin panther
#

show the collision setup for the coin

ancient siren
thin panther
#

so if that isnt on overlap it wont overlap the player

ancient siren
#

alr i tried overlap and it still did nothing

thin panther
#

show again

ancient siren
thin panther
#

and the player bp

ancient siren
#

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

thin panther
#

there has to be

#

for a character

ancient siren
#

theres a collision cylinder

thin panther
#

show it

ancient siren
#

btw this is a flying gorilla game

#

"floating monkey simulator"

thin panther
#

scroll down on that capsule and click the plus on begin overlap

ancient siren
#

alr

#

should i just make a collision sphere on the head?

#

that is where the sphere trace is

thin panther
#

could do

#

and use the overlap event for that sphere

ancient siren
#

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

thin panther
#

print a string on cast failed

#

also how do you know it isnt working

#

you arent showing the variable anywhere

ancient siren
thin panther
#

so the cast is failing?

ancient siren
#

yes the cast is failing when i collide with anything besides the coin

#

which is good

thin panther
#

then its working

ancient siren
#

wait im gonna try smt rq

#

this is the text

#

for the hud

#

that shoiws you

#

how many coins you have

thin panther
#

ok?

ancient siren
thin panther
#

well ok

#

but if the cast isnt failing on the coin

#

then it works

ancient siren
#

the coin definitely hits his head

#

idk why it isnt working

serene pike
#

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?

ancient siren
#

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

#

!

mental trellis
#

Caps is bad mmm'kay

astral epoch
#

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.

mental trellis
#

Are you sure it's the spawn node returning an invalid ref? Not one of the inputs in to the spawn node?

astral epoch
#

Specifies that node.

#

Actually hang on

mental trellis
#

GetPawn is the one erroring?

#

Well, GetControlledPawn

astral epoch
#

Maybe

#

I'll double check that

mental trellis
#

No other node even has Pawn in the name.

astral epoch
#

Yeah misunderstood when it was telling me the problematic node was the SpawnActor itself.

#

Oddly, the transform works even without controlled pawn.

mental trellis
#

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

astral epoch
#

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

mental trellis
#

nP

serene pike
tawdry surge
#

Thats my guess. Where are you setting the water rise actor ref

mental trellis
#

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.

tawdry surge
#

Nah it runs itself

mental trellis
#

If you just want the plank to raise with the water

#

Just parent the plank to the water.

serene pike
#

not using it anywhere else

tawdry surge
#

So it's empty

serene pike
#

Yes

#

Clearly I don't understand cast to, as that often seems to be a solution

mental trellis
#

Do you know how classes work?

#

Like the onion or hierarchy system?

serene pike
#

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

tawdry surge
#

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.

mental trellis
#

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.

astral epoch
thin panther
#

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

mental trellis
#

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

thin panther
#

like okay, i cant tell its an actor, but what we need is a house, so is this referencing a house

#

thats a cast

mental trellis
#

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

serene pike
#

I thought casting was just allowing variables or other things from one blueprint to be used in another

mental trellis
#

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.

devout dove
#

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

mental trellis
#

Rotation doesn't move something. It rotates it.

devout dove
mental trellis
#

That doesn't mean shit if your movement isn't based on your plane's rotation.

astral epoch
#

Now now children

mental trellis
#

Which axis are you rotating around? Yaw, pitch or roll?

astral epoch
mental trellis
mental trellis
thin panther
#

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

worthy jasper
#

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?

thin panther
#

i remember those days, casting confused the hell out of me until i learned oop independently

astral epoch
#

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.

serene pike
#

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 😐

mental trellis
thin panther
devout dove
mental trellis
thin panther
#

but in hindsight it seems really dumb when you learn, because how would the game know what you want if theres more than one

worthy jasper
mental trellis
thin panther
#

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

mental trellis
astral epoch
worthy jasper
devout dove
#

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

thin panther
astral epoch
#

Lucky you actually getting taught principles haha

thin panther
#

i think its very important to learn programming for this stuff, because ti really helps with the abstraction and decomposition of problems

astral epoch
#

That said, its always fun teaching people what the different design patterns are and how to use them.

mental trellis
astral epoch
#

Like their eyes have suddenly been opened to much easier ways of doing things

thin panther
#

my uni is much much different tho

#

10/10#

mental trellis
#

Lol

astral epoch
#

ignoring my hilariously awkward stumbling through the engine right now, that's a design issue more than anything

thin panther
worthy jasper
thin panther
#

nto even having to touch a tutorial in ages

mental trellis
#

Might do. Who knows the gremlins you might encounter with replication.

astral epoch
serene pike
#

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

mental trellis
#

It migth skip our replicating something because of race conditions.

thin panther
#

im now imaging that replication is done by tiny flying gremlins from server to client

worthy jasper
thin panther
#

thank you for that

astral epoch
thin panther
#

although it did help for uni

mental trellis
#

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...

serene pike
devout dove
#

Found the solution, not sure how many bugs it caused but for now it will do

worthy jasper
serene pike
#

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

astral epoch
#

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.

mental trellis
thin panther
mental trellis
#

It's legit, brother.

thin panther
#

you cannot cast to a level bp

thin panther
#

oh my god

serene pike
#

Oh right, forgot you couldn't, tried that earlier today

thin panther
#

this is amazing

hazy plover
#

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?

serene pike
#

In that case, are you simply able to cast to a static mesh actor from a blueprint that isn't level blueprint

mental trellis
thin panther
#

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

hazy plover
thin panther
#

if its something more general, like a moving platform

mental trellis
#

Static Mesh = geometry/model. Static Mesh Component = renders said static mesh. Static Mesh Actor = houses that component in the world.

mental trellis
thin panther
#

god its like Blueprints, Blueprints and blueprints

#

one being a laguage, one being interchangable with actor and the otehr being used by construction workers

mental trellis
#

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.

thin panther
#

yes thats my bad

#

what i meant was more

hazy plover
thin panther
#

a lot of things that need to move are better off in actors

#

as they tend to be reusable

#

and encapsulation etc etc

mental trellis
#

Try selecting multiple actors with your broken one and deleting them all?

mental trellis
thin panther
#

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 πŸ˜…

serene pike
#

So why doesn't this bp set work?

#

all because I used an actor variable to fill the cast object?

mental trellis
#

Who knows?

#

You've only got 1 debug output there.

#

Add more.

serene pike
#

debug output?

thin panther
#

can never get enough print strings

mental trellis
#

Pring strings

serene pike
#

ah

mental trellis
#

Are you sure your plank isn't starting at the coordinates you've given?

#

If it's already there, it won't move.

serene pike
#

yep, it is the casting

#

interesting way of finding out

mental trellis
#

Change your variable type to be the correct type and you won't have to cast.

thin panther
#

is there actually anything in the actor variable by chance

#

also that

fleet cedar
#

How do I cancel this out? The second connection doesn't restore movement to my character

silk hinge
thin panther
#

self is a player controller right?

fleet cedar
#

yes

mental trellis
#

So what is the problem, exactly?

#

Does the second bit even trigger?

#

Have you added a breakpoint to check?

#

Or a debug string?

fleet cedar
#

It doesn't, the mouse won't disappear even

#

Not sure why

mental trellis
#

So the key press doesn't work?

fleet cedar
#

it does, but then the release doesn't even work -_-

mental trellis
#

Probably because the key press is part of the game input mode

fleet cedar
mental trellis
#

So making it UI only, you're disabling your input binds.

fleet cedar
#

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

serene pike
#

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?

thin panther
#

that different bp

mental trellis
thin panther
#

cast to the other bp -> get the mesh

mental trellis
#

Or just let people move their characters while in the menu (unless it's a full screen menu)

thin panther
#

i do like being able to move and edit inv ngl

fleet cedar
#

This is working for now

#

Thank you

serene pike
thin panther
#

Ok

#

So get the full bp

#

Then get the mesh reference

#

You cant cast to the component

mental trellis
#

You could get the nth component from the base actor reference and cast that.

#

(just to be pedantic)

thin panther
#

Cant beat being pedantic

mental trellis
#

Technically correct is the best kind of correct.

thin panther
#

Of course

serene pike
#

nth component?

mental trellis
#

1st, 2nd, 3rd, ..., nth

mental trellis
#

n represents any number.

silk hinge
faint pasture
mental trellis
#

suvat all over again

thin panther
mental trellis
#

or the 2th thing...

faint badge
mental trellis
#

3th?

thin panther
#

should be nst/nd/rd/th

silk hinge
thin panther
#

Much easiee to write

#

Really flows off the tongue

serene pike
#

What would I set as target?

faint pasture
#

line trace, get actor of class, already have the ref, whatever

thin panther
#

Again you are fundamnetally misunderstanding casts

serene pike
#

Yes I'm sure I am

faint pasture
thin panther
#

You need a ref to BP_water_rise, then you cast to it, then you can access its components

mental trellis
#

@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.

thin panther
#

Since water and plank arent bp water rise, nor are they the parent of it, they cannot be used to cast to it

mental trellis
#

You have to cast the object and then get what you want from it.

serene pike
#

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

mental trellis
thin panther
#

Read Adriel's name again lol

#

Damn they beat me to it

mental trellis
#

Cast on the left, those nodes on the right.

serene pike
#

Yeah that's what had me mention it

#

I've no idea where to properly get the information

trim matrix
#

what are you trying to do again?

mental trellis
#

Tutorials on object oriented programming and polymorphism is what you want.

thin panther
#

Yes learning oop here is what you need

serene pike
#

I can't cast to plank or water though, so how would I mention the static mesh components in the first place

trim matrix
#

also what is the point of the sequence node? Over just chaining things together

thin panther
#

Learning the principles of the type of programming the engine uses is essential to using the engine

faint pasture
#

@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.

mental trellis
thin panther
#

Thats why i disagree with the allure of "make games without code"

mental trellis
#

Ghettoprints

faint pasture
#

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.

trim matrix
#

I always wondered why a linetrace or collision event can't just return the correct type right away

serene pike
#

From that analogy all I get is that I need to cast to the bp itself 😟

faint pasture
#

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.

thin panther
#

Yes because thats what you need to do

trim matrix
#

Instead it just goes "lul I hit actor cast it now bozo"

mental trellis
#

The fact is, you have to start with the Animal in the first place or you can't do anything.

faint pasture
#

all you're guaranteed is that it's an Actor

trim matrix
#

Okay, then return the right type right away

#

It's not like the engine doesn't know anyways

thin panther
#

Thats not how that works

#

It doesnt know is the thing

serene pike
#

Assuming I'm using the correct technical terms then: how do I move statich mesh components in one blueprint using a different blueprint?

faint pasture
#

When you very often don't care what type it is.

thin panther
trim matrix
#

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

solar sequoia
#

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

faint pasture
faint pasture
serene pike
faint pasture
#

In my case, I just care about the distance

serene pike
#

Everything being in first person character

#

except the custom event

mental trellis
faint pasture
trim matrix
#

Your very specific situation isn't the point here

solar sequoia
trim matrix
#

There is zero reason a node like GetActorType doesn't exist

serene pike
faint pasture
#

I also do it in a tight loop and not spread out over thousands of actors.

solar sequoia
faint pasture
#

and in C++. In BP it was over 100x slower, and it was all in the math. The trace was just as fast.

solar sequoia
serene pike
faint pasture
trim matrix
solar sequoia
faint pasture
trim matrix
#

Why wouldn't it be though, again @solar sequoia

faint pasture
#

Just all the time, with a line trace (interaction style), with some overlap, what?

serene pike
mental trellis
#

BP is shit like that.

faint pasture
#

What is the SPECIFIC gameplay thing you're doing. Tell the story, the player does what, and what happens?

mental trellis
#

No dynamic typing.

trim matrix
#

exactly @mental trellis I was about to write that

#

ohhh c++ has auto that's correct

mental trellis
#

Even c++ is strictly typed, though, it's just more flexible.

serene pike
faint pasture
trim matrix
#

wait does something like auto treeactor = cast<auto>(ActorPointer*) exist @mental trellis ?

mental trellis
#

No

trim matrix
#

Or is that voodoo dark sorcery

mental trellis
#

That sort of shit is the purview of scripting languages

solar sequoia
mental trellis
#

Weakly typed things like php (or python?)

#

Is python strongly typed?

serene pike
#

I see now it knows about the valve because of the linetrace, but I can't think of how to mention the other

solar sequoia
trim matrix
#

Still, the engine knows about that pointer and all it's properties so technically it could exist

mental trellis
#

At runtime, yes.

#

At compile time it does not.

trim matrix
#

True

serene pike
mental trellis
#

That's why interpretted languages like php can do that.

serene pike
#

custom event that is

#

so I'll assume that's not what you mean

trim matrix
#

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?

mental trellis
#

But that's irrelevant.

solar sequoia
mental trellis
#

It's the node that does the casting. The node is created at compile time.

trim matrix
#

something like "give me the type of that actor, which I know is in the world because I spawned it earlier or whatever"

solar sequoia
#

you can do it in your level bp @serene pike . Probably the best way if you only need it for that level

mental trellis
#

That's just not how computers work. They can't intuit the demands of the user.

faint pasture
#

you said you're doing a line trace

#

do the line trace, cast the HIT ACTOR to BP WATER WHATEVER

wintry geyser
#

@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

faint pasture
#

that's your test for "did I just hit the valve thingy?"

trim matrix
#

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

wintry geyser
#

How many conversations are happening right now lol

trim matrix
#

It's 2:30am I'm dropping this semantics lol just help the water valve guy

thin panther
#

You cannot set a default value for actor refs as their memory location changes

wintry geyser
#

If the thing doesn't exist, on spawn = set reference

solar sequoia
thin panther
#

yes and that solves that issue

#

wait no im dumb nvm πŸ˜…

wintry geyser
#

@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

thin panther
#

@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

serene pike
trim matrix
#

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

thin panther
#

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

trim matrix
#

this isn't #cpp so we're not gonna blast the poor guy

serene pike
#

@wintry geyser just hopped in parlor

trim matrix
#

but yeah some oop practice could help

trim matrix
#

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.

wintry geyser
#

People over-explaining shit is all. lol

hybrid horizon
trim matrix
#

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?

icy dragon
#

Casting = try to treat something as one particular class

trim matrix
#

and then people are like ''casting bad use bpi'' and they get even more confused lol

icy dragon
#

Pedantic guys can cringe all they want

wintry geyser
#

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.

trim matrix
#

yea once I figured out you can make variables public and manually put shit in there from the editor my mind was blown lol

wintry geyser
#

For real. Seriously don't skip Content Examples.

trim matrix
#

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

icy dragon
#

Casting something already in memory is practically harmless, really.

zealous moth
#

@icy dragon yup

trim matrix
#

like if you made it a variable? oh alright

wintry geyser
#

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.

blissful grail
#

Sanity check - shouldn't Attach Actor To Component lock the actor to follow the components location?

wintry geyser
#

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

trim matrix
#

@blissful graildid you set snap to target?

blissful grail
#

Yes

trim matrix
#

can I see the whole BP?

blissful grail
trim matrix
#

@wintry geyseroh thats sick I didnt even know that

wintry geyser
blissful grail
#

It works as expected if I do actor to actor though. But for w/e reason, attaching to the component is not

trim matrix
#

then do actor to actor? πŸ˜„