#blueprint

1 messages ยท Page 185 of 1

jade wedge
#

Hi guys!

I got a quick question in case anyone has ever tried it already; If a Character Component has a Blueprint interface inside it; Would the character count as having the interface as well?

For example;

If the player character has a character component with a Blueprint Interface that has function "Do Something".

Would just getting the "get Player Character" and send out the Do Something Message count for it to be executed?

outer terrace
#

you'd still have to call the interface actions through the component as thats where the interface itself is recognized. you can still call the action through the PlayerCharacter though.

for instance if you have an inventory Component that contains an InventoryInterface and wanted to create a "hotkey" to equip an item in the inventory...


InventoryComponent->IIventoryInterface::execute_DoSomething();```
#

but it can be called on the playercharacter as long as the actor component is valid

maiden wadi
#

What are the reasons you think it's not using the right one? Haven't seen this issue before.

ruby egret
# maiden wadi What are the reasons you think it's not using the right one? Haven't seen this i...

The engine not using the right one is apparently a somewhat common reason for the problem I'm describing https://forums.unrealengine.com/t/casting-to-game-instance-always-fails-when-packaging-the-game/392414

#

But that's not the issue I'm facing

maiden wadi
outer terrace
#

interfaces are nice because they are optimized. dont need to cast can just check if specific actor implements interface.. also if i remember right when you do get component by class, the engine searches all available classes until it finds the right one.. so it can tax the system using that a lot when you have lots of classes

#

and the less hard references you use, better in the long run

#

just better coding practice

maiden wadi
#

Explain to me how interfaces are more optimized than a cast to a coding class.

jade wedge
outer terrace
#

so interface can be used across all actor classes.. if you cast its hardcoded to one specific actor class. also casting saves that data in memory until garbage collection removes the actor that called the cast.

jade wedge
# maiden wadi Why would you bother with interfaces when you already have a component? Don't co...

I honestly am trying to not use hard references to make the project easy to be expanded and scaled to what I need it with common codes/features I d use for most of my projects;

Wanting to combine Interfaces with Component as I have some instances where the call to the interface is basically to execute the code in the component; So trying to organize better and leave the character with not be over bloated with functions and leave mainly stuff that actually has to occur within the character.

At least that is my current idea for now

outer terrace
#

they both have their uses.. sometimes you do need to cast, no way around it.. for instance if you have a custom PlayerController and want to call a function off that off your charactger.. you need to cast to the custom player controller class to do that function.. its no big deal that the reference to the custom player controller stays in memory because it should always be vaild while your character is valid as its the controller its using.... and you're not changing PlayerControllers.. so the reference always stays valid as long as the player is valid.

however doing hardreference / casts to other objects by class when those objects might load/unload... if the object ends up being destroyed, the cast reference stays in the system as a nullptr.. until the actor (your character in this instance) is deleted and garbage collected. if you keep doing more and more casts like this.. eventually you can cause problems

#

thats where interfaces are king

outer terrace
maiden wadi
#

The thing is. Interfaces are nothing but a patch to fix things when you cannot use inheritance or composition. The fact that people have used it to break up linkers doesn't not mean it's meant for that, and it does not mean that it's a good use for it.

If you want to make a good clean project. Make good code classes you can cast to from anywhere. It doesn't matter if they're linked to everything and always loaded because they're small and have no assets linked to them that you're forcing to keep resident. This is how C++ classes already work. Every C++ class in your project is always loaded. You can do the same with BP classes.

There is nothing wrong with hard references to code only classes. The issues that made people start abusing interfaces are because people are unwilling to learn how linkers work and unwilling to structure things sanely, so they just interface everything until linkers break and they "magically" end up with less stuff loaded sometimes. Not understanding what should be loaded and when and what should be allowed to be linked is a huge detriment to project structure.

As a UI Engineer, I absolutely despise interfaces. I need an API. And being able to follow inheritance or composition is a lot easier than tracing some madman's use of interfaces. As a gameplay programmer I hate interfaces. A thing is a thing and it should have a set use. Composition allows me to place an inventory on anything an access it from anywhere by simply getting the component from anything that has it.

Also. I'd like to point out that runtime speed wise interface functions are slower than a cast and direct call. They're about the same as composition by finding the component of a class and calling.

maiden wadi
ivory spoke
#

is there a way to get a actor by guid?

ruby egret
#

Actually did that a while ago with no luck

#

you mean the packaged games save data in appdata right?

maiden wadi
# ivory spoke is there a way to get a actor by guid?

Depends. They don't have guids by default. They have names based on their owners. If you've placed actual FGuids on your actors, you would need to manage that yourself.

To get an actor via name though is as easy as constructing a SoftObjectPtr in C++ from the name path and resolving it to a hard pointer.

maiden wadi
ruby egret
#

Wait in the project directory? You mean removing the "saved" folder that contains the autosaves, logs save games, screenshots etc?

ruby egret
maiden wadi
#

I'm mostly just wondering if something is overwriting the ini somewhere, somehow. There aren't many other reasons that the class would be wrong.

dawn gazelle
dawn gazelle
# ivory spoke is there a way to get a actor by guid?

You may want to work the other way. The actor knows its GUID, it can read the save data about itself rather than you trying to find that particular actor by its GUID. For dynamically spawned objects, you'd keep their data in a separate array as you'd know you'd have to spawn them again in order for them to exist.

undone bluff
#

what's the proper way to make a float return 0 if it's negative?

queen dagger
#

ok so upon further investigation i have this overide for the spawn

#

its not being called when loading the story mode map

ruby egret
queen dagger
#

thats the story mode map and i have the bpgm selected so i dont know if something im doing elsewhere may be cuasing the mess up

maiden wadi
undone bluff
ruby egret
#

That works too

ruby egret
undone bluff
#

plugin called crystal nodes, but the dots themselves are just part of the theme that comes with it

ivory spoke
ivory spoke
undone bluff
# outer terrace interfaces are nice because they are optimized. dont need to cast can just chec...

actor components are generally just logic, so as long as the references in there are kept in check hard referencing them is fine.
get component by class if you do not know whether the actor in question has it, but the more optimized way is to access it directly through casting and good use of inheritance.
For most usecases it should be negligeable though, these kinds of functions are actually decently optimized internally and not just brute force.
Get all Actors of Class, for example, uses a hash and can be cheap as long as you don't have tons of subclasses of the class you're getting a reference to

lofty rapids
#

i created an id variable

undone sequoia
#

Why when I play in ue5 my game or when I package it I have very weird fps mostly from 180 to 230 they are jumping like 180 190 220 190 220 etc it is causing me problems in game with many things where I do use delta time because this delta time is then different and not constant and I get lags for example in trajectory prediction or movement prediction any tips ? I don't want fix this FPS for everyone :/

I thought FPS should be at least a little bit constant

frosty heron
hard kettle
#

Is it possible to hide an inherited variable in blueprint?
I'm making child of a sphere component, and I want to rename the "sphere radius" variable/restrict how it can be set

lofty rapids
# frosty heron For what purpose?

so that each item in the level has an id, and i have an array for all the removed ones like if you got an item it won't spawn it again, because it's all loaded on the fly

hard kettle
lofty rapids
#

i to string it and use that

frosty heron
#

Oof

lofty rapids
#

because i need to store it all in a string

#

i use strings for a lot of different things

frosty heron
#

At least use name or gameplay tags

#

You shouldn't be using strings especially for many things

hard kettle
lofty rapids
#

well i store the level data in string array, and spawn accordingly it works great tho so i don't see a problem

hard kettle
#

if you're serializing it, you can do that when you need to save it

#

using strings for all your datatypes is inefficient and can cause so many headaches

lofty rapids
#

i'm building the level, then displaying it because it's randomly generated, instead of generating each section randomly when it loads, you can go back and forth in the level

#

i build a string array and use the index to display the current section, i have not had a problem i put most of it in c

frosty heron
#

I will make a bet that most people that know what they are doing will despise using strings for anything like that. Just my 2 cent

lofty rapids
#

so how would you do this then ?

#

spawn a level that is only loading the current sections

frosty heron
#

I don't know what I'm doing, ask other people that know what they are doing

lofty rapids
#

well i've heard strings are slow but i have not had a single issue with it

#

even the actually spawning is done in bp

#

and it's fast af

frosty heron
#

Until you do

#

I ignored suggestions too and think hard ref are fine

lofty rapids
#

i been messing with strings for a long time i think i got this

#

but strings give me the most benefits for what i need, i need to be able to write it to a file as well

#

so i just pass a string into a function and write to file

#

so i could save levels, or allow custom ones

#

i really couldn't think of a better way to do it

#

for instance if you are on section 3 which is about the size of the screen, then section 2,3,4 are loaded

frosty heron
#

That's when I will ask the experts

lofty rapids
#

so the whole level isn't loaded it's actually good on memory

frosty heron
#

If you can't think of a better way

lofty rapids
#

it's really the best way imo, i've asked before and got no answers, i've seen a few different procedural generation things but not exactly what i want, like i need only the sections that i'm on to be loaded and do it efficiently

#

there could be a 50,000 section level for instance all with stuff you can pickup

#

and i use some maths to get the section in the string array, and use the strings to build the map

frosty heron
#

That's even more worrying if you got that much data to process and using string

#

But I already said my piece

#

Gtg clock on to work now, gl

lofty rapids
#

it's actually slow in bp i can generate like 1000 sections reliably

#

but the actually loading from the is done in bp, but i parse the string in c

#

because i have heard it can be slow strings so performance ftw

dusky cobalt
#

Is there any simple way to remove Nav Mesh around spawned actor? I realized currently there is still anv mesh under the spawned building and that is why units are trying to go by the building like the could, but they get ugly blocked.

#

That is happening only when I spawn actor on run time, all other actors are that are in the game dont have nav mesh around them.

dark drum
# lofty rapids it's actually slow in bp i can generate like 1000 sections reliably

I'm with cold on this one. I only use strings when I need to save the data.

When dealing with procedural stuff you tend to have to do a lot of calcs and the performance with working with strings does get slow. I ran into many performance issues when I do some BP only procedural stuff. Using the right var type made a massive difference.

From your screenshot though, it doesn't seem like you'd actually need to use a string for all your data.

lofty rapids
#

i mean i'm generating this on the fly, it's an array of strings, what is a better way to store them ?

#

i want it to be stored, and i only see the sections i am closest to for performance

#

so the whole level isn't loaded

wraith loom
lofty rapids
#

so i would randomly generate several levels ?

#

thats a lot of data

#

can you even do that ?

dark drum
lofty rapids
#

save game object ?

#

so use the save game every time i generate these levels ?

#

i generate them every time i build a level its different

#

it's all weighted

#

it's actually really quick i don't even notice any skip or any drop in fps

dark drum
# lofty rapids so use the save game every time i generate these levels ?

The data needs to be stored somewhere. If they don't need to persist you can just use a uobject.

When I was looking at procedural stuff, I used a uobject base for each section that contains all the relevant data for the section.

This is what I did a couple of years ago.

https://youtu.be/Ilj7LORjBew?si=p8TT83EYQGeoQ8bc

This video showcases the work I've been doing regarding the procedural terrain generation within UE4. Everything I've done has been using the blueprint system.

The generation system currently has limited support for biomes to help add more variety to the world.

In addition to the terrain generation, there's also a day night cycle.

โ–ถ Play video
lofty rapids
#

if for some reason i can't resolve the performance with c++

#

then i'll look into another way, maybe when the levels get bigger i will notice it but the section sizes never changes

#

so it should be consistent

#

i mean with an array of strings i built a 50000 section level, each section is about the width of the screen

#

basically an endless gameplay

quasi steppe
#

how can ฤฑ fix this note

lofty rapids
# dark drum What data is in the string?

well its an array of strings each string is a section, each section has multiple strings split with ;, and in each item it looks like `itemType:x,y,z,sx,sy,sz:itemId:theme

#

something like that

#

and it's generated each time by building the string

dark drum
dark drum
lofty rapids
#

generate a random structure ? and have an array of structures ? how would i display only the ones that in the current section ?

#

i need it in an array, basically an array in an array

#

multidimensional array

#

so that each section can hold all the items

#

the math is real simple load up this index in the array

dark drum
lofty rapids
dark drum
#

Alternatively, you could use uobjects for for the section and just store the uobject. I would probably use a uobject as you can add functions to help populate the data inside itself.

lofty rapids
#

so a uobject with a variable that is an array of structs ?

#

my way is so much easier

dark drum
lofty rapids
#

i need an array in an array

#

so i did it with strings

hard kettle
#

Is there someway to hide/rename the sphere radius variable in an inherited class using blueprint visbility? I don't think there's a normal c++ way to do it

dark drum
hard kettle
#

I suppose the easy way to do this is to just store the entity radius variable in the main actor, and just set the component

#

Seems easier than this lol

lofty rapids
hard kettle
#

Thanks for the ducky

lofty rapids
#

this is all thats actually loaded during play

#

but your zoomed in on the player so you don't notice it

odd kiln
#

Hi all !

#

Does anyone know a good "temperature" system tutorial / guide or if anything like that is already implemented in UE5 ?

dawn gazelle
#

Sounds mostly like a float being manipulated.
If you were wanting to handle your player getting hot or cold, then it would probably be a component on your character and you could have actors that have overlaps which trigger your temperature component to start shifting the temperature up or down, and your component starts to adjust the player's temperature over time. When outside of these fields, the character's temperature attempts to normalize to a default value that you set instead. All the over time stuff could probably be handled by a timer as you may only want to adjust the temperature periodically rather than every frame.

lofty rapids
#

so i could in theory go even further and shuffle it

#

while still keeping items and drops not respawning

#

i always like to use strings, i'm not going to not use it because i heard it was less performant if it works and is performant

#

but if i hit a snag i'll look into a better way

dark drum
odd kiln
lofty rapids
#

it can vary i can generate any size level

#

50000 is just a big number that is pretty much just an experiment

dawn gazelle
#

Can you generate a -5 size level ๐Ÿ‘€ ?

dark drum
dawn gazelle
lofty rapids
#

so it's pretty efficient

#

i haven't tried to actually generate the sections on the fly i just build the build pre built and load up the right sections

#

a little bit of a tricky way to have a multidimensional array using strings

#

but it works really well

#

i'm actually doing quite a bit on tick and it seems to handle it fine

kind estuary
#

@maiden wadi As we were talking before with the issue with the structs. This post on reddit solved the issue completely:

https://www.reddit.com/r/unrealengine/comments/6cs24g/unknown_struct_structname_has_a_struct_type/

Basically need to go on the output log, and find every single place where the structs are used. And compile and save each one of them.
I think this is quite a bad thing to do, that everytime you change a struct you might have to go to this pain. But at least there's a solution.

maiden girder
#

Anybody know why The enhanced action node Look on one of the nodes an x and a y value when on this other node there is only one value

lofty rapids
#

the value type is different

sonic sigil
#

Hey guys how do I make my enemy dash through the player? How do I turn off collisions against pawns only for a moment?

dawn gazelle
# kind estuary <@143471961723371520> As we were talking before with the issue with the structs...

There's two ways I know of to avoid this problem:

  1. Plan the structure of your data before using it and don't deviate from it if you're using a blueprint structure after you started using it. Prepare yourself to have to do the work you're describing if you do change it.
  2. Define your structure in C++. It's less likely to have issues even if you manipulate it. Worry less about having to do the same kind of work, though there still might be some fixing up if you modify it.
maiden girder
#

@lofty rapidsAwesome Ty

fading harbor
#

Total beginner. When I see a node in BP how do I find its "true name" in the node search menu? I learned the trick to paste it into notepad and I get this following info:

Begin Object Class=/Script/BlueprintGraph.K2Node_VariableGet Name="K2Node_VariableGet_0" 
[trimmed]

But I don't see any results for "K2Node" or "VariableGet" in the node search menu

#

There are so many different nodes named "get" that I can't figure out what this one is

lofty rapids
#

i'm not sure you can actually just put that in like that

#

usually i get

#

then right click and convert to validated get

fading harbor
#

what sort of "get" is this node? I tried GetPlayerCharacter but it is a totally different class of node

#

which subcategory am I looking under

fading harbor
lofty rapids
#

its called a validated get

#

but you right click and convert it

#

i don't think you can just search for it in there

fading harbor
#

right click what original node, specifically? totally new sorry

#

like i right click ___? to convert to a validated get?

lofty rapids
#

so do you have a variable ?

#

on the left side in your variables

#

theres one you want to "validate" ?

fading harbor
#

oh! these are related, then

lofty rapids
#

ya so there you have character as a variable

fading harbor
#

so i will just drag it in like any other

lofty rapids
#

ya, then right click it

fading harbor
#

got it, thank you

kind estuary
next hollow
kind estuary
next hollow
#

I'd need to re-find it, since I've given up on the project I used it in.
Was pretty generic and direct naming IIRC.
Legit like refresh all files

kind estuary
kind estuary
#

is it this?

#

So for example, according to what @maiden wadi said. Its bad for a struct to have a reference to another struct, and that struct also has a reference to this struct.
So for example I have DT_Weapons, in there i have the S_Weapons, that has a variable S_Munitions.
Then I have DT_Munitions, and in there I have S_Munitions that has a variable S_Weapons

#

is this what can cause the problems?

next hollow
#

I've never heard of running into issues of structs in structs.

Just personally had issues when adding or removing (especially removing) a struct value, and a ton of my game files failing to compile

kind estuary
#

yeah but i think this makes sense because it creates circular reference @next hollow

#

idk

next hollow
#

I done so many sus circular reference things, yet never ran into issues.
Yet, I know some people who legit have a player reference an item, and the item reference the player, and there game just crashes.
So, idk

thin panther
kind estuary
#

its bp only

#

prefer bp full, closing and opening editor for compile counts as cardio ๐Ÿƒโ€โ™‚๏ธ

thin panther
#

but then you run into problems like this :P

#

Better to fix it at the source

#

If you're only writing structs in C++ you shouldn't be compiling that often

#

Or as Datura said, pick a layout and never change it. Ever

#

(It's still possible to have problems, but you're a lot safer)

kind estuary
lunar sleet
#

wut?

#

what gave you that idea?

thin panther
#

Yeah, again not really

kind estuary
#

the project is like 500 mb, turn it to visual studio solution becomes like 1gb

thin panther
#

the .vs folder can be bulky, but if 500MB is make or break, Unreal is not your engine

lunar sleet
#

a whole 500mb eh?

thin panther
#

plus the .vs folder is going to be rather small with a single file for structs.

#

and it's temporary, you can remove it at any time with no penalties

#

Other than that the solution file and the vcxproj is no major storage space

kind estuary
thin panther
#

you didn't have any xp with unreal until you decided to use it :P

kind estuary
#

so i can create my structs

#

and then delete the c++ bloat?

#

i thought it was irreversible

thin panther
#

C++ isn't bloat

#

And no you can't delete your source files afterwards

#

but source files aren't bloat

#

the sln is a small text file, the vcxproj is relatively negligable, and the .h file is also just a text file.

#

You're getting some pdb's, but only for a handful of files at most.

#

The bloat from a C++ project comes from the .vs folder which is just stuff like intellisense caches and IDE project settings

#

And yes, you can remove that

lunar sleet
#

the biggest sizes come from assets not code

kind estuary
#

remove it, and then use the generate project solution when needed

#

cause im low on space too

frosty heron
#

I don't think giving a pinky promise to ever change it is a fix

#

If it were me just don't use it

#

Why play with landmine

kind estuary
#

because its comfortable to just create the struct in the editor and be done with it

#

but then ๐Ÿ’ฃ

frosty heron
#

Because you are not used to it

lunar sleet
#

what would be comfortable is for you to get a drive where 500mb is not a concern

frosty heron
#

And it's not comfortable to break your project

#

I've broke mine once

#

And that's one too many

lunar sleet
#

yeah

frosty heron
#

Problem with bp struct it's a silent killer. The unknown struct error appears during packaging

lunar sleet
#

if you're going that route, make sure to also give yourself reasons for not having source control, so that you can have a complete "solution"

kind estuary
lunar sleet
kind estuary
#

and civ 2

thin panther
#

the temporary vs folder is, which is not what generate project files makes

normal pecan
#

Hey everyone. I'm not sure if I'm asking in the right channel, but if I'm not, please point me to the correct channel.
I'm trying to build a physics based Pick up/Drop system for items.

My goal is to allow the player to pick up items from the floor. The item then must start moving towards the player's hand. The closer the item, the slower it gets. Until it reaches player's hand, at which its velocity will be zero. I managed to do that by measuring the distance between the item and the hand and using it to determine the velocity of the item. It resulted in a really smooth motion and it works perfectly.

Now I want to do the same with rotation. I want the item to manipulate the angular velocity of the item while travelling to the player's hand until it aligns with the it perfectly. I tried using the same concept but by measuring the difference of rotation between the item and the hand, but now I'm diving into Quaternions and I'm totally lost. I always end with the item continuously rotating randomly. At some point I manage to almost get it right, but the item kept doing random 360 rotations whenever it aligns with the X-Axis.

Have anyone come across a similar problem and managed to solve it? I tried looking it up but I couldn't find anything by googling. And sorry for the long rant. This has been driving me craze for the past 3 days.

tough kiln
#

I would just try setting actor location and rotation with vinterp and rinterp. They both have built in smoothing so they will slow at the end.

#

If you wanted more control over how the speed changes over time, you could either use the Ease node with a selection of different curves, or doing the same from the FMath C++ library. You can also make your own curves using Timelines.

normal pecan
#

Thanks for the suggestion! I will look into it.

quartz oar
#

Can I set it so that I can scroll with the trackpad in the editor?

#

It's very frustrating trying to edit blueprints on a laptop without a mouse connected

barren pagoda
#

hi, how exactly would I make the character turn to face forward at all times in the game animation sample project? even if you are standing still.

lunar sleet
#

is this an FPS?

barren pagoda
#

away from the camera

golden anvil
#

third person FPS?

lunar sleet
#

it's not first person @barren pagoda

#

that sample is third person

barren pagoda
#

im trying to make it first person, such as attaching the camera to the mesh head which works really well already

#

by default i know the character faces away from the camera when you move and when you use the focus/aim mode so i just wanted it to do that at all times basically

#

if i use the focus mode in first person it does what i want

lunar sleet
#

probably something like use control rotation or such, I haven't looked at that project

barren pagoda
#

alright thanks, ill look around there

#

oh yeah! there is just a tick box that does this on the character itself lmao

#

thanks again

golden anvil
#

Blueprint Runtime Error: "Accessed None trying to read property CallFunc_Create_ReturnValue". Node: Toggle On Graph: EventGraph Function: Execute Ubergraph Desk Blueprint: Desk

Keep getting the above error message when running my game, however the node it's referring too (the one controlling when the secondary dot turning off and on while the chair is possessed) seems to be working. anyone have any ideas why this message keeps popping up? (video and screenshot with the highlighted node for context)

craggy flicker
#

is there a way to get the player controller that selected a button in a multicasted widget?

#

do i just get owning controller

frosty heron
#

Multicasted widget?

#

What's that even mean

#

I am guessing you are trying to do multiplayer. If you are read the pinned channel 4 times before proceeding.

frosty heron
sonic sigil
#

Guys im having a dumb moment and I cant figure out how my characters are dying with > 0 health with this

golden anvil
frosty heron
golden anvil
#

ok, so apparently when I check if the pawn is controlled before turning the widget on it invalidates the reference(Thank you @frosty heron for the pointer and clarification), is there another way besides this to check for if it's being controlled before creating the widget that will not invalidate it?

#

for further context, when I just do event possessed it just creates the wiget even when the pawn isn't possessed yet, and then turns off when unpossessed.

frosty heron
#

For your tick function, I will just add the valid guard and call it a day.

Basically do this if this ref is valid. Else do nothing

#

You are doing multiplayer? @golden anvil

golden anvil
frosty heron
#

Kay, that's fine then

golden anvil
# frosty heron Kay, that's fine then

could you send a screenshot of what you mean by valid gaurd if you dont mind, this is what I have currently. Also it does not really work it just fails to execute what i want it to do (please refer to original comment video, spesificly the second half where when I possess the chair and I show what I want this code to execute.)

odd kiln
#

Anyone knows the reasons to use "Actor Component" instead of "Blueprint Interface" ?

#

I can't find the big differences between them

surreal peak
# odd kiln Anyone knows the reasons to use "Actor Component" instead of "Blueprint Interfac...

@odd kiln Well they are fundamentally different.

ActorComponents are reusable Objects that can be added to Actors to extend them. You may add as many of them same class to the same Actor as it makes sense for the given Component - Actor combination. An example are multiple Static MeshComponents (they are ActorComponents in the end).

The actor itself knows about its Components and can interact with them. Other Actors may need to cast to the Actors class to be able to know what components exist and can be interacted with. You may also "search" for a component by class or similar on any actor and not cast, but that's in most cases the wrong approach and not good for performance.

A component may have functions and variables, and can also implement Interfaces just like Actors.

======

An interface on the other hand can only have function declarations (so not even an implementation of a given function). They can be added to other classes which are then meant to override/implement the functions and do whatever makes sense to them.

Interfaces are usually used when you have a case where you expect a common context but the object you deal with doesn't have a common parent class to cast to.

An example is Interaction (player presses E to do something). There may be various actors in your game with which you want to interact but they may not share a parent class which could add a function "Interact" to, that child classes can override. In that case you usually make an Interface and give that the Interact function. Then you add the Interface to any class that you may want to interact with and override the function in the actor. Then you can blindly call the interface on e.g. a traced actor and if it has the interface and implements the function it will execute it, without having to specifically cast to all options. So you basically group the actors under the context of InteractionSystem.

#

You may use an ActorComponent to make your interaction code reusable and an Interface on top that has a GetInteractionComponent function to easier access it on various actors that might have it.

dense garnet
#

Hi all.

So, for over 6days, I have been trying to figure out why my simple blueprint elevator, does not work. Please help. I am stupid. haha

Problem:

  1. when ''character'' overlaps green box. It triggers motion to go up. Works okay, no problem.
  2. when "character" goes back to green box. Box does not go down. ๐Ÿ˜ฆ
  3. I have researched for days, asked 4 AIs and I am still stupid hahaha help? ty

Here screenshots:

#

Here are my blueprints:

#

Here is 1st overlap:

#

Here is 2nd overlap:

odd kiln
#

So if I want to change the "temperature" of the World, I have to use an "Actor Component" right ?

surreal peak
odd kiln
surreal peak
#

You can also have an inventory interface on top to get the component from various actors if they have it

raw sleet
#

Hi ๐Ÿ˜„

Is there a way that lets me save an Object when saving the game? I don't want to make a struct with every single attribute an actor has. That would mean, I would have to change the struct, save and load function every single time I change the actor I want to save. Just saving the entire object would be way faster. Any ideas?

odd kiln
surreal peak
steady night
#

hey

#

wich of these method "Cost less" ?

#

i know its fractional but which one is preffered ?

lunar sleet
#

At your level it doesnโ€™t matter

steady night
#

not at all ?

#

but if u had to choose ?

lunar sleet
#

Depends what youโ€™re doing with it

#

If you need to access its insides you might as well cast

steady night
#

in this case im just applying damage to hit targets *

#

well i dont really need any info inside in thise case

lunar sleet
#

Then actor has tag is probably fine but the issue is string literal based coding is bug prone because of human error

steady night
#

yeah i know that

#

but "preformance wise" it dosent cost that much difference?

frosty heron
steady night
#

yeah i know

frosty heron
#

Optimising in bp is a waste of time, you are already driving slow car

lunar sleet
#

I donโ€™t think actor has tag can query unloaded actors so that makes the difference net zero

steady night
#

z)

frosty heron
#

Just don't drop bad code and keep going

steady night
#

ok Neo*

#

yeah but i mean ppl always complain about bp being so bad but im just trying to learn something to make it "less bad"

lunar sleet
#

But yeah like Cold said. build test optimize when needed and by using the proper tools to optimize

lunar sleet
steady night
#

aye

lunar sleet
#

And also not doing really silly things like get actor of class Actor on tick or such

steady night
#

yeah but that goes without saying in those cases

frosty heron
#

Pll get scared from stuff like line trace on tick

#

It's pretty cheap

lunar sleet
steady night
#

yeah

#

hm im only using get all actors of class

lunar sleet
#

But editor perf only ๐Ÿ˜€

#

Which doesnโ€™t matter much for the game itself

frosty heron
#

Or component, but I lean toward interface for damage stuff

steady night
#

aye

lunar sleet
#

You need a ref anyways so why not just use the Apply Damage since itโ€™s built in?

frosty heron
#

Cuz it's ancient ๐Ÿฆ•

steady night
#

im using the apply damage

frosty heron
#

But for very very simple game it probably suffice

steady night
#

it suits my need for this project but obvi interfaces is more customizable

lunar sleet
frosty heron
#

For simple games I suppose it suffice

#

Anything more complex, we better off rolling our own damage system

lunar sleet
#

Ah yeah, itโ€™s primitive for sure ๐Ÿ˜…

frosty heron
#

It does the job and already have some setup for multiplayer

lunar sleet
#

Oh, it does? Thatโ€™s nice

frosty heron
#

Just simple stuff ,apply damage is called on server

raw sleet
outer fable
#

hi, im trying to figure out how to attach the vrpawn actor to an elevator after i teleport in the elevator, but i cant figure out how to do it. the logic is currently set up like this:

#

so basically i want to check if the teleport trace hits the blueprint if it does it attaches to it if it doesnt it detaches from it

hybrid lily
#

Hello, I need help please ๐Ÿ™
I renamed a folder that contains my Gamemod + Player Controller + Game Instance. I made the mistake of not repairing the redirector. I saved the project then closed the project. Since then, when I launch the project I no longer have my Character displayed, nor any control, I simply have a camera which is positioned on my Player Start, and whose camera seems to be under the map or at the limit. Can you help me please ?

faint pasture
dreamy mountain
#

how can i get a variable from a class? i have a text variable in a class which i want to show up as a text render component on a mesh; how would i do this?

#

this just shows gun_chargedrifle_c because its a class

dreamy mountain
#

oh i see

#

thanks

lusty shard
#

Where do I ask about ue5 Editor Utility Widgets?

#

Trying to get an asset from the content browser and change a boolean for debugging

quiet remnant
#

anyone know why i cant see replication settings for this actor in class defaults like is always relevant (Its inheriting from AActor)

naive herald
#

I want to attach a line trace to the character's hand to see if my hand penetrates the body. However, the hand itself is detected to shoot ray from the hand, is there a solution?

#

When I shot ray, is there a way to ignore a particular bone?

frosty heron
lusty shard
#

I have tried different node related to Get Assets and file paths.. no luck

frosty heron
#

show code

lusty shard
#

this cast fails every time. Get asset by object path fails

#

returns none

#

oops.

#

let me update lol.

frosty heron
#

you shouldn't need to paste full path

lusty shard
#

updated

#

I could get less of a path but really just need the specific file. And MAster is the name of the folder that this BP is in.

frosty heron
#

you should use the GetBlueprint assets node

lusty shard
#

ok will try

frosty heron
#

the code outside the red square is how I get the blueprint assets but it's done in cpp, the cpp code is just getting the blueprint assets with the ARFilter

#

Package Paths is your target directory

lusty shard
#

ok im very confused

#

So I need to somehow use Package Path here?

#

And what does package refer to?

#

'BP Snap Point' does not inherit from 'Blueprint' ( Cast To BP_SnapPoint would always fail).

#

thats crazy because im pretty sure it is a blueprint lol

lusty shard
frosty heron
#

just cast it to BP_Snap Point from the loop

lusty shard
#

Ive only made one utility widget years ago lots has changed and dont remember much.

frosty heron
#

not sure what changed

#

I just chat GPT this one

#

works for me btw incase you are wondering

lusty shard
#

I tried gemini

#

It says its not possible

dreamy mountain
#

hey, whats the best way of going about this? i have multiple child actor enemies, and one health ui blueprint to use per enemy. how would i cast to the right enemy type to get the right info to populate the widget with stuff like the name and current health

frosty heron
#

@lusty shard dude

#

I literary gave you the code

remote meteor
# lusty shard

should cast this instead

and also the path shouldnt be an absolute path like this, should be project relative path such as /Game/Building/Master/BP_SnapPoint or something

lusty shard
#

look at screenshot posted earlier lol

remote meteor
#

read the full sentence lol

frosty heron
#

you are very combative, it's hard to help

#

2 people tell you that you should never need to use full path

lusty shard
#

I had the same file path too but will try again

dreamy mountain
#

what would a box collision be referred to as when i break a line trace hit result? im trying to make it so that depending where you hit an enemy, it does more/less damage

lusty shard
#

Am i missing anything?

#

reposting the tooltip that shows the filepath

dreamy mountain
#

ok, thanks

#

how would i make it so a widget component stops resizing after a certain distance too?

remote meteor
#

we kept saying not to use absolute path ๐Ÿคฆ

/Game/Building/Master/BP_SnapPoint.BP_SnapPoint

dreamy mountain
#

looks fine close up but looks too big when its too far away

lusty shard
#

oh so having the . means absolute?

remote meteor
#

or you can just use the objectpath and do it this way so you can just select

#

absolute path means roughly "starting from your drive letter" like "C:/" something

#

we keep telling you NOT to use absolute path

lusty shard
#

oh did not realize that.

#

Was looking at the end of the path, questioning file name or the folder containing the file

#

I have pretty much everything you are suggesting I believe

#

does SnapPoint SoftReference need to be promoted to a variable?

#

heres the filepath in case it matters

lusty shard
lusty shard
frosty heron
#

@remote meteor I can cast to Material but I can't cast to the BP class I created for some reason

#

my experience is only editing Material Instance and Data assets

#

result from casting to Material and casting to bp class

faint pasture
faint pasture
final berry
#

If I want to add a specific Blueprint actor to an array is it better to cast each actor to the specific BP and then have the array store that specific BP or store them as an generic "actor" and then when I use the actors from that array again then cast them to the specific BP? Hope my question is clear ๐Ÿ˜›

dreamy mountain
faint pasture
dreamy mountain
faint pasture
faint pasture
dreamy mountain
#

the widget is like included on the parent blueprint

#

and subsequently the child blueprints

faint pasture
dreamy mountain
#

ah

final berry
faint pasture
#

Pawn Begin play -> get widget -> cast to YourWidgetClass -> set the ref

dreamy mountain
#

o

#

ok

faint pasture
#

If all you had to do was mail them in a box then they wouldn't even have to be pets, they could be just objects. Store references at the level of specification that you need.

final berry
#

Yea I got that ๐Ÿ™‚ I'm just wondering what is less perfomance heavy, store them as the specific:

  • Get all actors (which are always the specific BP), cast them to the BP and then store them in a specifc BP array or
  • Get all actors (which are always the specific BP), store them in a generic actor array and then when I need them cast it to the specific BP to get the variable.

So in short, Actors -> Cast -> Store or Actors -> Store -> Cast

or is there no difference performance wise?

faint pasture
dreamy mountain
#

this is in the parent

faint pasture
dreamy mountain
#

ah

faint pasture
#

A widget component is a component that displays a widget

dreamy mountain
#

so i should get all widgets of class and then use that instead?

faint pasture
#

No

dreamy mountain
#

oh hang on theres a get widget node

faint pasture
#

Get the widget component's widget, and tell it to care about self

dreamy mountain
#

i didnt have context sensitive on

faint pasture
#

"Hey widget, the pawn that you care about is me"

frosty heron
#

@remote meteor so I spoke with some of the #cpp guys, we can't cast UBlueprint* at least in blueprint

final berry
# faint pasture What do you actually need to do with them?

I need to store and retrieve information in a variable that only exists on that BP multiple times.
So my guess is its best to store the specific BP, that way I only need to cast once (into the array) and then always have the information available without additional casts.
Instead of every time I need to retrieve or store into that specific variable for the actor I need to cast it again and again

#

Does that make sense?

faint pasture
#

Yeah store it as what you need. Assuming that the only things that you will need to store in that array is things of that class.

#

What specific game mechanic are you doing with this?

final berry
#

yea exactly, if for some reason it also needs to contain other actors it cant be that specific BP. But that's not the case so I got my answer ๐Ÿ˜„ Appreciated

final berry
#

I'm pretty sure there is a better way to do what I want, but I honestly have no idea how. But I hate to constantly ask for help you know

faint pasture
#

I mean it can't be that complicated. You want to store an array of what to do what to them later?

final berry
#

Okay so in short I've created a match-3 system (you know, Bejeweled). I did that by first getting all horizontal matches of 3 or bigger and then vertically the same. I then crossreference those to get matches like + or T (of 5 and bigger).
I store the information of which gems are matched in the gems being matched. So I need to access those actors several times to store and later on retrieve the information of the matched gems.

Another way would be to have an array of arrays, but I was told that that's not possible in UE5 so I went the store into the gems themselves route instead

faint pasture
#

How big is your playfield?

#

How many gems around

final berry
#

I guess I could create a map with the actor names as a string with spaces and split those later into an array, but accessing actors using their name is frowned upon I believe

#

8x8

faint pasture
#

Just have an array and simple conversions of 2d coords to index

#

Or

#

Have a map of int vector to jewel

final berry
#

Yes, but I also need the information of how many gems are in one match

#

so just the information of which gems are matched in total is not enough

faint pasture
#

Either way, the jewels themselves should not have any of the matching code. That's a nightmare. Just have a function in whatever is your game controller to process the game state for matches.

final berry
#

Yea fair

dreamy mountain
#

last thing for now (famous last words), how would i change what im casting to depending on the enemy hit? im casting from my weapon parents fire bullet function, but i dont use the parent as a actual enemy, im using a different blueprint called Enemy_TrainingDummy atm, but ill be using others too; it currently isnt applying the damage to the actor because im not shooting the parent; am i just dumb?

#

it doesnt print the damage so i know it isnt actually doing shit

faint pasture
#

Or rather, the input is the state of the game board, the output is an array of structs representing the connected groups of jewels. Then you can process that to do whatever to them.

faint pasture
final berry
#

I guess I really need to dive into structs.

faint pasture
#

Why are you damaging something if it doesn't get hit?

dreamy mountain
#

im not

final berry
dreamy mountain
#

the issue is that the thing im hitting isnt getting damaged

#

its trying to apply the damage to the parent rather than the child bp that i need it to damage

frosty heron
faint pasture
dreamy mountain
#

oh wait im actually dense

faint pasture
#

Your hot code should be this simple at the end of the day.

Trace -> tell hit thing it got hit with x damage and x knock back
Done.

dreamy mountain
#

yeah i had it connected to the wrong thing lmao

#

was connected to false instead of true with the damage and the rest of the code

#

fml lmao

final berry
faint pasture
#

You need a search

#

BFS probably

final berry
#

I need to add them first, no?

#

before I can search them

#

or do I not understand structs

#

Which is very possible

faint pasture
#

You want a function that takes in which gems are where, and outputs all the connected sets of gems.

#

Which you can then process to destroy them or whatever making a chain does.

final berry
#

Right, I'll take a look. Thanks!

faint pasture
#

The struct representing a set of gems can just be a struct wrapping an array of gem refs or whatever.

round wedge
#

Hello everyone, ive made a brick breaker game and I don't understand how I use the deltatime here. 15FPS the game is really fast and 200FPS the game is really slow.

The Ball moves in the level via "set physics linear Velocity" under EventHit. Can anyone here give me a simple example how I can fix this problem ?๐Ÿ˜…

dreamy mountain
#

i just want it to stop appearing after a certain point, or to just resize itself smaller

frosty heron
#

close or far

#

You can take your ruler out and measure it.

#

What you can do there is to dynamically change the size of the widget based on the distance

dreamy mountain
frosty heron
#

right now it's fixed size, from far away it "appears" to be "bigger" since the object below the text become smaller

#

but the widget size is actually the same (which is the issue)

north tide
dreamy mountain
frosty heron
#

you don't need to touch your widget blueprint, just change the widget component size at run time every frame

frosty heron
#

well then look at the freebie above

#

i do have more code, like hiding it the name when player behind wall or too far away

#

but just for the resize you can look at the code above

dreamy mountain
#

can i have them code snippets please beegyoshi

frosty heron
#

or as in copy paste?

dreamy mountain
#

i meant could you give me the code snippets for the players being behind a wall and too far away beegyoshi

#

if not its fine ill probably work it out but yk saves some time lol

frosty heron
#

actually it's there too

#

you can see if > 2000 , toggle vissibility

#

as for the code behind the wall, I might have done it in cpp

#

it's just a line trace

#

Every frame, trace from widget component to player camera

#

if hit wall -> Hide name

dreamy mountain
#

ah ok

radiant bear
#

so i set up a chorded input action with A+LMB and i also have a LMB input action so it works but how do i cancel/not call the LMB when i do A+LMB?

stoic ledge
#

Check 'A' is pressed?

radiant bear
#

yea

#

i recently upgraded the project from 5.2 to 5.4

#

idk if that has something to do with it!

trim matrix
lofty rapids
#

whats so bad about it ?

final berry
final berry
trim matrix
#

Basically, idk about BP but a lot of C++ stuff are fcked and false on GFG, it's truly not recommended for learning

plush hornet
#

Hi all, I have a really bizzare problem. Im trying to deactivate the collision of A collision box in A pawn on event begin but it wont work. Basically the collision box is an attack box. When I use the attack the collision box then works perfectly and only activates when I use the attack. But when I start up the level the box is set to active, and even though i try to disable it in event begin play it doesnt register. Any helps appreciated

trim matrix
#

a lot of advanced developer (with many years in the language) told me about this

#

StackOverFlow is also better (hehe)

#

Heya, I'm new to both blueprints and unreal. I've noticed that most tutorials that involve player controls will go to the settings and assign inputs there, then call those input actions within the blueprint graph. Is there any objective benefit to doing it this way over just calling the key/button directly, or is it just a preference thing?

radiant bear
plush hornet
trim matrix
#

Okay, thanks!

north tide
#

but its still a nice plugin

#

dont really have the money for it lmo

thin panther
#

You also can't get axis values for the likes of moving forwards

remote meteor
#

changing key bindings, disabling certain inputs with IMC, platform agnostic, and many more

trim matrix
#

So in order to recieve an input action you first have to add the mapping context its contained in to the blueprint?

peak cipher
#

Hi, i am making endless runner game, and there is my change lane system and i am wodering what should i do, to center my player after turn corner

#

someone want to help me?

kind estuary
#

I created a child of an Animation Blueprint. How do i access the animation graph in the child?

#

this is not visible in the child of Animation Blueprint

stoic ledge
#

Doesnt it just stay in the parent? And the child has its own graph?

kind estuary
#

this is the child

#

cant access animgraph

#

this is the parent:

#

child again:

#

cant open anim graph no matter what i try

dark drum
kind estuary
#

in the anim graph i have idle to be something, and i want it to be something else

#

the animation only

dark drum
kind estuary
dark drum
#

With the sequence node selected, you have options in the details panel to expose as pin.

dreamy mountain
dark drum
dreamy mountain
#

ok

#

thanks

faint pasture
faint pasture
stoic ledge
#

Dont copy code, thats insane ๐Ÿ™‚

faint pasture
#

This is really not hard at all to implement

#

it'd be harder to convert the raw C++ code to Unreal containers and give it sane variable names

peak cipher
#

anyone wants to help me with code? pls ๐Ÿฅน

lunar sleet
ashen aspen
#

hey, as you can see i cant drag and drop my levels into SubLevelInstances which is Level Streaming, Object Reference but I can drop them on NewVar, which is SoftObjectPath (for obvious reasons)
What am i doing wrong here?

peak cipher
odd kiln
#

Hi all ! If I want to make a "flying vehicle" should I use "Pawn" or "Character" Class please ?

peak cipher
#

and i dont know what should i do more

lunar sleet
peak cipher
#

i will show you, wait i need to record this

odd kiln
peak cipher
lofty rapids
odd kiln
#

Why not "Character" Class ? What is the big difference between both

peak cipher
final berry
# north tide that sucks

Well, yes and no. I mean someone put work into it, I'm okay with paying for it, and it's not an insane amount either. But I get that something as "basic" as nodelines would be nice to be free

north tide
#

I mean yeah

#

Im prob gonna buy it when i have the money for it

peak cipher
# peak cipher

i need to do sth, what will center position after corner

north tide
#

Its a nice plugin to get things organized

final berry
peak cipher
#

@lunar sleet do you have and ideas what could i do?

lofty rapids
#

it looks like if you can turn at the center as long as it's the same width it should be good

faint pasture
# final berry Do you have a suggestion on how to attack this with structs? Detecting the match...

Say you started at top left and scanned across, tallying up the islands (connected components)
You'd do it like this

You're at the first cell
BFS from there to find connected matches, it has none, you make a set of 1 and mark the cell as visited
You're at the 2nd cell
BFS from there to find connected matches, there are 5 total in this set. Mark them all as visited
You're at 3rd cell, it's visited already, skip
You're at 4th cell,
BFS from there to find connected matches, it has non, make a set of 1 and mark the cell as visited
so on and so forth

#

at the end you have a bunch of sets of cells. You can then iterate over them to select the biggest or whatever or just explode them all

final berry
#

I'm following, however the biggest headscratcher for me is that the 2nd cell isn't a set of 5, but of 3, gameplaywise.

faint pasture
#

you're saying that only subsections of 3 or more matching colors in a line count?

final berry
#

Yea, but there might be overlap as seen in the red match at the bottom

faint pasture
#

Just include cells in multiple sets then

#

you're looking for linear sets of 3 or more in a line, and a cell can be in multiple results.
You can merge 3+ cell linear sets if they share cells later in a 2nd pass

peak cipher
#

And I need system to correct player position after corner

final berry
#

Allright, now without you coding everything could you give an example of how the search function would be setup in blueprints? I just need a starting point, kinda lost on that. I get the theory, but now in practice ๐Ÿค”

lofty rapids
faint pasture
#

1st pass
Read board, generate array of structs containing arrays or sets of cells representing all the 3+ cell linear collections
2nd pass
Read that array, combine 3+ cell collections if they share any cells
3rd pass
do whatever you do there

lofty rapids
final berry
plush hornet
#

Hi does anyone know how to get Whole numbers from a float and not percentages? I.e 1 instead of 1.45655 as an example. Thanks

#

Im using a random float from range btw

lofty rapids
final berry
#

Depending on what you want, to the lowest int, to the higher int or to the closest int

lofty rapids
# peak cipher elaborate pls

i mean if your in the right line then turn when you hit the right lane spot, if your in the center lane turn when you hit that point, so that after you turn your still in the lane you were and it's auto corrected you don't need to do any jittery stuff it will be smoother

peak cipher
#

its looks like this, then i should make 3 box collisions which will turn my player?

plush hornet
lofty rapids
peak cipher
#

yes

lofty rapids
peak cipher
#

i was thinking about branch with can turn and if it is true (he is turned) it will check current lane index and if it is diffrent it will center of player position

lofty rapids
#

i would think with some numbers if you get the center line you should be able to turn at the right spot for whatever lane your in

kindred river
#

Dynamically Interpolating Rainfall Data to create a 60-minute bar chart in UE5

peak cipher
lofty rapids
#

for instance put the collision at the point that is the center, and use the middle lane

#

it should put you in the center so you can switch back and forth

#

so if your in the right line then you want to turn a little sooner to line up with the right side

#

as long as your lanes are the same distance apart and your width is good it should work like that

#

and for each lane just turn at a different point

balmy onyx
#

hey does anyone know how to stop the money from being removed when it reaches 0 or an amount under the price of the item?

peak cipher
lofty rapids
lofty rapids
#

i would make a function and return a boolean that says if it's able to be bought

#

or wrather if it was successfully bought or not

balmy onyx
lofty rapids
#

ya a function instead so you can return the boolean, which says wether you purchased it or not

#

but to do that actual check you can just do if the players money >= amountneeded

#

and plug that condition into a branch

final berry
#

If I do a multi line trace with an overlap channel, does it always give the hits in order( as in, the order of when the actor was hit, cloest to the start point is first in the array, farthest is last)? I tried it and it seems to be, but I'd like to verify with someone that it's always the case

balmy onyx
lofty rapids
balmy onyx
lofty rapids
#

did you make it instance editable ?

#

or public ? or is it private ?

native wigeon
#

its really quite simple:

#

BRANCH
player money => price.

True arrow Remove money arrow add ammo
False arrow whatever

ashen aspen
#

duplicating my question

lofty rapids
#

thats your player bp, and you want to drag from that

#

and get the variable, but it has to be public

native wigeon
#

you can just remove that

balmy onyx
#

omg i didnt thought about dragging it from there. damn i feel stupid know

lofty rapids
#

because the variable is on the player

#

you use that reference to get from that bp

native wigeon
#

Ah my bad yes i just noticed this is wrong

#

should look something more like that if you use the correct variable

balmy onyx
#

it works know preciate you guys

native wigeon
#

๐Ÿ‘

dusky cobalt
#

Will this actually get the closest resource of said type? Or should I first add to new array and on complete check new array for the nearest resource? What do you think?

shut quarry
#

Is there any way to dynamically set the time for the camera shake? Like I can manually set the value to 5 sec but I want to be able to change it at runtime

odd kiln
#

Does anyone have an idea how to increase the speed rate of a "Timer by Event" (looping) ?

#

While the timer is running

dusky cobalt
pale obsidian
#

What's a good way to parent a single player, 3rd person character blueprint, where you can switch which character youre controlling at runtime

#

is it as simple as switching from the AI Controller to Player Controller?

odd kiln
#

But when I change the "float" variable it does not change the "Timer" speed

dusky cobalt
odd kiln
dusky cobalt
#

in another timer by event?

odd kiln
#

Yes

#

I need to "update" the first "Timer" that I want to change the rate

#

I mean the variable changed great but the "Timer" is not updated

dawn gazelle
odd kiln
odd kiln
#

Ok thank you !

flat coral
#

goal here is that if there's already a timer ongoing, clear it and restart it fresh

odd kiln
proud mauve
#

Hey guys, how can I prevent the remaining time by handle going to -1? I want it to show 0 when the countdown is finished^^

faint pasture
#

just clamp the result

proud mauve
spice sequoia
#

Anyone know if it is possible to make a line trace from the center position of a 2d widget in the world?

spice sequoia
#

I have a hud/UI with a target that can be moved with the mouse and I want to align a projectile launcher with the position of the target reticle in the HUD

faint pasture
#

although you might be better served doing it the other way around, depending on the control scheme

spice sequoia
#

Which nodes would I use to do that?

#

Is there a 2d widget position > world location node?

proud mauve
#

I did something similar with convert mouse position to world space, maybe you can save the mouse position when you moved the widget into position?

queen dagger
#

questiopn

#

so i have a an an enemy

#

i use a sphere collision to identify where the main character is

#

but it only triggers once

#

is there a way to get it to retrigger all the time?

#

so it can always know where the main character is

spice sequoia
stoic ledge
queen dagger
#

i did not know you can set an overlap to call

#

i did not know you can set an overlap to

stoic ledge
#

You could also store the reference to the overlaped actor, then you can always check to see where it is

faint pasture
#

All the time, i.e. every frame?

queen dagger
#

yes

#

every frame

#

its a 2d plat

#

so im assuming ASSUMING it wouldnt be too taxing

faint pasture
#

that really only applies to a single player thing and it's not the best but it'll work.

queen dagger
#

ok

#

so lets say i want the enemy to walk towards them if they are withing certain distance, get pawn location, pawn location subtracted from enemy location, then check if within certain range, then have enemy move

faint pasture
queen dagger
#

thats what i have

dusky cobalt
queen dagger
#

but im just unsure about how to get it to locate the main character continously

#

or

faint pasture
#

Begin Overlap -> cast OtherActor to YourPlayerPawnClass -> set a ref
End Overlap -> cast OtherActor to YourPlayerPawnClass -> clear the ref (set it to nothing)

Tick -> if Ref is valid (there's a YourPlayerPawnClass in range) -> true -> walk towards it
-> false -> ???? -> profit

faint pasture
queen dagger
#

goooooootcha

#

was just about to say something similar

#

im glad my mind was on something like that

maiden wadi
faint pasture
#

Just set it to nothing

queen dagger
#

gotcha

faint pasture
#

btw this will only work if there's only 1 ParentCharacter around

queen dagger
#

i see

#

other wise im assuming it would mess the enemy up

#

im assuiming if i wanted multiple i would need to identify priority of targets?

faint pasture
#

with your current code if there was multiple you'd lose your target if ANY leave the radius

#

you'd have to modify your test to be like:

End Overlap -> if OtherActor == Ref -> clear Ref

queen dagger
#

so then

faint pasture
#

Just remember that in programming, it'll do EXACTLY what you tell it to do. No more, and no less.

queen dagger
#

my thought process would have an array made when characters enter the overlap, store that and have it be used to select target, then when a parent chracter leaves have it be removed from array so the next target can be idenitified or have it go back to simple wander

#

also would that be done in the enemy bp or the ai controller

#

something like that?

glossy cloak
#

You only need the add.

#

"OtherActor" is also an odd name for an array since an array is plural, typically.

#

So you might want to call it "OverlappingActors"

queen dagger
#

ok!

#

will do

#

would that be what creates the array correctly?

#

IT WORKS

#

i may just be learning

faint pasture
#

the overlap component already maintains an array of overlaps

jolly hedge
#

when use "add movement input" node, where i scale it 1 or 20 and give the direction 1 or 2000. it still goes the same speed as just giving the values 1 in scale and 1 in x direction. Why is this and how can i make it faster

faint pasture
# queen dagger my thought process would have an array made when characters enter the overlap, s...

If you're going to do that then just run an event called ChooseTarget which gets overlapping actors, loops through them, and sets the Target ref (to nothing if there's nothing it cares about)

Begin overlap -> choose target
End overlap -> choose target
Choose target -> clear ref -> for each overlapping actor -> cast to YourCharacterClass -> set ref if succeeds
Tick -> if ref is valid -> do thing

faint pasture
#

from nothing to full send

jolly hedge
faint pasture
#

change the acceleration and max speed stats in the movement component to change how fast 1.0 input is

jolly hedge
#

from this image, if it is from 0 to 1 should it not go faster when it is 20 x direction then 1 x direction

wild crater
#

When using the Property Matrix to bulk edit, is it possible to use formulas? I know you can type '/2' in such a field, but it doesn't seem to work if the field has "multiple values". Is there still a way to do stuff like this?

queen dagger
#

or do i no longer need the add node

rigid stag
#

How can I make an animal die from a gunshot?

queen dagger
#

create animal bp, make health, make prjectile, have projectile do damage on hit to reduce health, animal takes damage, upon hitting 0 health have it play death anim and destroy actore

rigid stag
#

To show u and help me

queen dagger
#

sure why not

rigid stag
queen dagger
#

check dm

#

so for the for loop is that what im sorta aiming for

lofty rapids
#

are you trying to get the closest one out of all in the array ?

queen dagger
#

yes

lofty rapids
#

and this array is what you populate on tick ?

#

idk why you would want to switch to on tick, the add and remove method is probably more efficient

lofty rapids
# queen dagger so for the for loop is that what im sorta aiming for

Watch and learn how to add your own function in the game to find the nearest actor of any class to any given point.

Support me on Patreon and get access to videos early, join our developer community on Discord, get exclusive behind the scenes videos on my projects and much more over at https://www.patreon.com/ryanlaley.

Subscribe now to catch ...

โ–ถ Play video
queen dagger
#

coorect ill take a look into that

lofty rapids
#

i started the video at the stuff you need i'm pretty sure thats what your looking for then although your not checking a specific class the distance check is basically the same

flat coral
#

I'm pretty sure that after closing my map widget, my effective mouse sensitivity for my player pawn drops significantly. It's definitely not outside the realm of possibility, since I do switch pawns to a map camera pawn and back again after the map screen.
My question is, though, how the heck do I test this? Right now I'm resorting to something like moving my mouse what I feel is the same amount, and eyeballing the angle my pawn turns before and after, but that's sloppy and imprecise, as well as time-consuming.

#

I need a reliable way to get like "Received input value X for Y frames, pawn rotated Z degrees"

shut quarry
#

I'm tryna make simple logic such that on function call, print string is called, then there's a 1 second delay, print string called again, so on so forth. Why isn't it working here? Any solutions?

#

it is just showing a number once and calling it a day

rose crest
#

it wouldnt in loop

flat coral
#

But like.... WHY? how? I don't understand why the fundamental axis value could be different after

dawn gazelle
flat coral
#

I was thinking maybe the framerate increased after closing the menu, somehow, which would explain the lower per-frame input vales. So I added this to the controller itself:

#

The result is actually even MORE dramatic!

#

There's no way my mouse wiggle after was 1/5th as intense. Something is going wrong with my input ITSELF

dry hatch
#

Hey friends! I've set up a simple ability system in my game and am trying to figure out how to reference that for my savegame. Basically I want to have the player choose thier abilities in the main menu and then have those abilities unlocked when they start a run. Any tips would be much appreciated!

flat coral
#

But it's gradual too.

dusky cobalt
rough eagle
#

Hello ! I have somes Data asset (Puzzle_01) and i would like to create a new one, (by code or BP), and saving it. how can i do that ? I dont find any node to create and save a data asset

queen dagger
lofty rapids
#

you can do whatever you want but i was just showing you the math involved

#

just to the point he returns the values

#

thats how you get the closest

queen dagger
#

ahhhh

lofty rapids
#

a loop with the closest value and choose the one that is closest, then on completed you have the closest one

queen dagger
#

i see

main flume
#

Hey there! I have an array of input action object references and I want to check the current value of each one, how could I achieve that?

dusky cobalt
dusky cobalt
dusky cobalt
dark drum
dusky cobalt
#

isn't it just saving the structs inside data asset?

dark drum
# dusky cobalt isn't it just saving the structs inside data asset?

No, a data asset is just a fancy uobject. When you edit the data in game, you're editing the actual object the editor creates. When you stop playing, that data persists as it doesn't create a new object for the data if one already exists. Because you're in editor you can save the persisting data before you close the editor.

In a build you can't do this so the data will always be the default when you reload.

That's my understanding anyway.

dusky cobalt
frosty heron
#

You should treat it as how it is designed. Read only

#

Like data table I suppose

frosty heron
astral wyvern
#

And controlling it by adding torque to it (?) but the geometry of the object afecting collisions

quaint quartz
#

I cannot get copy pose from mesh to work correctly for my character. Every piece of the character works fine but the head, instead of going into place it has a huge offset and flails around wildly. I cannot figure out why every other piece of this works but the head. I've tried applying transforms and rotations in blender and removing bones from the skeleton niether of which seemed to help at all. Does anyone have any ideas here?

charred rover
#

I have an actor that is interacted with on Unreal Engine. There is an event inside the actor where I change the mesh. When I interact with this actor, the widget opens and I call my mesh change event on the widget and the mesh changes.

The problem is;
When there are several of the same actor in the scene, I want only the actor being interacted with to take action. But it only makes 1 of them (0th index).

I tried using all actors of class + for each loop via the widget, but it didn't work because the index is always 0. That's why it only does the one with the 0th index.

shut quarry
#

Is there any way to shake the camera only for the specified time (which is the duration parameter)? and if it is zero it'll stop shaking that camera?

split hill
#

Hi,

i'm trying to attach a doll (ragdoll) to my character hands, so when the character move around, the doll ragdolls following the hand.
My first approach is to set up a physics constrain between the character hand and the dool ear (its a bunny). But i failed miserably.

Does anyone have any tip to do so ?

dusky cobalt
dusky cobalt
shut quarry
#

is there even a stop shake camera function though?

#

i dont see any node that can do that

shut quarry
#

if i'm already in my BP_MyCharacter class how else can I get the camera manger (img)

shut quarry
#

i hv the camera component and everything but no camera manager

dusky cobalt
#

it's the same probably

shut quarry
#

this should work

#

no idea what match id is thou

#

*though

#

or what to put in for player controller

dusky cobalt
#

you dont have to plug anything there, index 0 is a reference to the first player controller in game, like for the local controller, which will be always ''you''

trim matrix
# dusky cobalt

it it's in multiplayer it could word, depending if the Camera Manager is replicated, which I dont think it is, meaning that it might be owned by the player, if that's the case using 0 is correct in this case in this BP

shut quarry
#

i do plan on making it multiplayyer

dusky cobalt
#

good luck ๐Ÿ˜„

shut quarry
#

lol

shut quarry
#

So assuming i do the replication right, player index 0 will always result in the current player even in multiplayer

trim matrix
#

I have no idea what that play index function is... I couldn't tell you

pine trellis
#

how can I use a different post process effect here?

shut quarry
#

apparently i need a shake instance. How do I instatiate in blueprint? I assume I'll instatiate it before playworldcamerashake then pass that instance to both funcs

frosty heron
noble ledge
#

Why is it sometime when trying to get an item from an arrey I dont get the "Get (ref)" and only get the "Get (copy)" option?

shut quarry
#

is it this?

shut quarry
trim matrix
shut quarry
#

singleplaye ror multiplapyer

trim matrix
#

both

shut quarry
#

how do i create an instance of this: BP_DefaultCameraShakeBase

#

bcuz i need that instance in order to stsop the camera shake

#

acc to the video

#

yall recommended

shut quarry
#

oh he is doing an entirely different method ๐Ÿ’€

noble ledge
shut quarry
#

figred it out

#

figured out the instance thing

stiff tendon
#

Hey! I want to update a texture which compression settings is set to VectorDisplacement(RGBA) with a render target that is RGBA8. It works, but the function reverts the texture compression setting back to Default (DXT..). Bummer. And it seems that resetting the texture's compression settings back to VectorDisplacement(RGBA) right after that RenderTarget node causes UE 5.3.2 to crash every now and then (saying things about Async stuff not being completed or smthing). Any idea? Ty ๐Ÿ™‚

shut quarry
#

uk reroute nodes? why cant I spawn them in isn't it like alt or smth

#

its double clicking

stiff tendon
frosty heron
#

If it's object ref then you can because you are getting the copy of the pointers

dusky cobalt
#

it's in the video

shut quarry
#

yeah ik i figured it out

pine trellis
#

how can I get this effect using stencils where I wont need to have a mesh infront of it?

rough eagle
hoary junco
#

question about uobjects, can you deconstruct one whenever you're not using it?

lunar sleet
#

More of a #cpp question

jaunty coral
#

does anyone know of good invintory turtorial. I want to do a size based invintory with invintory size determined by what the player has equiped

craggy flicker
#

Why do my blueprints sometimes grey out copy, paste, etc????

#

it's so fucking annoying, i have to close and reopen it to fix it

dry hatch
surreal bridge
#

Whenever I use Set Actor Rotation to set the Y rotation to 210 degrees it instead sets the rotation to 180, -30, 180

Is there anyway to stop that from happening?

frosty heron
surreal peak
queen dagger
#

still working on this get closest target thing

#

any idea if any of these nodes would help?

queen dagger
#

NEVERMIND I GOT IT TO WORK

#

hell yea

#

the highs of figuring this out is so nuts

#

the lows of being stuck are crushing

#

game dev be a serious drug

tropic peak
#

Do I need to disable physics on the pickable item or something?

pine root
#

does a blueprint derived child class have access to parents protected variables?

barren maple
#

How do I update the value of a variable based on the current Index of an enumeration? I have a function that checks if the current enumeration is equal to "F", and sets two floats to 1.0 If it is, and to 0.0 if it isn't. However, these values never change even though I know the current enumeration is changing because I use it for other things and it works as expected.

pine root
pine root
barren maple
maiden heath
#

A question is it possible to make the cine camera actor the main one in the game instead of CameraActor? If so, how can I set it?

barren maple
#

This is how I am using it.

#

I have watches on those values and they are always zero.

maiden heath
#

Ok question, you gave it as default to the player because my idea is to use it to make it follow the player and do something else. Like a CameraActor.

trail kestrel
#

I want the ball to hit the net and reset the ball back to it's starting position.
Problem is the collision won't destroy the ball meaning it just blocks the ball out of the net

wild crater
#

Hey guys. I'm having this problem with dynamic nav meshes that on starting a level, it doesn't completely build. I have some AI's coming in from the other side of the level, but the nav mesh doesn't seem to get built there quickly enough (not always, mostly in bigger levels). It looks like it's attempting to build but then stops. Is there a way to force a full rebuild or something?

wild crater
maiden wadi
#

The first is technically incorrect. Thus it needs to be converted correctly to the second.

somber elbow
#

Hey guys! Im trying to solve one thing here. In my gamer I have a character (a cat) and a cube non character actor. And i need to make the cube move with 0.5 of cat's z axis speed. So when the cat jumps it has to go upwards as well with 0.5 of cat's speed.

#

I asked ChatGPT and it said i should somehow use actor world offset node

#

but the result is quite weird and doesn't work as it suppose to. It just shoots the cube up with supersonic speed.

#

Could you help please?

thin panther
#

This is for two reasons, one you're always adding the offset, two it's not being multiplied by the frame delta so it's going to shoot off into oblivion.

Try using a vinterpto on tick. The start is your current position, the end is your position, with the z value changed to the cat's z value. Change the speed to whatever feels right, and plug delta seconds into the delta

#

This is also why you don't use GPT for programming in unreal

#

Especially not blueprints

somber elbow
#

And i shouldnt use actor offset in this case?

thin panther
#

You should be setting the world location with my setup

#

Note setting, not adding

somber elbow
#

working on it!

wild crater
# limber parcel try using nav invokers

The thing is, the levels are just arenas. You'd think this feature is more intended for really large worlds? Seems like it would have a higher performance cost in smaller levels with a good number of agents?

limber parcel
wild crater
#

Hmm it does seem to solve my problem

#

Though to me it's just quite strange that the navigation mesh for the level isn't at least set up once fully before the level even starts

#

Seems like that should be in the builtdata

somber elbow
#

@thin panther It works, but now it moves exactly like the character. The thing is i want the cube to cross 0.5 of the distance that character cross. I want to replace that cube with clouds later and that way there will be kind of parallax effect whenever the character jumps. And the clouds on the background will move but twice slower than the character

#

so that way in new position i should calculate the difference between character location and the cube location and divide it by 2?

thin panther