#blueprint

1 messages · Page 173 of 1

lunar sleet
#

#umg can help with UI. Outer is cpp terminology

lofty rapids
#

multidimensional arrays not a thing in blueprints i'm pretty sure

thin panther
#

Multidimensional arrays are unnecessary anyway

minor mortar
minor mortar
steel star
#

because array of arrays, i suppose

lethal ocean
#

Hey, does anyone know if there is a more cost effective alternative to 2D Scene Capture Components? And if not best practices to using them performance wise? I have one in my scene that I would like to use but it tanks the fps

thin panther
steel star
#

also perhaps dont draw it every frame, or maybe just once even

minor mortar
#

I guess the idea would then be to use the positional data to determine the exact location it lays out given the array size, etc, and then just use an array/structure to hold the bottom level data? That makes sense.

I'm just trying to store various types of data (ints/enum/etc) at a given row/col number. This looks pretty straightforward to do then.

steel star
#

alternately just use a dictionary/map

minor mortar
#

Array of arrays seems like it might be a bit less math I have to do, which is always a benefit. lol. So, for my purposes... An array, within an array, that holds a struct of data that I call for the element I'm looking for?

steel star
#

yea, i mean makes sense to me, i have not done it in UE blueprints personally

lofty rapids
#

what is array of arrays ?

lunar sleet
#

Something you can’t do in bp

steel star
#

you cant do that either?

lunar sleet
#

Afaik no, cpp thing

steel star
#

that doesn't make sense

trim matrix
#

TArray<TArray<smt>>

minor mortar
lunar sleet
#

Notice the T in front of array

trim matrix
#

for template

lunar sleet
#

It also indicates cpp code being relayed

steel star
#

i bet you make that a UPROPERTY with BlueprintReadWrite and it works fine

trim matrix
#

probably lol

lunar sleet
#

But out of the box it’s not pure bp

#

Just like TArray::Sort doesn’t exist in bp

steel star
#

i mean, you can have a random bp and add a node 'make array' and for the type choose array? i guess thats the part the ui doesn't let you do?

lunar sleet
#

I suppose? I haven’t tried

faint pasture
#

and is it dense or sparse?

#

Like say you had to cover a 100 x 100 grid, would EVERY spot have something important or just some of them?

minor mortar
#

So far, I'm testing it with a 15x30 grid. Each tile in that grid will have associated data, such as tile type, whether it's occupied, whether there are any other conditions affecting that tile, etc. So -every- tile has that information all the time. Not sure what you mean by dense or sparse beyond that though?

faint pasture
#

Your best bet will be to use an array and some helper functions to convert coords to index and back, or a map/dictionary

#

Key = coords
Value = Data at that coords

minor mortar
#

I think I get what you mean. Kind of like, a single flat array that I can add to the element of based on the row and columns to find the right entry, and then that array is a specific structure holding all my data.

Right now I'm working on filling out my struct with the data I need each tile to hold, then I'll have to figure out that part.

modest monolith
#

@harsh comet New legend of the server confirmed. This wouldn't have been fixed without a very attentive and patient person like him. Thank you! 💜

harsh comet
#

Happy to help!

dawn gazelle
#

Probably gimbal lock.

steel star
#

you are probably doing yaw (turning left/right) in object space and meant to do it in world space

dawn gazelle
#

Pitch can only go from 90 to -90. It doesn't do a full 360.

#

When you go beyond these values, it adds in roll and yaw to allow you to continue moving.

steel star
#

its about the rotation you are setting though

#

one style is like a flight sim

#

make yaw and pitch bp variables (not just local ones)

#

mouse delta = yaw/pitch ++ --

#

build rotation from specific yaw, pitch values

#

you are trying to apply a new rotation, on top of its current rotations

#

dont do that unless its a flight sim

#

dont get world rotation

#

your building a brand new rotation

#

and setting it, not multiplying it on top

#

it is the world rotation

#

set the world rotation, to the result of "make fquat from yaw pitch roll"

#

except idk the actual bp node name

#

you have 'compose rotators' but you dont want a previous rotation

#

yea quaternion

#

no

#

because a quaternions x,y,z,w does not equal yaw, pitch roll

#

yaw pitch roll is also called a euler

#

hold on. ill have to build and actually run editor

#

a euler angle, or euler for short, is a vector3 where x,y,z is yaw pitch roll

#

a quat is a 3d rotation, and can be constructed from or decomposed into a euler

#

and idk what a 'rotator' is in unreal engine really, im just talking about actual (math) computer graphics terms

#

you might even be able to just break the 'input' pin on your blueprint as you had it before, if that is valid for a rotator node

#

yea, if its unconstrained rotation applied relative to its current rotation, its impossible to ever get it back level or not upsidedown ;D becomes like solving a rubix cube

cerulean igloo
#

Hey folks. QQ. Let's say I have my PCG graph sorted out. How do I connect it to a BP that upon a game start or some other event, the PCG gets triggered with a random seed.

steel star
#

whats a pcg?

cerulean igloo
#

Yes

#

Is this roughly right?

#

I can figure out the rest if gpt is not hallucinating

steel star
#

BeginPlay

#

if its a component, it should have a begin play you can overload to do stuff

steel star
#

a keybinding conflict?
i had to rebind so that escape key is not stop simulation
in the editor prefs

fervent jolt
#

Hello, Does anyone know if it is possible to find a spline components point by collision?(See image) I want to find the spline point nearest an input vector, but searching all the thousands of spline components and then all of their spline points will eventually get very performance intensive. They are all bound to the same actor, and the function to find the points would be in the same actor as well.

#

orange is the landscape

steel star
#

does spline component not support collision?

fervent jolt
#

it would, presumably, now that I think of it theres more than one type of collision isnt there?

#

I might be able to make it work with that info, thank you

steel star
#

if you make each component its own child actor

#

that will allow them to be binned or whatever the world does for fast overlap testing

mild jacinth
#

if I have a text widget component placed in BP_MasterCharacter and I have a reference to the maincharacter, but during gameplay it changes to child reference , how do I gain access to the child Character BP without casting , so I can manipulate the child's text widget not the Master's text widget?

steel star
#

assuming that spline component at least has a bounding box

fervent jolt
#

i could probably add one, that sounds like a way better idea than what I'm doing, thank you very much!

steel star
mild jacinth
#

I can access the widget component

steel star
#

it gets "changed"?

mild jacinth
#

but I dont know how I can access exactly the child's widget

steel star
#

what is the child class name

#

and does it show the master character bp as its parent?

mild jacinth
#

child bp*

#

yeah

steel star
#

ok so it isnt being changed, it is allocated and includes everything about master, and is a master

#

there is only one property for your widget

mild jacinth
#

example: MasterCharacter -> ZombieEnemy1 (derives from MasterCharacter, so inherits Widget component)

#

I get access to ZombieEnemy1 while the game is running even though the base variable is MasterCharacter inside the blueprint

steel star
#

does zombieenemy1 define its own property that is a textwidget? no, right?

mild jacinth
#

so Im accessing the widget component, but its targeting the MasterCharacter component

steel star
#

there is no problem, because the mastercharacter being targetted IS the zombie

mild jacinth
#

ZombieEnemy1 is getting its widget from Master but it should be instance editable

steel star
#

there is no separate master character object

#

the zombie IS a master character

mild jacinth
#

how can I target specific zombie child class via blueprints to trigger for an example widget component's visibility...?

steel star
#

what is the error

mild jacinth
#

Its obviously not plugged in but even when plugged in the visibility is still hidden, and I think its because its targeting the Master zombie class but not the child class specifically itself

#

current target is ZombieEnemy1 while the lock on is running

steel star
#

but what is the error

mild jacinth
#

...?

steel star
#

in your image is shows error, what is it?

#

because i see no issue

mild jacinth
#

I just said in my text

#

its not plugged in

#

but even if plugged in

#

read

#

how can it target specifically this zombie child BP while the lock on is engaged but it cannot find whos the author of the component

#

there must be a way to set the component author

steel star
#

the component is always owned by the actor it is on

mild jacinth
#

even if inherited?

steel star
#

yes

mild jacinth
#

so it must be instance editable

steel star
#

no

#

because inherited components are not, usually

#

or you cant like remove them

#

unless you mean just that each actor that is a zombie has its own component with its own personal values

mild jacinth
#

so what im getting is that I have to setup the widget component for each enemy class (child classes) separately?

steel star
#

are you not already? where is your widget component now

#

it being in the base class gives every actor one

#

like there literally is no problem

#

thats why i asked what your error message was

#

oh by the way i just had to implement some widgetcomponent based reticules and hovor indicators for my own project

#

and i did it via a base bp class that is used for every that is unit in the game

#

but thats because i need it per unit, some other ones there can only ever be one of onscreen like a drag selection rectangle, so i did that on the character controller

mild jacinth
#

as an example ZombieEnemy1 is placed on the level and when using lock-on then it can find the enemy because its looking for all actors of class "MasterCharacter" and the lock-on works. Now, only the MasteerCharacter has the text widget. Its visibility is set to hidden on the Master. since ZombieEnemy1 child class gets the widget inherited, I want to set its own visibility to visible so it would be shown at same time

#

but its literally not setting its visibility to visible

#

its still hidden

steel star
#

maybe try debugging (simulate button) the blueprint and adding a print text node at the end, after the widget visibility call, and make sure its really occurring

#

also make sure it like .. has text assigned not just visibility ;D

#

if you need to get the widget on a different actor that isn't 'self' then you have to at least have the actor

mild jacinth
#

GetWidgetComponent->GetVisibility->EnumToString->Print string -> returns Visible, interesting

steel star
#

yay! progress though.

#

information = progress

mild jacinth
#

The child is the owner of the component->GetOwner->GetDisplayName->print

#

I will do some debugging.. weird day 😕

empty light
#

Hey guys, I have been trying to set up the camera in the third person bp, to return to its origina position (behind the player) after a certain amount of inactivity.
It works, but I have run into two issues, a) if i move the camera while it rotates to its original position, i stop the rotation but cant controll the camera, b) i cant control the camera after its rotated back to its original position.

Do you have any recommendations or tips, towards what I should do ?

steel star
#

this would tell you if the input action is actually firing or not

fervent jolt
empty light
steel star
#

put a breakpoint in the tick event

#

you might consider writing it as "time of last input" and then "if current time >= last time + X"

#

also

#

you are retriggering that timeline repeatedly i think

#

looks like you need a little state machine

empty light
#

You are right, the timeline keeps retriggering (I added a print string to check, and it prints non stop)

steel star
#

cool, sounds like your getting the hang of debugging issues then, core programmer skills ;D

empty light
#

Haha, thank you, I totally forgot about debugging xD

wide summit
#

I am moving my player character using force because I want to do things like add an impulse to it however I don't want the collision to be this accurate. How can I disable all the added rotation from collisions yet still have the player character not phase through walls? thanks!

steel star
#

looks kinda cool though with the wobble

wide summit
#

lmao yeah its like some go pro footage of an accident

dry monolith
#

Bumping this, no idea how to setup a filter to see all blueprints under a subfolder...

steel star
dry monolith
graceful sage
dry monolith
#

All good, basically I want the system to scan for any metahumans I've downloaded in the metahumans subfolder and return an array of them all

#

So I can download 10 metahumans and not have to manually add references in code to the new ones I downloaded

hasty igloo
#

ok I have a actor that spawns projectiles to kill targets, when the target dies I want it to inform the actor it got a kill, how would I do that?

dusk dagger
#

I would recommend using an event dispatcher for that

graceful sage
dry monolith
graceful sage
dry monolith
graceful sage
#

There's a class paths but that's an input

dry monolith
#

where's that?

graceful sage
#

What type Is the get bp assets returning?

graceful sage
dry monolith
graceful sage
#

Couldn't you just set that array then?

#

Idk what this node does so not very helpful lol

dry monolith
#

Well the whole idea is it'll find any actors underneath the subfolder recursively and return them so I don't have to manually edit anything as I download more metahumans

graceful sage
#

So is the get bp assets not working or?

#

What's to the left?

dry monolith
dry monolith
#

What's interesting is if I remove the package path array, and leave that input empty, it seems to find a ton of blueprints:

graceful sage
#

Make try / instead of \

dry monolith
#

Yeah just tried, same result unfortunately

graceful sage
#

Seems to just search in engine folder maybe

dry monolith
#

Which seems really odd

#

Same result with a global path

graceful sage
#

Change the path to your content folder maybe

dry monolith
#

Yeah that's what I'm doing currently, still not fidning it

graceful sage
#

That's not a name tho

#

Probably just doesn't work that way and Probably not for this

dry monolith
#

Welll I'm plugging it into the package paths array, not the package names

#

Yeah you're probably right, can you think of any other ways I could get the references?

graceful sage
#

Why not just add then manually lol

#

Probably not without c++

hasty igloo
#

ok yeah I'm at a complete loss, idk how to do this

dry monolith
hasty igloo
#

not sure how to figure out how to let the killer of a actor know that its killed something

dry monolith
#

The take damage event has info on who damaged the actor

hasty igloo
dry monolith
#

Well if you trigger the kill functionality in the OnTakeDamage event you have a reference to the killing actor, so you can call whatever functionality you want at that stage with the Damage Causer reference

hasty igloo
#

kill functionality??

dry monolith
#

whatever code you're using to make your actor die. Just wire up the death system into the OnTakeDamage event and you'll have a reference to the killing actor when you want your actor to die

#

I.e. OnTakeDamage -> set health =health-damage -> if health <=0 -> cast to Killing Actor on Damage Causer parameter and fire KilledEnemy

graceful sage
dry monolith
hasty igloo
#

right, but how would I get the killing actor??

#

I only have a pawn reference

graceful sage
#

Cast or use interface

hasty igloo
#

can't cast

steel star
#

when i get this bogged down trying to do something specific in blueprints, thats what i do

dry monolith
#

Gotcha, yeah I've managed to not get into C++ so unfortunately that'll be a bit of a process for me to setup I think

steel star
#

plus you probably dont really want to reallocate an array of them all each time, just to loop through them

dry monolith
#

Someone mentioned using python though, does that sound possible/

normal furnace
#

I have a question about blueprints and components. I'm looking for a way to determine the classes of any components that are configured in a blueprint class that isn't actually spawned in the world. I can use a CDO to get most information contained in a class, but there doesn't seem to be a way of finding the classes of components. Is there any way around this?

dry monolith
graceful sage
hasty igloo
steel star
#

anyway thats not a big deal unless we're talking hundred of them

#

and it being called continuously

dry monolith
#

Gotcha, yeah it's something I'd just be calling at the start

steel star
#

I have heard python is semi-officially supported or something.

#

But imo dont give yourself more work by trying to do that.

#

When you haven't even done regular C++ before.

#

That is to say, if you want to ease into code beyond bps, making a single function in C++ is a good place.

dry monolith
#

Understood, yeah that makes sense

steel star
#

But really, that node looked to me like it would work

#

So long as meta humans have a base class of some type

dry monolith
#

Same here 😆, but it won't even find any actors under the main content folder

dry monolith
steel star
#

Ah.

#

Maybe you can change the folder it downloads/installs metahumans to.

#

Give them their own location. Problem bypassed.

dry monolith
#

But I still can't work out how to get the node to find any blueprints under a specific subfolder...

steel star
#

really? specify the path in the subfolder

dry monolith
#

When I enable Incolude Only on Disk assets it finds my game assets now, but it's saying the path is under a Game folder, not the content folder:

steel star
#

does it matter? what are you about to do with them all anyway

#

if you have the blueprint asset, thats all you need to allocate one

dry monolith
#

Ahh never mind, think I've got it

#

problem was I was searching under Content/Metahumans, but searching under Game/Metahumans allowed it to find the assets only under that subfolder

steel star
#

nice

dry monolith
#

Perfect, thanks for the help 👍

graceful sage
#

Nice I might play around with this myself didn't know about this node

hasty igloo
#

ok I think one major flaw I have in my actor is that component begin overlaps are called on all clients and the server for said actor

#

not sure how to go about just making that run on the server only

steel star
#

or maybe uncheck this

hasty igloo
#

I suppose, just seems weird

steel star
#

has authority means this is the true version of the actor on the device under network control of it

lunar sleet
chrome crag
#

Hey all! I have a fishing game, and all of my casting/reeling etc stuff is in my BP player character.. but I also want to be able to fish in the boat too..

is there anyway I can maintain possession of my player character and still drive my boat? or how would any of you approach this?

outer quail
#

Hi, I have packaged my profit and it when open it started at a login screen, once I pressed the login button the game crashed, where it should change to another level. Attached is the log file, where do I look in the log file to find the cause of the crash?

lunar sleet
spark steppe
steel star
#

sorry. wrong error

outer quail
lunar sleet
outer quail
spark steppe
lunar sleet
gilded jewel
#

im trying to get the player character to auto follow another actor just before possessing. Once possessed i have it following no problems, but the same won't work from the first player for some reason, any suggestions ?

steel star
outer quail
#

I tried disabling sunposition plugin and set the package setting to shipping. It did not crash the game when the login button is pressed, but it did not change the level, I can press the login button many times and nothing happen

steel star
#

uh whats the call you are using to load the level?

#

if its like LoadSomeLevelByPath("Content/MyLevel") then thats probably the issue

outer quail
steel star
#

so, presumably the object reference is null

#

but you can print to find out

outer quail
#

alright I'll try printing it

steel star
#

well, or the signed in event isnot firing

#

i dont actually know if you can debug bps running in a packaged/shipping build

#

somehow

gilded jewel
outer quail
#

looks like the problem is not with the login screen, my project use ue5 collaborative game mode, I tried packaging it where when open it straight away go to the main level, and once I open it, it crash immediately

minor mortar
#

Can you define vectors to only use integers, instead of floats?

maiden wadi
minor mortar
#

I realized that Vector 2D is just a struct, so I made my own Struct called IntegerVector2D. Haven't tested it yet, but it looks like it should do exactly what I want now.

I'm not sure if it makes any more or less sense than having a nested array of my tile data struct, but if I can just plug numbers in and get what I want, it should be fine.

grim sand
maiden wadi
minor mortar
#

Yeah so far it looks the same, actually

#

I'm digging into the operators and seeing what happens

minor mortar
#

It's getting late, but yeah the IntPoint is literally what I was looking for. Thank you!

I'm not sure how sound the logic is, but I'm using the IntPoint as a key for a map container, with the values within being the struct of my tile data. So far, so good. Gotta build it all in next.

grim sand
#

If we use a break for each loop, and we execute the Break execution pin, does the array element output stop at the index where we hit the break execution?

glossy cloak
#

Yeah. As soon as the break triggers, the return node executes.

glossy cloak
grim sand
#

Thanks for the help 🤩

glossy cloak
#

Ha ha no problem. : )

cyan bone
#

Why is my Enemies not moving

#

They have the controller

#

and its the same skeletal mesh as my character (that moves)

#

there must be something obvious that im missing

grim sand
lunar sleet
cyan bone
cyan bone
lunar sleet
lunar sleet
# cyan bone

One issue that you might have based on that screenshot is you’re trying to path above the mesh

#

If that Z location is not on the mesh you need to either adjust the vector or increase the projection to mesh range

#

Also the acceptance radius is a little small

#

Try 50 or so

cyan bone
#

i increased now the scale of the nav mesh

#

still didnt work

lunar sleet
#

Not nav mesh scale

#

That doesn’t do anything in this case

#

Either way, the Visual Debugger is the best way to find out for sure, taking guesses as to what it might be is not optimal

grim sand
cyan bone
#

here we can see that they kind want to move

grim sand
#

What if you set your player character as the Target Actor? Can you check what happens then?

#

Also, does the On request Failed execution pin ever fire? Can you check that with a print string

cyan bone
#

they kind of try to move

#

they rotate a little

grim sand
# cyan bone yes it fires

Okay I am just double checking this for you now, but it essentially means that the location you have provided for it to move to, it cannot move to within the paths provided by the nav mesh.

#

What is NavArea_Obstacle? in your enemy grunt?

cyan bone
#

its the same as my TopDownCharacter

#

my TopDownCharacter moves and is also NavArea_Obstacle

grim sand
#

Right, in that case I am really not sure what the issue is besides the fact that the location you are providing is unreachable by the controllers, which is why On Request Failed is firing.

cyan bone
#

oh i found an hint of the problem

cyan bone
#

and now it moves

#

so this is something

grim sand
#

Ah yea, physics movement and nav movement aren't compatible at the same time

cyan bone
#

ohhh

#

because i have an ability that throws the enemies into the air

#

so that ability must go?

grim sand
#

No, you just need to enable and disable simulate physics at run time when that ability is active.

frosty heron
dusky cobalt
#

If I'm specifing here that I want this to be BP_Unit, is it like putting hard reference? If I used Actor then it would be more light?

frosty heron
#

You need to understand that every player are running their own instance of the game. And each instance have their own version/copies of the actor

#

Overlap code will execute when something overlap in your machine.

#

If u don't want client to overlap, use switch has authority

frosty heron
#

It is a hard ref

#

If u can get away using the base class do that instead

#

Same thing with blueprint casting

#

Always cast to base class when possible

dusky cobalt
#

base class, like Actor in this case, and then only if I needed I would cast to it, if not then it's more light?

frosty heron
#

It wouldn't auto load the derived class

dusky cobalt
#

got it, ok thanks

frosty heron
#

If u have bp unit there, bp unit will be loaded when Ur player state is loaded regardless if u gonna add bp unit or not to the array

dusky cobalt
#

i was wondering because I checked some references in my things and there was a lot of hard references even though I didn't use casting, must be because of how I'm sending some variables and already putting BP_Unit instead of actor for example

frosty heron
#

Blueprint cast produce hard ref (those blue pins)

dusky cobalt
#

in case if there is already BP Unit in the game from the start, does it make any difference? It's still only 1 BP_Unit that is loaded?

dusky cobalt
#

so in this particual case I shouldn't worry

frosty heron
#

If something is loaded anyway, eg your character

#

Then just hard ref away

#

U want to soft ref and load things that you plan to load later on.

#

Something like items , icons, etc

#

Like u don't need to load the entire items in the game. Just load what the player own for example

dusky cobalt
#

okay, thank you a lot

#

got it! 😄

abstract pine
#

if I want to call FPS_AimBP why can't I just call getFPS_AimBP directly ? Instead of relying on casting ? Don't they have some funtion like that ? Casting is everywhere in ue5 and I don't even know why the hell do I even need it for ? Is is some kind of short cut for checking data type ??

#

I don't even know what will cause the casting to to " failed " What is the condition for failing ?????

#

I can get casting from child cast to parent class, but will casting from parent class to child class work ? how does that possible ?

frosty heron
#

You can, you just have to use the right type

#

Casting is just a type check

#

Take an actor for example, that could be an item it could be my player it could be anything that is placed in the world.

#

So if you want to check if that actor is a player character, u will cast to player character.

If the actor is indeed a player character then you will get successfull. Fail otherwise

maiden wadi
dusky cobalt
#

Which would be better.

Get Player State > Cast to Player State > Event On Server
Get Player State > Interface Event > Event On Server

Considering Player State is already loaded anyway. For cleanliness in the code I like interface more, but I'm just adding 1 step too much or it's actually equall?

frosty heron
#

Eww to the interface imo

maiden wadi
#

You should exhaust every other option before ever considering an interface.

#

Can it be simply cast? Then cast it.
Can it be pulled from a component? Then use composition and do that.
Can it be broadcast from somewhere globally? Then put a delegate there and bind it.

If all other options fail because some condition prevents them. Such as needing the same function on both an actor and a component and not being able to use a delegate for it, then you should consider an interface.

dusky cobalt
#

In case of speed it's almost the same or casting here is faster, since it's already loaded from the game start

maiden wadi
#

Interfaces are slower. They run a lot of extra code before the function call, mostly to check that the object can even run the function.

dusky cobalt
#

One more thing. If I'm calling like this from Actor (Unit) to Player State, and the event in Player State is Run On Server, so it will actually get the Player State updated. A little multiplayer question, but if it wasn't run on the server then nothing would actually happen, right?

abstract pine
#

what is the difference between object ref and class reference ?? what does class reference do, what does it used for ?

maiden wadi
abstract pine
#

how does refence to class work ? does class reference mean ref to the text file that contain the code ?

#

I mean ref to the content ( the text ) that made that class

dusky cobalt
graceful sage
dark drum
graceful sage
#

^ better worded

mild jacinth
#

question. if Get Class Defaults exists, is there a way to also set these variables that you get returned from class default?

dark drum
maiden wadi
mild jacinth
#

so its not possible to manipulate child class's variables given that these blueprint nodes exist in the main parent class?

#

(its character blueprint for both of them)

#

i can only 'get' the variable value but not set it for the child?

maiden wadi
mild jacinth
#

direct casting or other type of casting alternative is the way then

#

gotcha

maiden wadi
#

What are you trying to do exactly?

mild jacinth
#

I have main enemy parent class which derives from Character class. I also have enemy child class which derives from the main parent class.

#

the health variables exist in the main parent. I want to manipulate child health variables from the parent class

#

basically have a 'decrease damage' function in the parent class but it would target each child individually

maiden wadi
#

Where does GetClassDefaults come in?

mild jacinth
#

in the parent class

#

parent blueprint

#

I also did 'call parent event anydamage' on child class

maiden wadi
#

But why? They're the same object. Why do you need the defaults? You already have the variable.

mild jacinth
#

i have the variable but its not targeting the child imho

#

ill see

maiden wadi
#

If you have the following hierarchy.
-Parent
--Child1
--Child2

mild jacinth
#

oh okay so it doesnt need it for the variables. my mistake

dusky cobalt
#

maybe you need to click Show Variables

maiden wadi
#

Parent has CurrentHealth. Which means both children do as well. Parent sets this to 100. In Child1's BP you set this to 80. In Child2's BP you set this to 120.

Back in the parent's code. If you get the CurrentHealth on an instance of Child2, you'll see 120

mild jacinth
#

i got that inherited filter already

maiden wadi
#

Having said this all. I strongly recommend ditching inheritance for this and using a data driven approach. A data asset for each enemy type with all of it's static data is a lot more scalable and easy to maintain and balance.

hot pulsar
#

yo, so basically what I am trying to do is an opening drawer
It fully works and moves but the issue is that if I copy and paste the same drawer actor somewhere else and then try to open any drawer, all of them are getting opened instead of that single one.
Yes, I copied and pasted the same actor with the same blueprint.
Is there a way to fix it by making each actor act separately?

#

I am kinda new to unreal

#

and idk if this is the correct channel to ask that, sorry

thin panther
#

Show your code

hot pulsar
#

yep, gimmie a sec

#

it's basically a crosshair and when I interact with a drawer 100 units away, it's going to open

#

but instead of that one drawer actor opening, it opens in all of the same actors in the level

thin panther
#

You don't really want to interact by comparing object names. Instead, try using an interface. Call the interface on whatever you hit, if it implements it, then in the drawer BP, implement the interface and do your opening logic

hot pulsar
#

hm I will try to implement that if I understood correctly

#

and if I implement that, it's going to work individually instead of all of them at once?

#

alright, I will try that, thanks

dusky cobalt
#

Can someone confirm if this is correct? In case of Player State, that is already loaded in the memory from the game start, it's actually better to cast to Playerstate and set that as variable to use it everyhere in that blueprint, instead of using PlayerState and sending interface there. Same would go in all other blueprints that I will need to get any information from PlayerState.

What I'm trying to understand, if I cast to the PlayerState in 5 different blueprints, I'm not loading more, the PlayerState is loaded already, and casting is just a way for these blueprints to communicate to the existing PlayerState. Basically in communication x to 1 it's better for everything to cast to that 1 thing that is loaded anyway, in opposite to if it's 1 to x, where interface would be king.

#

There are 2 approaches 1 with inteface and 1 with casting. I shoudn't use interface in this case, right?

maiden wadi
#

Casting does not load anything. Casting is nothing but a pointer conversion.

#

Linkers load things. But this is only valid for the default instance of the class. And linkers are only related to casting in the sense that the cast node has an output of that type. The same linking happens if you have a class property, or any other function inputs or outputs that class.

Casting is a function that outputs the type. So casting causes a linker.

Linkers are only important for memory management. If the classes casting to this playerstate are always going to be used in a map where this playerstate exists, there's no point to avoid casting. In the case where they would be, you don't use an interface to solve the problem, you make a parent class or a component with the functionality you need and you cast to that parent or generically GetComponentByClass.

#

Kind of a moot point for a playerstate though. Playerstates don't really have much in them as far as assets. So there shouldn't be a large sizemap there anyway.

dusky cobalt
#

Ok, thank you.

steady night
#

hey how would i check or rather get the array element with the highest value :/ ?

#

or if two values or more are the same pick "the lowest one"

frosty heron
#

HighestNumber = 0
for (int i = 0; i < array.Num(); i++)
if array [i] > HighestNumber
HighestNumber = array[i]

steady night
#

hym

trim matrix
#

do the same in BP lol

frosty heron
#

playing whutering waves, you can translate that to bp

steady night
#

basicly right ?

frosty heron
steady night
#

aye just swapped them

#

lawl

#

but if all values are 0 then it will take the lowest one ofc

#

hmm

#

this formula was really taht simple

trim matrix
#

'formula' 🥲

steady night
#

aye llol

worldly skiff
#

Is it normal that Player Controller BeginPlay is getting called when a new level is opened? I thought it should be called only once.

frosty heron
tulip yoke
#

only thing that never gets destroyed and exists all the time is gameinstance

frosty heron
#

you can preserve actors if you use server travel

#

but for hard travel, all actors get destroyed

#

well not Game Instance, it is not an actor

oak gust
#

I have this floating bar above my player to indicate life, how can I add an image (the red exagone (I know my paint is awesome)) but keep the player floating bar center in relation to the bar only and not the bar and the image

worldly skiff
#

I see. Well I'm looking for a place to create widget ui objects only once (initialize them and store as variables). Player Controller seemed like a good place (the game is suppose to be multiplayer), but if BeginPlay is called every time a new level is loaded (since actors are recreated), then new widgets will create each time as well. Should I use GameInstance then?

frosty heron
worldly skiff
#

Thanks, I'll read it more thoroughly when I get to the multiplayer part. But for now I just want to create some UI logic. Specifically I don't understand where do I create widget objects and store them to a global variable so I can use them on any level.

#

Player Controller fits perfectly except that it's recreated when a new level is opened. Game Mode is the same. Game Instance might work, but I'm afraid it only might work correctly in single player.

worldly skiff
#

For example this Main Menu. Where would I create it?

frosty heron
#

understanding begin play in multiplayer context is important. In fact a lot of people have their multiplayer game broken because they mis used begin play

frosty heron
#

can do it thru Game Mode

#

GM_MainMenu

worldly skiff
#

Ye it makes sense that BeginPlay is different than what I assume it is. I'm kinda looking for an Initialization event. I see that GameInstance have Init event so thats probably called only once on game launch.

worldly skiff
frosty heron
frosty heron
worldly skiff
#

I'm gonna show what I have right now and what my problem is

frosty heron
#

do it where it make sense

#

HUD is one place

#

just Open the option when you press esc or w/e

worldly skiff
#

Open is not the problem, its creating Widget objects.

frosty heron
#

what's the issue

worldly skiff
frosty heron
#

Open -> If widget not valid, create one if already valid, show it

worldly skiff
#

this is my Initialize UI function

#

I need it to be called only once on game launch and never again, basically on game Initialization

#

then I can add to viewport/remove wherever I want, just by accessing the variables

maiden wadi
#

Why would you keep widgets around that might never be used? Just release them and let them get collected.

frosty heron
#

only widget I kept alive is my loading screen

#

and that's not possible in blueprint

worldly skiff
#

hm

frosty heron
#

What ever function you want to call (Input or Event) to summon the widget . Check if it's valid. If not create one, if already valid, add it to viewport

worldly skiff
#

you say a better aproach would be to create/destroy (or release? thats what its called in EU) widget objects specifically when I need them rather than creating them on game init and keeping in the memory forever?

frosty heron
#

yes don't overcomplicate it

#

you are actually making it worse on your self, not to mention you can't anyway

worldly skiff
#

Well I'm not, to my brain my approach is more logical 😄

#

I am new to UE tho

frosty heron
#

So what happend with the widget you point in the game instance

#

on Level Load, they get destroyed

#

so u will end up with null pointer

maiden wadi
#

If you want pooling, their containers should do that.

#

IMO, I don't think I'd enjoy UI handling much anymore after using CommonUI and CommonGame.

frosty heron
#

@maiden wadi I'm using Async Open Level, can I somehow retreive the precentage of the load?

worldly skiff
#

Ok with Main Menu it should be easy. I just create a widget object when I need and destroy when I don't. But what to do with lets say Character UI? Its suppose to exist permanently throughout gameplay. So if I were to open a new level, will Character UI widgets get destroyed automatically or do I need to destroy them manually before I open a new level?

frosty heron
#

they get destroyed automatically on opening another world

worldly skiff
#

I mean memory wise

frosty heron
#

so you will have to re-create them in the new world

#

Objects get garbage collected when there is nothing else referencing it

worldly skiff
#

C++ doesn't have garbage collector, but perhaps its built in UE level change logic?

#

Or so I heard it doesn't, idk maybe in new version it does 😄

frosty heron
#

GC runs periodically afaik to clean unreachable objects

#

every game engine have GC

worldly skiff
#

I see, thats good. I guess that allows some level of sloppy programming

frosty heron
#

not sure how

#

it only collects object that are unreachable afaik

#

so if u dereference an object and nothing else points to it

#

the object will get GCed and memory will be freed

worldly skiff
#

Well lets say I do this

#

will it leak into memory or will it be GCed?

frosty heron
#

That will do nothing at all

#

you create widget, then you open level. your widget get destroyed

worldly skiff
#

oh ye true

#

so its just a wipe, no need for GC at all

plucky ice
#

Hi all, this is a more refined follow-up to a question I had asked last week. Has anyone here ever dealt with trying to export data out of Unreal Engine to another format to be used in a data analysis program (like R, for instance)? I was able to successfully create a save game file that gets exported properly and contains all of the variables of interest I would want to analyze, but I am not sure how to proceed from here (save game variables pictured below). I have a bunch of different types of data; my goal is to get this into a .CSV, a JSON, or anything else that's not an Unreal Engine proprietary format so I can use these data later. From what I can find, it seems like JSON might be an option, and .CSV is potentially an option but is a lot more complicated. Not looking for anyone to give me a concrete solution but more so a direction to look into for how I can get these variables "out" of Unreal so I can load their values into some other program. Thank you!

frosty heron
#

GC works automatically on the background

#

u don't have to worry about it

worldly skiff
#

So basically when a new level is opened, all of these actors get destroyed and new ones are created?

worldly skiff
#

and so the only way to pass any data between levels (if I need to) is Game Instance?

frosty heron
#

in multiplayer, there is Server Travel

#

where it's possible to preserve actors

#

and also there is a way to copy player state afaik

#

not far into those yet

worldly skiff
#

I see, thanks!

frosty heron
wicked cairn
#

Anyone know a good system or tutorial that I can use to guide me into making a tracker for the player's achievements? I'm trying to make a sticker book for the player that rewards them with items sometimes whenever they have completed a specific thing. Would I just have a event dispatcher that goes off in the gamemode whenever the player does something that relates to one of the stickers and make a function that does a check for everything each time??

lofty rapids
stoic ledge
wicked cairn
lofty rapids
#

it would be more efficient and probably easier to just call an event when you want to check

#

you could also do on tick but having only run on check would be best imo

#

i like to update things when necessary to get rid of overhead

stoic ledge
placid bloom
#

Event tick isn't really good for time based stuff since the tick will be different from machine to machine

stoic ledge
#

"Using tick groups and tick dependency can be vital to ensuring that your game works properly with regard to physics-dependent behaviors, or sequential gameplay behaviors that involve multiple actors or components." ~Unreal

i just googled it

placid bloom
#

Yeah the only time I've used it was for a physics grab system

stoic ledge
#

i might use it one day ;p

somber elbow
#

Hey guys. I have a bummer here. I have a platform and when character jumps on it it has to go 5 units down and then instantly go 5 units up. Just to show that the player has some weight and the platform goes down once the player lands on it.
I trying to manage it with timeline node. But for some reason the platform just once go 5 units down and never goes back. How can i fix it? Here is the line of code which goes from "begin overlap".

#

Here is how time the track looks like

#

here is a short video

#

the curve goes from 0 to 1 and then goes back to 0. Shouldnt the platform go 5 units lower and 5 units higher back?

lofty rapids
somber elbow
#

hmm

somber elbow
lofty rapids
#

just create a vector and get actor location, then use the vector to the lerp

#

most likely will solve the problem

#

get actor location before timeline save it to a vector use that instead

#

i believe because your pulling live the location a is becomming the location so zero would be a

#

which is where it's at

somber elbow
#

@lofty rapids this works perfectly

#

not sure if its super clean, but it works

lofty rapids
#

i would of used a vector and split it at the end, less wires going all across

somber elbow
#

I always forget that timeline works as event tick

lofty rapids
#

ya something like that, but either way works

jade junco
#

Hey guys, I have an idea for a system where there would be a number of "organizations" in the game world, trying to accomplish their goals and managing property and resources etc. I think a few of these would be AI controlled, which leaves me unsure how best to implement them. If I understand correctly, actors are intended to be placed in the scene, so I am not certain that fits my case here as these organizations are more non-physical abstractions. Does anyone have any suggestions? I believe I'd want them to be able to receive events so that they can be flexible.

somber elbow
# lofty rapids ya something like that, but either way works

One more thing. I finished tutorial series you recommended me here guys. It was dedicated object-oriented programming. So in my game i have 5 types of platforms. They have very different behavior, but still those are platforms. I have 5 different blueprints for each of them. And as i understand its not good at all. Somehow I should keep it all in one blueprint?

#

For example this is just static platform

#

This one is dynamic

lofty rapids
#

i mean it's fine to have them all in there own bp

#

especially if they have different code, you can use one but you would probably end up with a bunch of code on that one thing

#

and add/removing others would just be a hassle

somber elbow
#

yep

lofty rapids
#

i would atleast have them children of a common parent

somber elbow
#

Ok, got it. Thank you so much!

lofty rapids
#

parent classes are nice if you need to loop through all the platforms you can get the parent class actors and there you go

#

also you can cast to the parent, which would work for any one of them

jade junco
#

from a surface level understanding, this does sound like a good use case for inheritance, since they are all platforms, they just do things slightly different

#

if you can pull out common fields or functionality, that would be great, but its also ideal to not try to have the parent do everything, especially if not every child would want a given functionality

lofty rapids
#

i mean even if it's just a blank actor with some variables

#

just having that parent can be real useful

jade junco
#

ye

lofty rapids
#

that has all the events functions you need to handle it since it doesn't need to be displayed

#

run it on tick or some timers

jade junco
#

yea that seems to make sense

#

reading more in the documentation, it seems fine if it is just an actor without a physical representation

maiden wadi
#

StateGraph might help with that unless you want actual BTs

jade junco
#

ohh StateTree?

maiden wadi
#

Er, maybe that one. Can never remember the name.

jade junco
#

oh interesting

maiden wadi
#

It's similar to a BT in some ways, but doesn't require an AI Controller. It can be run on any actor as long as it has that component.

jade junco
#

nice, that sounds good, and I like the layout

#

I do like being able to control things differently than a fail up, I will have to think a bit on this for what different "states" of these organizations will look like

#

it might be as simple as a "generate x resource" or "prioritize growth" kind of thing

dull kraken
#

ive got a component class which is added into an actor class. any way to hide certain variables from component class in the actor class. ive got some values that are defualt at zero and wont need ajusting ever. rather "hide" it if possible

#

oh, im assuming the values I dont want editing ever can be set to private right?

cerulean igloo
#

Hey ya'll 🙂 Need some help with regards to Camera movement and rotation playing together. Below is a simple mechanism for Right (+1) and Left (-1) movement of the camera pawn. I also added rotation which works. Problem is that when, let's say, I rotate to 180 degrees, the right/left become inverted and move in opposite directions, how can I compensate for that? Thanks a bunch!

lofty rapids
#

you may want to set control rotation, or use the rotation of the actor instead of control rotation

#

i'm guessing your rotating the actor, but the control rotation is staying the same, by inverted do you mean the values actually change ? or you just go in the direction of control rotation, for instance what happens if your at a 45 and you try to move right

#

you may be able to use rotation in the details as well

maiden wadi
#

Also don't put these controls in the player controller. Put them in the pawn where they belong.

lofty rapids
#

i put some controls on the player controller so that i could use different characters and keep common controls, is this wrong ?

#

i thought it was fine to put in player controller

maiden wadi
#

What are the common controls?

lofty rapids
#

movement left/right

#

so they all move the same, i have not tried another character yet but i'm trying to make it easy to swap characters

lunar sleet
#

It’s not wrong to have input in the PC if it’s used for more than one thing but if they’re the same parent class might as well just inherit them

maiden wadi
#

Generally better in the pawn. Pawn's should define their movements, not the controller. General reasoning is that non mech vehicles don't strafe. People do. If they all have the same movement and you don't want to repeat it, make a simple parent class.

jaunty solstice
#

Can anyone tell me why I am unable to Cast to BP_ThirdPersonCharacter?
BP_ThirdPersonCharacter definitely exists in my project.
I can see BP_ThirdPersonGameMode but no BP_ThirdPersonCharacter when I cast.

lofty rapids
#

i mean what from ?

tired hollow
#

How do you guys get realistic camera bob? Do you play around with it or do you watch tutorials?

cerulean igloo
maiden wadi
cerulean igloo
cerulean igloo
timber crystal
#

hello guys is there an short key in unreal to see the print string log when im play the level?

maiden wadi
#

Look at the top right of the blueprint. At it's parent class.

lofty rapids
#

idk if you can log in bp might be what your after

timber crystal
cerulean igloo
lofty rapids
timber crystal
#

I just looked but whre can i find the log than in the screen is just for seconds

undone sequoia
#

How I can get parent actor/pawn of child ? when I do get owner I get controller

timber crystal
undone sequoia
#

from this damage causer I am getting child of actor I am using but I need get his parent so I can cast in it

lofty rapids
#

you need to cast to the parent ? for what reason ?

#

things should be inherited

undone sequoia
#

Because I want cast inside parent and get his team so i can compare if its team shooting or enemy shooting, i dont want do it via child as this parent have 7 children which all are different enemies then I would need cast all 7 and get their team

#

but when I have parent I just need cast that one

#

its easier

#

less code

undone sequoia
maiden wadi
#

I'm not following why you don't just cast DamageCauser to the parent class type to get the team?

lofty rapids
#

or it's just a regular actor

#

that would make sense

olive yarrow
#

Hey folks, i could use some Controls help. I'm trying to make my characters spring arm raise and lower when moving my mouse vertically, as opposed to rotating around the spring arms focus point.
Any help?
I feel like the Crane Pitch may be it but i'm not finding much in my subjective google

rain musk
#

hi guys ,I have a blueprint with a spline component,when I delect one single point and I revoke(ctrl+Z),the spline points UI will disappear into the editor, I cant find it anymore and manipulate them.The spline will be a purple colour.So how to refind the ui?

true vortex
#

I want the mouse movement for my controller to be frame rate independent but even when I have it set up like this it still doesn't work as intended

#

Shouldn't mouse movement not change depending on the frame rate?

#

If I lower the frame rate in game its a lot faster and if its higher its the opposite

lofty rapids
#

hmm, maybe try ((mouse sensitivity * axis value) * delta)

#

but i would think your code would work

#

from what i understand about it it would be different value depending on delta

true vortex
#

alright thanks ill try that out! I'll lyk if that doesnt work

undone sequoia
#

guys how I can load blueprints in editor in folder? if they are in folder in windows but not in editor :/

crimson hornet
#

@undone sequoia , blueprint in the file explorer are known as a .uasset, do you have these files types?

Next make sure that the uassets are in the content folder.

undone sequoia
#

😄

lean loom
#

Anyone know how to fix this? Im new to uneal and have no idea how to make my character change flipbook when I press left shift and when I am moving.

lofty rapids
crimson hornet
#

You can use an method called Variable Time Step. @undone sequoia

minor mortar
# faint pasture Your best bet will be to use an array and some helper functions to convert coord...

I didn't fully get what you meant yesterday, but you were 100% right about this. I hadn't looked into Map containers yet, and after some learning this is a really really helpful tool for exactly what I'm doing.

I have my map data now tied to a key that is an IntPoint where the X is rows and Y is columns, and I have a struct that holds all of the various tile data parts I need. Looks pretty neat, has a ton of flexiblity, and is way way way easier to understand. And it's pretty much literally the multidimensional array I was looking for, if only different under the hood and with some call differences. Thanks a ton on this one!

lean loom
lofty rapids
crimson hornet
faint pasture
#

why would the playercontroller be moving?

lofty rapids
#

fixed it

true vortex
#

Which ends up just making low fps mouse movement to be super fast

jaunty solstice
trim matrix
#

hey i have my fps cam set up as a bodycam but i wanna go for more of a handheld look, and how it is rn the walk speed has to be slow for it to not look super bouncy, how would i make my fps camera animations look more like someones just holding the camera

lusty hornet
#

I started with eu5 not long ago. I wanted to make two characters, a tank and a plane, and I wanted to give them attack and defense, but when, for example, I created the life variable in a tank, everything worked until I transferred this variable to the plane, because then instead of a variable, a block with a target(self) was created. Does anyone know what to connect this target(self) with to make it work? because, for example, in C++ it would be possible to extern or import the file and these variables would be transferred, and in blueprint it would be some kind of target(self)

lofty rapids
#

show the code ? you copied something from one bp to another ?

thin panther
#

you wouldn't extern those in C++ though. You aren't importing from some library or assembly, you're accessing a member on another thing

#

the target is essentially specifying what to use -> on

olive yarrow
#

On another note, i'm attempting to have my field of view change slowly to mimic lag when adjusting via a slider. However i can't get it to be slow regardless of what alpha and exponent settings i use. Any help?

molten yew
#

Hey guys, I have this system that lets my player draw on a canvas. I added an extra thing to make it have a set amount that can be drawn and it replaces the oldest drawn thing, basically if the player continuously draws it would look like a snake. I achieved this by having an array and saving the different draw locations and then drawing all of them again (exluding the oldest one in the array). My issue is that this is a costly way of doing it and it's making the game lag. Anyone know of a more efficient way of achieving this effect?

olive yarrow
molten yew
jaunty solstice
#

Blueprint communication is typically a choice between direct, event dispatchers and interfaces.
But is it either or are there times when it makes sense to combine more than one method?

cyan berry
#

im a newbie and cant seem to figure out how to get an interaction system working, does anyone know a good way how

lofty rapids
#

you can just use events or an interface ig

glossy cloak
#

Anybody know why I can't use breakpoints? - No clue why they don't show up by default, but after hitting F9 (hotkey to add a breakpoint to a node) they now show up in the context menu.

glossy cloak
maiden wadi
#

IMO interaction is better done on a component than an interface.

faint pasture
#

And if it's a scene component, voila, you have a place to do the interaction. Like for buttons or door knobs or whatever

glossy cloak
#

For a complete beginner, interfaces can be pretty simple to grasp. Then you can experiment with components and other options. I just think an interface is a good starting point, which is why I usually recommend it.

maiden wadi
#

Interfaces complicate things. You have to implement them on everything and copy a lot of code.

silent kite
#

Super Noob here. Which discord channel would be proper for asking about updating a UI text field?? I'm trying to understand/use event dispatchers for this.

glossy cloak
pallid nest
#

hey guys I am looking at tutorial and I need "Move Component To" but can't find it in my UE5.4. Did this changed in this version or am I missing something?

glossy cloak
#

The most annoying part of interfaces is adding all the functions whenever you need something new.

#

But you'd still have to do the same thing with a component... You just have more freedom to run events on the component, which is nice.

#

¯_(ツ)_/¯

pallid nest
maiden wadi
# glossy cloak Not much different than adding a component to everything.

Except the code copying. Delegates in the component and placing the interaction handling in it allows you stateful interaction. Such as holding on a lever to open a gate over three seconds, and the same component can have immediate callbacks for instant interactions. The same component can have a setting to allow one or multiple people to interact with it to make it faster or not.

And all of this can be easily housed in a single component where to use it you simply add it to an actor, implement it's delegate to handle whatnever needs done when it's interaction completes. Other components on the same actor can also even bind the interaction complete delegate for even more reusable code.

To do this on an interface. You start copying code from the very beginning because all you get for reuse is the function call and implementation. As a beginner, composition should be the first idea taught because it's the core of Unreal. Actors house Components and components house logic. Learning to not copy code is a critical skill early on to learn to abstract things correctly so that your project stays cleaner and easier to work with.

glossy cloak
cyan berry
#

follow up on my previous question, how would i get this blueprint with a sphere collision to check whether or not i press a key, and do something (like play a sound) when i do press it while inside of it, then remove the ability to do that again? ive tried adding a variable in my player blueprint but i dont know how to grab that variable inside this blueprint.

maiden wadi
# glossy cloak Those are all excellent use cases for a component. I 100% agree. I've honestly n...

Even then I'd say just cast to the actor off of the line trace or whatever. IMO, interfaces are just a bad habit to teach. In a scaling project they have a few niche actual use cases. Core classes and composition take up most of the cases where you'll need to do something with an entity. Largely because of the reusability of it. Interfaces only really work in minor parts to give some systems functionality. UMG's Listview comes to mind. You can't always know the class to be used there, and when it was conceived, UMG had no concepts of composition. So interface filled tha gap. If it was made today it could probably use the new UMG extensions.

Day 1 Unreal? Learn casting. It's crucial to know. More crucial to understand that it's not a bad thing despite a lot of criticism around it from people who don't understand how linkers work. Can't even really say day 1. Took me a month before I could vaguely grasp what it was doing. My first couple weeks were following the same set of tutorials multiple times to get used to concepts.

And more so on the note of avoiding interfaces, it's really difficult to follow. I work with UI a lot. I'm usually the person who has to expose API for UI. Which really sucks, because that also means my job requires me to follow along and understand the gameplay systems because most times I have to add that logic myself. So I not only do my job, but clean up systems after gameplay programmers. And having had to follow both interface and composition in a scaling project, I'd choose composition any day.

#

EG say I need to add a progress bar for interacting with an actor. To do this with an interface. I need to add a new function to the interface. I need to go through every single thing that uses this interface and manage to implement that function in every one of them to pass back the interaction time and requirement for finishing interaction. I need to care about the objects using this component because these objects needs to store the state of interaction themselves. I have to add multiple interface functions here. GetCurrentInteractPercent, GetMaxInteractTime, GetInteractUserCount, etc. Then each interactable thing has to have properties put on it. InteractionTimeRequired, MaxInteractionUsers, CurrentInteractionProgress. Could be one base class. Could be ten different classes. Could be fifty. Then after all of that work I can finally go to the widget that has to display it. Use the object passed in to call those functions.

On the other hand with composition. If someone made a component with nothing exposed. I don't need to do anything extra. They're already tracking time required, might need a percentage getter. There's already a delegate that the actors are probably using for completed/interrupted. I literally just need to look at the one component. Maybe make a couple minor function updates, and set up the widget. I don't have to care in the slightest about what is using it, because the logic is generically in the component.

#

And making it is just as easy. Make the line trace hit an actor. Cast to the actor and do logic there. Get your stuff working. Then when you want a second type for interaction you simple make a new component. Add a completed delegate and call it immediately on interaction started. Make the line trace find the component on the hit actor and call start interaction. Then drop the component on the actor and implement the delegate and replace the original function call. You're now using composition on that one actor. To set up a second you simply add the component to a new actor class and implement the delegate. Then you can start putting in more complex interaction logic. Hold times, or more users if you're doing singleplayer. Nothing really changes on the actors, they just run logic when it's completed. Can maybe make a new delegate that broadcasts percent changes for the hold times, etc.

maiden wadi
cyan berry
#

just be near it

maiden wadi
#

Your F key can do a sphere overlaps actors call. For each loop over them and cast to the class and call a custom event. That custom event can play the sound.

cyan berry
#

it worked, thanks

agile moss
#

So I have platforms that spawn automatically, but it looks very boring. I want it to start as white then fade to the texture. Help?

frosty heron
#

What are you struggling with?

#

Look up dynamic material instance

#

And lerp mode for material

agile moss
#

Okey Dokie

silent kite
#

Hey I'm struggling to update a text field in my UI using an event dispatcher.. I've created the 'call' to the dispatcher within an actor (there are about 25 of them within the level). Once they get a collision, the event gets called and I want to update a count field in the UI. Within the UI widget I'm struggling to listen for it. The bind event wants a reference to the actor and I don't know how to create that. or even why I would need it. Once the collision occurs, I just want to increment a text string on the UI by 1. Who cares which specific actor was creating the event. Is there a work around I'm missing or another way to figure out how to update the text field in the UI?

frosty heron
#

You need to understand references and how to set an object ref to the instance of the world

#

You want to set the text according to info of some actor in the world. But which actor? You have to set the object ref to point at the instance you want.

hot pulsar
sinful bane
#

Hi,

I'm working on a ground slam animation and need help positioning the damage area near the tip of the weapon. The weapon is its own actor, attached to the player/AI, so I can't directly get the socket location.

I thought about creating an interface to return the equipped weapon's position. Any suggestions or alternative solutions?

sinful bane
agile ridge
dark drum
sinful bane
dark drum
sinful bane
agile ridge
dark drum
# sinful bane No just an player actor spawning the weapon actor and attaching to the player

Ok, I would first suggest you rework how that is handled. It sounds like the player and AI would end up handling the same thing differently.

As an overview, it would be beneficial having an actor component that handles equipping items (and storing a ref to the currently equipped item) that you can place on your characters. (Both player and AI) That way from the anim notify you can get the owner of the skeletal mesh then get component by class to get the 'equipment handler'. From this you can then get the current weapon being used.

sinful bane
agile ridge
dark drum
sinful bane
agile ridge
sinful bane
agile ridge
dark drum
agile ridge
#

Alright, I'll let you two hash this out then.

sinful bane
#

Anyway thanks guys will try this out

dark drum
cerulean igloo
#

Not sure why clicking on a unit doesn't fire an event, have this set up:

#

Configured trace channel and controller is using it

gaunt monolith
#

Hey everyone, i'm really struggling to make a daynight cycle and then have the day/hour/minutes show up in an in game clock, can anyone point me to the right direction? Maybe a good guide or tutorial?

#

appreciate more a guide/tutorial that actually explains how things work so i can learn

frosty heron
#

Or the 2 hours one by epic for more comprehensive guide

faint pasture
#

That's the simplest

#

the widget will check the time every frame

#

the time will be updated everywhere when it's updated on the server

#

Of course the whole setup can get vastly more involved than this but it'll get you started

gaunt monolith
gaunt monolith
faint pasture
#

Since WhatTimeItIs is a replicated variable, everyone else can just get it and know what time it is

#

and do whatever they want with it

gaunt monolith
#

I assume i need to have a daynight cycle already up and working before doing this?

frosty heron
#

Are you doing multiplayer?

gaunt monolith
frosty heron
#

You don't have to worry about replication then 😅

#

Your widget job is simply to read

#

You typically want to make an actor that is responsible to hold the day and night system data.

#

The actor will hold are the variable. Time, day, weather, etc. Your widget can then get a ref to the actor and grab the information

faint pasture
#

And that actor should be the gamestate or a component on the gamestate

#

since a part of the state of the game is what time it is

#

presumably

gaunt monolith
#

I think i understand now, thank you both 🙏

cerulean igloo
faint pasture
thin panther
cerulean igloo
faint pasture
#

how far is camera

cerulean igloo
cerulean igloo
#

just reduced spring arm length. still not firing 😦

#

What's crazy is that I made this work in this other tutorial I've done and I redone all the steps the same way, and it's not firing. Although using Manny instead of other mesh but shouldn't matter maybe?

faint pasture
#

I'd ignore mesh for now and make it hit the capsule

#

maybe something is in the way and blocking it

#

line trace on tick along that channel and make sure it's hitting

cerulean igloo
faint pasture
#

do some line traces or try get hit result under cursor to make sure the hit is happening

#

you gotta figure out if the hit isn't happening, or if the rest of the click stuff isn't happening

cerulean igloo
#

Global clicks are firing

#

like on left click anywhere in the env are ok

faint pasture
#

if you have the capability to line the camera up with the pawn try a line trace along the camera aim direction and make sure the capsule is blocking it

#

make sure the channel is Cursor

cerulean igloo
#

Is this what you mean?

faint pasture
#

whatever has your camera

#

just line trace from cameracomponent.location to cameracomponent.location + SomeLargeNumber x Cameracomponent.ForwardVector

cerulean igloo
#

Sorry, Do I draw a line trace on game start or on click? or draw and try to click it? or draw it over the pawn/char to see the trace is over or under it? I'm not sure I'm following

faint pasture
#

every frame

#

Tick -> line trace by channel with debug turned on

#

you'll see if it's hitting the thing or not

gilded jewel
#

I'm trying to set an alternate camera as the player cam when possesses an actor, i seem to have it working, but there is a visible glitch as it swaps using SetTargetViewwithBlend.
Is there any way to stop it defaulting to the player character cam (on possess) ?

faint pasture
gilded jewel
gilded jewel
#

theres about 30 nodes in between this and the event, but this is the spawn

faint pasture
gilded jewel
#

before

faint pasture
#

multiplayer?

gilded jewel
#

its partially replicated .. but doesn't need to be. The possess is

cerulean igloo
faint pasture
#

honestly if you're doing fancy camera stuff why not just manually drive the camera around and get rid of camera components?

cerulean igloo
lofty rapids
#

your start and end are both zero ? you may need to get the cursor position ?

lunar sleet
cerulean igloo
#

😄 yeha realized that as soon as shared scr.. changin now

faint pasture
#

also you're starting and ending the trace at 0,0,0

#

probably not what you want

#

start at camera location

cerulean igloo
#

Probably not yes

faint pasture
#

end at camera location + camera forward vector * somelargenumber

lofty rapids
#

are you trying to get what your looking at ?

cerulean igloo
#

I'm trying to see why clicks on capsule are not working when global click events are fine

gilded jewel
faint pasture
cerulean igloo
#

getting bunch of trues now but no drawings

gilded jewel
faint pasture
#

and probably do a single line trace not multi

lofty rapids
#

i would also multiply the forward vector by a float

faint pasture
#

yeah or at least 100k in all axes either one

cerulean igloo
faint pasture
cerulean igloo
#

in BP_PlayerCamera:

lofty rapids
#

well for one thing you didn't plug your end in

cerulean igloo
#

ugh!

lofty rapids
#

and for two your multiplying by zero

#

which will be zero

cerulean igloo
#

sry. a bit tired

#

fixed both

lofty rapids
#

i don't know how this is supposed to help you with clicked capsule

cerulean igloo
#

I'm not sure either. I'm going where Adriel points me and hoping for the best

#

Trust the process

#

🙂

#

Tried everything else. The checkboxes, the collisions

#

none of these will print

#

this does though

lofty rapids
#

do you have click events enabled in your controller ?

cerulean igloo
#

yessir

#

also, capsule collissions are blocked on cursor as well:

faint pasture
#

show current code

#

and how far is camera?

cerulean igloo
#

target arm length: 2000.0 (from springarm)

cerulean igloo
faint pasture
#

that's 10 meters

#

convert that pin to a float too btw

#

and do a single line trace

#

we're trying to see if the traces are hitting at all or if there's something in the way

#

do a 100k trace

#

single line trace by channel

lofty rapids
#

or change the trace for the click events

cerulean igloo
#

That's what I did

olive yarrow
cerulean igloo
cerulean igloo
faint pasture
#

right click it, convert to float

#

plug 100k into it

lavish veldt
#

Hello! How would it be best to keep a 10 slot inventory in a save game? Just a class array?

faint pasture
#

if all you care about is the class for an item then that can work

lunar sleet
#

just realized you can't use set timer by event on events that require an input 😅

cerulean igloo
faint pasture
lofty rapids
# cerulean igloo

i think you changed the wrong one, the multiply forward vector you want to change that

lavish veldt
faint pasture
#

or just type 100000 in all 3 coordinates

#

right now you're multiply your forward vector in a way that skews it

cerulean igloo
#

sorry about this

faint pasture
cerulean igloo
#

done

faint pasture
#

and lose the green stuff

cerulean igloo
#

still error

faint pasture
#

remake that add

#

idk how you even did that lol

cerulean igloo
faint pasture
#

is this camera on the character BP

#

turn off ignore self if so

cerulean igloo
#

camera

faint pasture
#

we're looking for red hit markers

cerulean igloo
faint pasture
#

click the arrow on the bottom of line trace by channel to see what the colors mean

cerulean igloo
faint pasture
#

yeah you're hitting something right in front of the camera

#

print hit actor

#

from hit result

cerulean igloo
faint pasture
#

break out hit

#

lots of info in it

cerulean igloo
#

It's hitting my PCG component that I have disabled for now

#

as in it's not showing but still gets hit

frosty heron
#

Print hit component

cerulean igloo
#

Doesn't make any sense. I have disabled the PCG generation

#

but obv is still placed I guess there (yellow)

#

I move it away, then it's another PCG (one for buildings..)

#

Seems like those PCG placements are the problem..?

faint pasture
#

you want hits vs his capsule

cerulean igloo
#

That's exactly what I'm doing now

faint pasture
#

then check if clicking works

cerulean igloo
#

bingo

#

it does

#

PCG's blocking it

#

PCGs are blocking it

faint pasture
#

hell yeah

cerulean igloo
#

sigh

#

Thanks

faint pasture
#

so just make pcg not block it

cerulean igloo
#

That was... something 🙂

faint pasture
#

is cursor a custom channel?

cerulean igloo
#

yes

faint pasture
#

why do that instead of visibility?

#

is the default response block?

#

First off, how many things do you want to be able to click?

cerulean igloo
#

Default response is not block for visibility

faint pasture
#

like, everything? or just some things

cerulean igloo
#

everything

#

Chars, buildings, ok, maybe not trees

faint pasture
#

You might have better luck using Visibility since most premade assets will have sane responses to it

#

or you can default Cursor to ignore, then opt in to blocking it in the things you want to block it

#

I'm guessing the default response to cursor is Block, meaning anything that doesn't indicate otherwise (your pcg volumes, literally anything) will block it

#

I think typically Visibility is what's used for clicking and such

cerulean igloo
faint pasture
#

might be a lot easier

#

I'd just use Visibility for click stuff

#

unless you have some reason not to?

cerulean igloo
#

trying to recall why I did that

#

this is on Capsule component

#

with just visibility it didnt' work

faint pasture
#

btw I think you can change collision presets

#

so you can set Pawn to block whatever and other things to not block or whatever you want

cerulean igloo
#

Custom right

faint pasture
#

anyway, problem solved, your clicking was blocked.

#

no you can change what Pawn means

#

as a collision preset

cerulean igloo
#

Right

#

many ways.

faint pasture
#

so you could have Cursor default to Ignore but Pawn preset blccks it

cerulean igloo
#

I'll probably reconsider using special channel

#

Thanks. This was v useful and illuminating

faint pasture
#

yeah there are uses for it but I think visibility might be best. Depends on the design and other things. I think visibility is what AI uses for sensing etc

cerulean igloo
#

Spent 3.5h but Learned other adjacent stuff

faint pasture
#

thats probably why it doesnt block it

#

otherwise AI couldn't look past other AI pawns

cerulean igloo
#

OK, I think I had a days fill of UE

#

thanks Adriel, engage

deep void
#

Hey Unreal Gang!
I have a project in which i have a player controlled train moving along a track/spline.
I want it to have controllable real world speed, but have noticed all the tutorials i find are based on a timeline to move the object along the spline.
So my speed is always depended on how long the spline is, which is not what i want.

Any ideas or resources to set up realistic speed in blueprints?

faint pasture
molten yew
# faint pasture Tick -> PositionAlongSpline += Speed x DeltaTime -> update position

Hey can you help me with this? I have this system that lets my player draw on a canvas. I added an extra thing to make it have a set amount that can be drawn and it replaces the oldest drawn thing, basically if the player continuously draws it would look like a snake. I achieved this by having an array and saving the different draw locations and then drawing all of them again (exluding the oldest one in the array). My issue is that this is a costly way of doing it and it's making the game lag. Anyone know of a more efficient way of achieving this effect?

faint pasture
#

I doubt you have to clear and then loop and draw every frame

#

why not just not clear then draw on top

molten yew
#

Basically I have the system so it replaces the oldest drawn thing (the water pools), making it so there is a set amount in the world at a time

ruby egret
#

Anyone ever package their game and when you play it an entire blueprint is missing? I have an actor BP for ammo boxes all throughout my level, but when I package my game thet're not there. First thing I thought was if the "is editor only" in the cooking tab of my actors details was ticked but it nor any of it's components were. I don't know if I'm setting the mesh incorrectly, or if something funky is going on with my saves/loads. The last package I did had the ammo BPs fully functional and I hadn't made any changes. Anyone experience this?

#

Thinking I could just be assigning a mesh that isn't getting loaded in correctly?

tired hollow
#

Can anyone help me? I made a BTTask and defined a key in the blackboard, and it's not letting me set it here