#blueprint
402296 messages ยท Page 826 of 403
I figured there would be a way better way than what I was mucking with. Thanks again.
By spawning it? Not sure what you mean
I assume this happens cause it's one frame with 0,0,0 velocity, and then it continues falling
Try to set the MovementMode to None, and then after a while back to Falling
Anyone have a clue why my cast to chess controller is failed? I checked the world settings, and the default player controller is my ChessController_BP
OMG YES
I managed to retrieve my original bp component after two bricks and an entire day spent trying to recreate it from memory ๐ญ
Print the name of the return value of the GetPlayerController?
Im using spawn actor when an AI dies to create a sword that a player can pick up. My Weapons are based on the parent class, I want to know how to spawn either that parent class or any of its children
I hope I just didnt say the same thing twice
Hm, kinda. To spawn a class you specify it on the SpawnActor node
might also be better to not do this on update, but on the initialize event of this abp
how do I dissolve a reroute pin that isn't necessary again?
select and delete?
it breaks links tho
reconnect it
I thought there was a way to dissolve them ๐ค
let me know if you find out ๐
yeah but its only spawning the parent of that class
not any children
Yeah it prints ChessController_BP
Sorry it took so long. This is my first time working with blueprints
Cause you selected the Parent class?
You are not casting to _BP though?
You are casting to the non BP version
Does your BP version inherit from the other one?
This defines what you spawn
If you selected DefaultSword, then that is spawned
You need to select a different class if you wnat to spawn something else
guess I need to make an array of classes
or a var and set it when you need to
Yeah, for example
Depends on what you exactly want
If it's a random one, then an array somehwere that you pick a random element from would be correct
Are the windows supposed to be separate meshes or the same mesh? If the same mesh, make it a skeletal mesh and use bones instead of empties
I guess I should not worry about this now, In the future im going to make an database (sorta) of items
and spawn from it based on area difficulty
you could mock up a temp array to test if thats the idea
Yeah, some loot manager (:
is a good way or a dump way of doing that making a spread sheet of all the items
and spawning it that way
basically making a item database
Reeeaaally depends on your game and how complex you want this
Just getting this out there, that looks pretty gross. What are you trying to do with this animation blueprint?
You can start with a DataTable
They are based on Structs
Idle to move, and move to idle
I would start with the data table
The more complex version is via DataAssets
That should be operating on the actor level. Basically the actor has a variable that changes when it is moving
They are discoverable by the engine directly and each weapon would have a data only asset
It should have absolutely nothing to do with the player controller
Combined with a class that matches it
cool
I'm not really sure how to do all that with blueprint, so I just used my variables in cpp to test it
An AnimBP is usually used to drive animation states for a classes SkeletalMesh
@obtuse yoke look at how the third person template does its animation blueprint
Aka imported anims
Oh, you do it like that too? I thought most people do like, BP_Item with like DA_Sword, DA_Axe, etc...And just relied on the BP_Item and switched the DA. That's what I tried at first as well, but didn't like the workflow all that much. Now I have a BP class that matches the DA.
@surreal peak are you any good with UI stuff. I made a post in #umg earlier that i dont thing anyone saw, id like a few knowledgeable people to look at it, possible to suggest a starting point
Given you are doing a chess game (?) you wouldn't move the pieces with an animBP
Unless yo usomehow figured out how to do that with anims o.o
I'm trying to make an animated chess game hehe
I think what he wants is like animated moving. Moving the night isn't just sliding a piece, it's a night running
right
exactly
Then each piece has a SkeletalMeshComp
With a SkeletalMesh and AnimBP
And you would try to work directly with that in the AnimBP
If you need to know if a piece is selected ,then you can get that from the piece
Your PlayerController can set variables on them,
I wouldn't access the PC directly in the AnimBP
99% of the time you stay relative to the actor the AnimBP is on
Hmm ok, I'll try figuring that out
It depends
If your BP_Item can support all DAs, then sure
But if some DAs need special stuff, then you need a new BP
E.g. differently sized characters
If it's really just data that makes them different, then one BP with multiple DAs is fine
@obtuse yoke basically the anime BP reads data from the actor that owns the skeletal mesh and uses that to drive animation. I would start with just making a Boolean for if the piece is moving or not.
ha, I'm not the only one that writes anime by mistake
Eventually you'll want to play montages when selected and stuff like that but start with just one variable
Thank you, I will try this tomorrow
you have to work with data assets one by one right? like change values and such for them? is there a bulk way to edit multiple DAs?
Yeah, didn't mean to imply otherwise. I just didn't like the workflow personally.
I'm using voice to text so yeah, it's not exactly 100%. I used to be worried about AI but if it can't even tell what you're saying then we got a couple years left before the overlords arrive.
Bulk edit property matrix
so that would work for them... interesting
Totally fair. I like the way I can do chunks with them, which makes patching nicer, and that I can just query all assets of a type etc.
I do not like that i need multiple BPs either, but it is what it is
I guess if they are all the same class ,yeah
So would I use "Get Owning Actor" and then plug that into Get Velocity?
What is the parent class of the chess pieces?
Hey folks, if I set my controller to 'show mouse cursor' the axis reads 0 unless I hold a mouse button down. This feels like a bug? How can I read the mouse X / Y axis while the cursor is enabled?
ah, interesting, i guess ill have to play with them, went the data table route
AActor
InputMode?
Oh, I enjoy DAs. Just prefer the 1:1 mapping of a BP to DA. It can definitely be a bit excessive though ๐ .
But does that make sense?
E.g. You have a Health Potion
And the only diff in the DAs is one is 10 HP, one 5 HP and one 20 HP
Why making more BPs?
No, it doesn't make sense. I know where you're going with it.
Honestly - for the editor experience
It works if I set it to Game Only, but I feel like this'll become an issue when trying to interact with UI later on?
UI and Game work differently
Game routes your Input differently
If you need Mouse stuff when UI is enabled, you need to go through a Widget, or if at all through the GameViewport
(c++)
Or, if you are really fancy, and you need Input stuff without UI/Game, make an InputPreProcessor
Which is also C++
Both methods have their drawbacks, but now that I'm messing with bones I realized that it is going to complicate material application. So sockets can ben rotated along an arbitrary axis? That might be the way to go.
Ahh okay, I'll have to read up on this then, thanks ๐
We use the PreProcessors to check for Gamepad vs KB/Mouse
To change icons and stuff
When placing the BP in the level, if it doesn't already have a DA assigned to it, it is kind of annoying to select the right one and then adjust it's world position/rotation based on w/e mesh it has. That's my main gripe. So, I prefer that I do a bit more setup work so that my designer can just drag and drop and not really worry about it too much. That's mostly it.
And I've also noticed that when in c++ land, using the construction side of things to update the actor in the editor is buggy. (I forget what the C++ method is called for the BP constructor)
That Mesh stuff is the reason i have different BPs
Just for the Collision actually
Those are the two bigger reasons why I prefer the 1:1 mapping. Small ones, yeah. But annoying none the less.
I use DA's for the separation of the data that won't change
So I could be working on the BP and designer could work on the DA
Have 'em checked out separately
Makes sense
@blissful grail what do data assets get you that a data table doesn't? I still haven't figured out exactly what the point of data assets are
Can you automatically crawl a folder and have all data assets be used or do you have to add them to some sort of table somewhere?
that they are data that are assets
although when people call them DAs I automatically think district attorney
You can give them a Type
And tell the Engine what Folders they are in
Then you can always just get lists of them via the Type
You usually also store them as softrefs
So you load them when needed
DA integrates with the asset discovery system. Which, admittingly, I haven't used all that much, but one day I will. Also, one person can have the entire DT checked out at a time, where as multiple people can have different DA's checked out.
The way I see it is that you can look at a DA as a row for a DT.
You can also cut them into bundles, so a DA can have a bundle for UI
And then it only loads the UI if you want
I haven't personally found a need for that level of indirection of data but I can understand why they exist
Helps a lot when saving RAM
And keeps load times small
And I think they are nice for patching, cause you can put them into different pak files
Which keeps update sizes small
If you have a huge DT, you need to send the whole DT with everything in it to your customers when they update
At least iirc
๐
well you can have composite data tables
You can also update DA's with json.
pretty sure you can do that with data tables too
So you can do quick updates through a simple HTTP request
Yeah youcan do that with DTs too, that's true
not that I want to come off as a big fan of data tables
I think they have both their reason to exists
but the extent of data I manage is a single data table of about 100 entries at most
Don't do much UI stuff? ๐
all my UI is diegetic
I can't think of a single situation where the binary size of a data table would ever be even a consideration. Wouldn't like the entirety of World of Warcraft item list be like 1 MB
I didn't know about json and DTs
All the referenced stuff in it gets put into the same pak file
You can't ship the DT without the content it refs
Ooh ya that's the ticket
And if you are unlucky and you didn't design it accordingly, you might be loading EVERYTHING into your ram when the DT loads
what if it doesnt refer to them directly? ๐
At package time I doubt that matters?
One other thing is that DAs can actually have code
Not sure when you use that
but you can have functions in them
i dont have any uuid or asset class stuff in my dt, its all floats, bools, vectors, and names - so there shouldnt be any association with game assets
Fun Fact: The Ascent has code that alters the actual DA Object
That was used for Loot DAs
Right now, I'm probably not using DA's to the fullest and what not, but I like the flexibility of it.
That's also all fine and would probably be what I would use DTs for
In our games we have GameplayAbiltiies, Effects, Weapons, Meshes, AnimBPs etc. in the DAs
I do, sadly. but it's just not worth refactoring for
I don't see an issue with this personally, as long as the context makes sense. I know some people shun it though. But, it could be a quick and dirty way of doing something statically ๐
Yeah I think we did that to alter drop chances
So basically all chests that were sharing a DA had a common drop chance
when i was trying to pull the direct asset it, it was a pain and not to my aesthetic liking, glad to know about asset association though, feels like i dodged this bullet
If something didn't drop, it would drop at some point later
The sad thing is: Some of you might only find out about all the pain from whatever you might be doing wrong when you target a console
Specifically "old" gen
i gotta look into soft references at some point for particle effects though
For my gun modularity system, I rely on DA's. Each part is its own DA. Then they get combined later on.
Yeah we load every single DA via SoftRefs
well all the packed files from that one data table would total about 20 mb or so
Keeps the Editor quick too, although I'm sometimes not sure what it loads and what it doesn't load. Random af
so I'm ok
I think it's mostly chain refs that people ignore
i figure ๐ particles have been the only hitch for me
DT refs Class A, Class A has 2 meshes, 5 materials, 4 sounds, 13 FX.
Class A refs Class B and C cause of a Cast node or so, which then come with more FX, Materials, etc.
If all of that is in a softreffed DA, nothing gets loaded until you spawn the class
yeah I get that. I honestly wish there were better ways of segmenting logic into classes that needs refs like this though, it feels like a PITA
not all of it
To be fair, you can softref in DataTables too.
ill have to bug you later, i tried to but i kept failing ๐ฆ
You just use a soft class or soft object ptr instead of a hard one.
Yeah, pretty sure you can. But I don't want to write the code to handle that
i think i tried this, maybe i ditched the idea because it looked ugly
I think the only PITA I have with UE is too many things that do the same thing a bit different and never properly :D
So how do you automagically discover data assets?
ProjectSettings has an AssetManager setting
So I can just make a new weapon definition and it shows up in drop tables etc
Baller
Datatables are much better at loading up commonly used data that matches a lot. Keeping a long list of mesh assets a player might use for style changes on the character for example. You can do the same thing in a DataAsset with maps, but keeping a massive map is slightly less intuitive than being able to edit data in a datatable.
For defining classes and defaults and the like, DataAssets are much better, as they often have to differ some, can be hierarchical, etc.
Theoreitically yes
You give the DA class a Type (unique)
Make 50 of them in your DropData Folder
And go to the ProjectSettings
Select the Type and DropData Folder to match
And that's basically it
Some C++ required though
(given we are in the BP channel)
Is that just for the base data asset class or for the automatic discovery functionality?
Both, the base one would have the PrimaryAssetId override, which you then further override in subclasses
But you also make new parent classes in C++ usually
UCLASS()
class UWeaponData : public UCoreDataAsset
{
GENERATED_BODY()
public:
UWeaponData();
public:
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TSubclassOf<AWeaponActor> WeaponClass;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
USkeletalMesh* SkeletalMesh;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TSubclassOf<UAnimInstance> AnimationInstance;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FGameplayTag WeaponType;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TArray<TSubclassOf<UGameplayAbility>> WeaponAbilities;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TArray<TSubclassOf<UGameplayEffect>> WeaponEffects;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FName WeaponBone;
};
Something like this
UWeaponData::UWeaponData()
{
Type = UCustomAssetManager::WeaponType;
}
From looking at the asset manager stuff, it looks like it can automatically cruise for blueprint classes too. We might not even need the data assets. We already typically have a blueprint class per item design so...
static const FPrimaryAssetType WeaponType;
const FPrimaryAssetType UCustomAssetManager::WeaponType = TEXT("Weapon");
Yeah it can
Iirc there is a checkbox for "Is Blueprint" or so
In the Project Settings
Asset Manager tab
But I only used it for DAs
I'm trying to figure out why my material billboard with "size in screen space" enabled ironically DOESN'T size in screen space. Anyone know why? The billboard is just a set size as if the "size in screen space" isn't enabled. The setting doesn't change anything. ๐ค
is this setting bugged?
Anyone know why tf I can't add a new physics body for a specific bone? I've looked it up and supposedly there's an add/replace body button but I'm not seeing that when right clicking a bone.
(not sure if I need to put this in another channel)
there is always #legacy-physics
this is physics related, but i think its in the bottom ~~left ~~right of PHAT
is it normal to have a bunch of these in your anim blueprint if you need variables sent over? 
Ohhh just figured it out ๐คฆโโ๏ธ I didn't realize I could see the bones in the physics asset. I thought I could only see the bodies. Thanks dude that sent me on the right path!
Is there a way to trigger a hit event when the physics asset of the player mesh hits the ground? I just want to add a sound of the body hitting the floor after it ragdolls
I guess that's fine if you go very Event based
is there a smarter way? 
Most people I guess just have the Rolling boolean on the Character, and pull that directly
Most basic way is to use the Update event that the AnimBP has by default and just polling the data
Is that the best way? idk
wait really, is it okay to just do it every frame? I was always bonked for it
It's the smallest of your problems if you ever need to optimize
well i always thought that casting every frame is a big nono and 
:P case once and save the ref?
AnimBPs have init nodes
And you could even check if the saved ref is valid and then not cast if it is
etc etc
you clean it up by adding "Create Event"
And yeah, CreateEvent is a nice thing to know about
that is neat!
Cause that also allows you to bind from within functions
Or even stuff in other objects
also could it be that overriding montages with other montages is kinda buggy? 
Is there a way in blueprints to check if it's being played in editor and not a packaged build?
Hi All, I'm a little confused trying to figure out why I can't cast to a pawn was hoping someone might see something I don't.
When I run this it is hitting the fail condition
i think "print" is development only
so if you do some UI stuff you could package that as debug
Well I've got some code I just want to run in packaged build
yeah print string i believe is development only if you look at my picture
Where are you setting the player ref?
well thats what I'm trying to do here. I thought I had it set to the pawn in the level
Oh nvm
yeah wish I could have cut out the bottom section with the onclicked but wanted to show my side menu settings
Is the player pawn for sure the thing you're casting to?
That's what I'm wondering. I really don't have much in my scene I have the JFMVPlayer_BP which is based off a c++ pawn class. PlayerPawn
I figured it out, there's a "is packaged build" function
Did you set it in the game mode to be the default player pawn class
I thought I had, but I would not be surprised if it switched back on me somehow
annnd it looks like it might have
And that fixed it!
Thanks!
I cannot tell you how happy I am for you bringing this to my attention @tawdry surge you fixed a huge bug for me and i got my quest tracker debug working as a result
Cannot tell you how happy I am to see the below in my log readouts
Hello any idea why my particles are not destroyed when the component end overlap ?
id guess those particles do not belong to that bp but exist in another bp
they are .. :/
I'm not sure , but I think in that particle system, the flames dont disapear when system is destroyed
so your door or whatever is spawning these particles, the overlap is on this door which checks for player leaving it, then attempt to destroy them after they've spawned?
you know, you're spawning them at location, so i dont think they're considered components
Casting every frame is negligible. The processing of casting is basically free, the IsValid check is what costs. But even it is not a problem. You could do tens of thousands of blueprint impure validity casts before you even register an actual problem with this act. Casting is only an issue for memory purposes. And the AnimBP is going to exist when your character does anyhow, so that factor is also a moot point. TLDR, cast to the character, it's basically free.
i see
@brazen merlin they are scenes ,
thank you! 
how do you weld meshes to eactor in the construction script?? what was the nodes name
but you spawn them at location, so id assume they are not components - try using destroy actor anyways
if your particles live in those scene actors, then they dont live in the actor where destroy component is called then
Attach Actor to Component ?
yes, thank you
@eternal drum do the mesh components already exist and are they inside the same actor?
Just attach them with auto weld checked
yes, ive got it now.
No need for anything in construction script
I must be missing something obvious here, I've set up this macro to determine Tap & Release, Hold & Release, and 'While Holding', but for some reason it's not working as expected.
Event tick gets passed through after the retriggerable delay is met, but should be stopped from letting the tick through if we release before the delay is complete.
Once the delay is complete, we should block the 'Tap & Release' gate, and open the 'Hold & Release' gate.
The delay (and "Holding...") seems to trigger anyway, after the Tap & Release.
And won't stop "Holding" until I click a second time, at which point every subsequent click gives me "Held" instantly.
I think the enhanced input system can actually handle this scenario. If you want to dig into it.
I was considering it, and perhaps it's just the documentation, but it seems overly complicated from my brief look. Perhaps I'll have to dedicate a day to running through the plugin.
what's that ?
Plugin ?
ahh, only 5.0?
Not sure
No, it's in 4.x as well
nice
In a way, I'd still like to solve this logic issue above anyway, as it's sort of confusing me and it's a learning opportunity in itself.
my single click/double click/held macro is way different
Is it working? ๐ And would you mind sharing a screenshot? Perhaps I'm overcomplicating things
How do i make buyonacy only affect a specific child in blueprint?
Thank you!
Np
Is there any major Pro or Con to having Having 3 copies of same variable VS 1 Variable going 3 places
Readability. The left with a bunch of other things in the same graph is easier fo someone else to read quicker, otherwise you have to follow where each line ends up.
that's how a usually do it, didn't know if more variables in the graph = more code
It'll have to fetch the variable for each call regardless, so should be identical
That's what I assumed
I prefer the left version much better. And my blueprints, the only thing that is ever extending from one node to the next is the execution pin.
I do both, Left when copy/pasting, right when I'm debugging and changing variables around
This is a full tire model done in blueprint. Completely readable.
Hello! Newbie question here but I really want to learn how instead of just copy+paste stuff
I'm looking to have a random seed, and every subsequent seed will be conditioned on that initial seed for that level
For example, I want to spawn 10 different pawns out of a possible 50, and no pawn repeats itself, and then 10 different prefabs spawn that are still locked to that initial seed, if that makes sense.
okay... where do you think you need to repeat yourself?
What do you mean by prefab?
Not really.. define seed too
I think what he's getting as he wants one seed to define the random pawns that spawn as well as other stuff maybe? Sounds like a good fit for random streams
I think I need to have a random sample?
have a manager actor that generates a random seed, then uses that seed to spawn whatever you need to spawn
no repetition needed
by prefab I mean objects that could spawn in the scene dictated by the seed that was called once, (the seed is tied to the player)
yes!
Yes you probably want a random stream. Read the documentation on that
Given a seed, a random stream will pop out random numbers in the same order.
Fantastic, I'll look into that. Thank you all, got the ball rolling for me โค๏ธ
I'm making a VR project and I would like to keep track of the objects being held for either hand. I am currently doing so by storing the object Actor as HeldActor_Left/Right and this works fine. My problem is that when another player comes by and grabs the object out of my hand, the HeldActor variable for ME does not update to reflect that.
I've been doing thought experiments to figure out where I should handle the tracking logic at and if I should use Event Dispatchers, and if so where. I've come to the conclusion that I should make the Grabbable Actor fire out an Event Dispatch upon a new Grab and the last interacted hand should receive the dispatch. I'm not sure if this is the correct way and I can't wrap my head around a proper way to implement this.
I know that unreal is used for other stuff like cinematics and visualisation, do those industries also use blueprints?
Yes.
with BP, you can make scripted stuff on the scene without having to manually key them in
Isn't this virtual production week? Or was that last week?
Last week I think
I need the target of my BP be all of the potential players. How can I make the player index be for more than one?
Why won't my widget show up when trying to assign default?
Cuz it doesn't exist in that scope. You need to make one or pass it in
And don't do it after DestroyActor
I made the widget, that's how I'm able to make it a variable.
good catch
I should mention that the widget is for UI, so it is always part of the level\
Ok so I was trying to implement a feature into the ALS system but it wasnโt workingโฆupon further investigation I came to realize that the Impact normals being returned were garbageโฆthey are just plain wrong and I donโt know what could cause itโฆ
Here I will show you the printed results from a character standing on a 40 degree angleโฆthe results from the ALS Project are wrong and the one from the other is what itโs supposed to look like.
Again I was standing on a surface with a 40 degree slope and simply running a line trace down to the ground in both. In fact I copied the function directly from the correct project over to the ALS one just to prove this.
If anyone has any idea as to why the Impact Normals in ALS are screwed up please let me know
I have no idea what ALS is
The issue was that I had 6 other actors in the level all printing out their values and I also had the surface rotated along a different plane....I never even considered that to be causing the values to invert
@odd ember It's the Advanced Locomotion System
I forgot that all the AI on that level were all children so they were printing out the same thing
have you considered asking the creator?
generally it's difficult to help people with plugins since you cannot expect everyone to have those plugins
Nah it was my fault
I'm just starting to wrap my head around vector math in Unreal and didn't consider the rotation of the actors
@midnight otter you may have created the widget asset. But you still need to create a widget object in the level in order to have one
hey, so when I switch the default pawn class to my second player on screen. I am still controlling my first guy. I want to control my second player.
I have a GM_MasterGameMode that has the OnPostLogin event overriden. I have a child GM_Game mode that inherits from the master game mode. It does not overwrite the OnPostLogin event. When I press play, the game ends up spawning my default pawn class twice. I'm not sure why - is there something that I'm missing?
Figured it out. I was forgetting to actually posses the newly created pawn.
How do I go about doing that?
Create widget node. The return is the reference to the widget object.
You can then promote to a variable and add that to the viewport
i've been trying to figure out why it keeps sending raycast to the middle of the map, any help?
as for code i'm getting a the closest distance to a actor and sending a raycast to closest said actor
Any "hidden" meshes?
not that i know of
I had that issue once where the hidden meshes were still stopping the raycast
- even though they were hidden
Can you check to see what actor was returned as the closest actor?
so it's detecting the floor and my character
But to answer your question, ignore should work...
I'm starting to get the hang of this, how do it to change the ui widget? I'm trying to make a counter that tells the player they picked up something by changing a text block that says aero next to the picture resembling the object to a 1. This isn't an inventory system either.
There should be a SetText() method
Well the issue is having them communicate in the first place to change activate the set text method, but getting an object to communicate with a widget is difficult
You can create a reference to your widget and then create a function in that widget to update it.
Then in your object you can do a widgetReferenceName.TheFunctionYouJustCreated
Create an input parameter in the function you just created
and then pass whatever value you want in there - in your case, the number 1.
Sorry....mixing C++ and Blueprint... In Blueprint, you would drag the widgetReferenceName into your Blueprint
And then you can drag out and the function you just created should show up as a node
Then you can pass the value in there - in your case, the number 1.
Is it possible to select from a drop down menu in the details pannel for an exposed parameter? example being; Select gun A,B,C then only execute blocks that are related to A,B,C
If so, what would it be called for me to google it
Would a small fishing game be a pretty simple project for a beginner to get started on and get their toes wet? Ive mostly done asset/level design and want to try working with some blueprints.
small scope is always a smart choice, projects can grow from that sometimes but be mindful of scope always. Plan an end point; dont let it go on without a solid goal.
as for it being about fishing, that comes down to what will actually happen gameplay wise. It can be simple or it can be complicated, depends on the idea. Roll with what you know though, decide what the mechanics are and if they are doable for your skill/knowledge, if not, cut and try something else. Have fun expirementing.
I know there's a node to convert this reference into something i can use for the target, but i've forgotten what it's called. Any help?
Thanks for the advice @brazen merlin I'll see if I can get some base functionality then go from there.
try dragging off of your variable (static mesh comp) and then look for set rotation
Never mind I found Enums
I found addlocalrotation and that seems good enough
Anyone know how to find where an anim notify is coming from?
(tried asking in #animation but this might be more of a blueprinty question)
I can see the notify event being executed in my blueprint but I can't find where the notify is coming from (which animation asset is triggering it)
Better not crosspost unless someone explicitly redirect you.
yep just answered it too
I've got a crosshair in the middle of my screen - how do I do a line trace to that position?
Is BeginPlay supposed to be called immediately after Spawn Actor? So, you can assume that if you have Spawn Actor -> Some Other Node in your graph, the actual execution order would be Spawn Actor -> Actor Begin Play -> Some Other Node.
yeah, when the actor first comes into existence it "begins play"
so in some cases you dont want to have begin play call, you may want to do stuff to the spawned actor and then "activate" it yourself with a custom event call
Hmmm - that's what I thought too, but currently, it is in fact, not being called before the following node.
anyone know how to possess a character without moving the camera?
Okay so I FINALLY figured it out, but now the text wont change ( i found it communicates with a print string node)
I tried using the icon's opacity instead of a text counter, but that also doesn't change
This is with the opacity changing
I changed that value for the param to 100 assuming it would change the opacity to 100%
OMG
I feel
THIS
The middle set of nodes was the issue
The correct way
Thank you @devout latch @tawdry surge @dark crow For all the help
So you created the 2 different Berry Widgets but you stored the reference to the one that you could not see since you didn't add to the viewport? That was the issue?
Is there any way to run blueprint logic before game mode and game starts calling begin play
???
Anything that is on the same execution path without any kind of delay nodes between them can be thought to be executing at the exact same time, so even though you've spawned something, the next node is going to fire basically immediately which could potentially be before the begin play of the spawned actor.
Yes that is my problem. I have fix with putting dealy node (0) to wait a frame in all my actors but its a messy fix. I have C++ systems being setup in GameMode begin play and want them to setup earlier than that so I can avoid delay nodes.
Hey guys does anyone know how to add subtitles on media player ?
Guys, what's the best way to find the height difference between objects?
Is this correct?
yes
@devout bane construction script?
wanna becareful if u get data outside those scope tho
stuff is setup at game start
I thought that stuff is ran when you create a instance of blueprint in editor
construction script runs whenever the object is constructed in any setting
including in game
except on network clients I believe
So I would have to do a check to make sure game is running then
Does anyone know how to disable "Start with Tick Enabled" from being checked on by default when creating a Blueprint in your project?? In an Unreal live training video, Zak Parrish said there's a way to do it by editing an ini file but didn't remember how during his limited time for the training session. Can't seem to find it with google
how do I reorder the graphs? I can't drag them...
ask it
all entries? for loop
@brazen merlin is this the correct way?
yeah or you could just use Array Element instead of that Get node which is redundant
oh thanks
Where do you guys typically program your big game events? EX: spawn next wave, manage enemy count and timers, increment amount of enemies in next wave, etc.
It's a single player game so only the server (player 1) needs access. Currently I slapped most of that code in the GM, but maybe there's a better/common practice?
good enough
Game mode is a fine place to put logic like that
GM is good enough as its accessible almost by every actor.
"where to put logic" can be a pretty relaxed question for single player games
but yeah, spawn waves and tracking overall enemy strenght and stuff all of that is good on Gm
Best secondary alternative I could think of would be to do it in a custom Actor class, could add a little flexibility, but nothing major
Think that'd make more sense for reusability
or flexibility rather, as you pointed out.
for a scenario where a level would play differently
you wouldnt need to reinvent the wheel, or keep inheritance to the same base GM
yeah or if you wanted to have "One enemy force over here, and another over there", you just throw in 2 actors
nice thanks all! tried the custom actor route too and that seemed to work well. to avoid less work ill leave it in GM for now ๐
for some reason my grid meshes bottom faces are doing this, the top faces look normal
this is how triangles are setup
how can I fix this
shouldn't it be Grid Resolution -1 instead of +1?
otherwise I really don't do mesh stuff
i did originally do -1 but it made one side of the grid longer than the other
+1 fixed that issue
?
Whoops - wrong channel
So if a player controllers control rotation is from 0 to 360 and all actor rotations are from -180 to 180. How do i set my control rotation to match an actors rotation?
use a rotator
+-180 depending on which direction you convert?
or use quaternions
All Rotator functions automatically convert rotations from 360 to -180 to 180 in Yaw and Roll or 180 to -90 to 90 in pitch case. Setting a control rotation Yaw to -90 is the same as setting it to 270.
Also worth noting that this wrapping is infinite. EG setting a yaw to 2790 is still the same as setting it to -90.
Almost sounds like a modulo is going on ๐
It is. ๐ Pretty much every function that uses a Rotator will normalize it.
Does it sound reasonable with 3 manager components separated for NPC's, Buildings and Resources (being both source(trees) and products(log etc) ? feels like im fumbling a lot back and forth but I think this will do fine for the ISM's im using ..
guess it's a hard question to answer reliably without any more context xD
We have a manager component in TRS2 that manages a single float. O.o So. Make a manager for everything!
the products are basicly just a transform and a FGameplayTag ๐
the others got a bit more under the hood, but not much really
hello guys how to deal damage over time if i stand in some area
Oh. My bad, it's an integer. ๐ Basically just a class with a bunch of delegates that fire when the integer is changed. Has other properties for using in it's own functions, but it's realistically nothing but that integer and some delegates.
OnBeginOverlap -> Start Timer -> store reference
OnTimerEvent -> ApplyDamage to stored reference(s)
OnEndOverlap -> Remove reference -> Stop timer if no more references
using UObjects?
No, this is an actor component on a main game actor.
what is start timer?
Basically keeps track of an important variable. But yeah. ๐ Managers for anything.
Sweet. I wonder if i should swap my AActors for UObjects, but im not sure if there's any risk involved (and if i'll save any performance anyway)
premature optimization at its finest
start timer is what "Set timer by Event"?
Yepp
how i can store?
i mean as int or
what
Sounds like reading up on some basics could be in place
variable types, references and whatnot
the return value or Set timer by event is struct
its a timer handle
a handle, to the timer
you want to store whatever actor is overlapping (and should be damaged, so a check for a tag or cast could be in place, unless you've got the proper collision setup, in which case only the damageable actors would trigger the overlap)
so this is how u are saying?
Close
All thats missing is the actor reference
If its singleplayer, and only the player can be damaged, then it can be regular var
Otherwise you want a container for it
Working on a combat system where part of it uses mouse movement to decide what actions to take. Currently I have this system set up on a timer, but it isn't 100% reliable. Any thoughts on something that might work better?
Maybe a bit more context how you would want it to work would be nice
collapsed graph ? for something that sounds like ABS ?
I've set it up so that holding the action key along with the left MB and draging in horisontal or vertical directions will trigger the attack. The timer running the function is started when the left mouse button is pressed. The colapsed nodes are simply square root squared to make sure the float value is possitive.
Its just not very consistent in reading the mouse movement
๐ค I think I get what you're trying to achieve
instead of using a timer, I would create a threshold mouse speed
and once the mouse movement speed falls below this value for more than X seconds, or changes direction drastically (unless you want to read 1 swipe at a time) only then get the difference
for this to work, you would have to use a bit of event tick (to calculate the movement/frame) in combination with custom events
Yeah, probably. Though just started with unreal engine a mont ago so I don't feel comfortable going into c++ quite yet with no prior experience.
Hey, any reason why child colliders stop working sometimes when the root is a collider? I have a box collider as root and a capsule collider as a child and they both overlap with the same thing, the capsule stops working after a few collisions.
Both root and child collider have the same collision profile.
any courses/tutorials recommendations for using structs within arrays?
would generally advice against it
Any specific reason for it? Have used this for my inventory system and it seems to work perfectly for it.
Might be referring to the tutorials more than the method itself
why would you need a tutorial for this though
because I simply need it
I don't understand who would make a tutorial on using structs within an array
that's not something that needs a tutorial
Very impractical to work with in the first place
I've also never seen anyone use an array of structs, what could you possibly need that for?
Like what exactly, I could see maybe a map with structs
but an array of structs sounds hard to use
it is
as in I wouldn't remember where things are
Arrays of structs are incredibly common. You actually use them without even realizing it when you create things like arrays of GameplayTags, or Arrays of Vectors.
relatively is now like 15 versions ago, so perhaps more dated tutorials handle this differently ^^
Is that what gameplay tags are? ๐ค surely it's a bit different though right. How could anyone reliable figure out what index the struct is in?
Add your own index to it. Integer, FName, Gameplay tag, etc.
Also. TMaps don't replicate.
In a TMap you'd still need a custom search function
so it's not like it's that different
I avoid TMaps like they're a plague unless I am just using them for static data lookup.
plus maps in BP are ~~terrible ~~ not as nice as in c++ ๐
Eh with a String And Struct TMAP I don't think it'd be all that difficult. I actually didn't know though that people use often use array structs, maybe that's more of a c++ thing? Because I've certainly never seen it in a BP
searching an inventory TMap for existing item based on struct detail still requires custom function for it ๐
Its not like it solved the issues with an array of structs
generally containers are iffy in bp imo
then again I only recently ditched them so my word holds no value ๐ ๐
I do it all of the time. It's less about BP versus C++. It really just depends on how the array is and what you need it for. TMaps are convenient in that they come with the ability to specify a key and then a value and come with accessor functions predefined. You have to recreate this yourself. Though this is a fairly trivial task. Simple compare and return function. Admittedly it's slightly more difficult in BP. It's two functions either way, but in C++ it's about 5 lines of code total. Need to overload the Struct's operator== function for a type, test the struct and return. Then make a find function in the place using the array which can just be a FindByPredicate.
FindByPredicates are much easier in BP when you use two functions for it. One loops, the other does a simple check and return.
Also useful to put in libraries in BP.
But yeah. Networking game wise, TMaps are terrible to use in a lot of cases regardless of C++ or BP. They can only store local data. You can't RPC them, or Replicate them as properties.
Glad im not doing networking in a while
TMaps are great for sparse data structures
I use them for sparse grids
I created custom event in blueprint function library, but I got this error, why? What does it mean?
TMap<FIntVector, AActor*>
You can't have custom events inside a function.. not sure why it even let you create one in the first place tbh
I created it like this, I just need callback from Call URL
Blueprint functions cannot contain asynchronous logic
So what should I do?
You can try dragging from the callback pin into the function node, which might work and allow you to create a delegate pin on the function call itself
This way you could bind something to the event where the function gets called
I created BP Function Library called "BP_Login_Controller" because I want some controller where I could handle logic of my app
You could create it as a regular actor or uobject
or include the logic in your game instance, game mode or other such place
Function doesnt work either ๐
yea but I dont want to put everything into game instance, I would like to split it to multiple "files"
to not have a mess
in code
Well you could then use a separate UObject or Actor for it. You'll just have to make sure you spawn one to handle it
On C++ side you could create a "subsystem" for this, which is nice for this type of "singleton" logic, but unfortunately it's not possible to create them from blueprints
Yea but then I have to spawn Actor like game object in game, isnt possible to have "just code" without spawning it into game scene?
You could create it as a UObject, but pure-BP UObjects have certain limitations such as they can't spawn any actors on their own - not sure if it'd be a problem for you though
It shouldnt be problem I think
Yeah
I will check it ๐ thank you ๐
๐
I think the best approach will be to create "classic" BP Actor with Logic and just spawn it into game scenes where I need it ๐
Yeah, if you're not doing C++ that would probably be just fine. It's not unusual to have invisible actors doing some kind of logic
I just wanted to have some defined functions in "background" without need of spawning it
It would be possible to do that in C++ since you can create a function quite easily which has a delegate as a parameter, but BP's are a bit limited when it comes to that
okay, because I dont want to do things against "best practices" ๐
Is there any way to make like a playerinstance that stores values for each player which i can pass on from one level to another? Or do i just have to find a way to use the gameinstance?
GameInstance is the only thing that's persisted across level loads (unless you use level streaming, which may make some things more complicated)
Ah i see ๐ฆ Is there any ID that can separate players so i know which player is which in the new level then?
Perhaps ask on #multiplayer , I'd imagine there to be something but not sure where you'd find it
oops, im sorry i thought i was in #multiplayer๐
This sounds really interesting. I'll have to try it out sometime. I'm unfamiliar with finfbypredicate. Thanks
just question ๐ if I have some logic in BP Actor in Custom Event how can I access this Event from Widget BP? ๐
Event Dispatcher, BP interface, or cast
All of which requires some valid reference to desired Actor
boo casting
Casting is fine (depending on what you're doing)
rip
my lead programmer would kill me
Dispatcher doesn't require a reference
they do
not from the sender
but as a reciever ๐
you must bind to it by reference
So to self
Yes cast is no problem, but how do I get reference to that actor from widget in first place?
So hard
Not self
Then you're making it harder then it has to be
If ActorA wants to listen to ActorBs dispatcher,
ActorA must bind by reference to ActorB's dispatcher
Feel free to prove me wrong
It'll be a bit till I'm at my PC but I'll drop a SC then
It's fine until you start hard coding your entire game with it 
Yeah, it's good to know the alternatives :)
Sounds fun to work with ๐
Random side note. I need to make a blog or something. I need to make a write up on how casting actually works in the engine.
Is any lead programmer generally fun to "work" with? I mean they're usually pretty cool but it's mostly their way is the right way, and the only way. No offense to the current and previous leads
I think many would benefit from that (myself included)
1/2 in my experience ๐ My first one was as you describe. Second was actually listening.
I'd say really depend on the person, because power complex causing egoistical decisions and not allowing for leeway/experimentation.
how do you store left hand position for different weapons?
By using sockets in the gun mesh.
Mention the part where people should start using soft references instead of loading everything into the engine with object references even when they don't have to pls
That Sjoerd guy from epic has like three hours of videos on it. Kinda surprised they didn't transcribe it and add it to the docs
Any idea how to exclude object from motion blur?
Geeks with power. ๐ But no in reality they 'usually' have a reason for that. Junior or new programmers may not have the full scope of things happening in the code base. It's not always easy learning from the new ways of things, only to have to deal with how things were done even five years ago. Stuff changes rapidly, people learn differently, and you have to keep everyone on the same page in a massive code base.
Sort of depends on the actor relative to the widget ? Is this some collision thing, health bar, interaction menu ... ?
Hello, I have two health bars on top of each other, one that jumps immediately to the new health and one that's supposed to follow it smoothly. I tried to do the latter with an interp node but it doesn't work and instead jumps straight to the new health. What am I doing wrong?
No I have Widget UI and I need to get reference to Actor in scene from that UI
true, I will admit I actually couldn't figure out how to properly use soft references the first year I tried, and object references worked fine so I didn't even really have an incentive. ๐ค
Situations easily arise if the lead is unwilling to share any of the knowledge/experience/reasoning for it tho.
for me it's good morning Guys. I wanted to see if anyone knows of a video that can show me how to populate the inventory slot size. So lets say the player inventory has 10 slots and then he unlocks something. and then 5 more lots can get added to his inventory. I been trying some samples. As all ways I can't get it to work, anyone have some ideas.
Truth. Refer to first line in that case. ๐
wouldn't you just need to change the number of inventory slots available, and then assuming your using a procedurally generated UI for adding slots... it would automatically create the extra 5 spaces
If you're making all your inventory slots manually I'd advise against it
No. I not. See I have a variable called NumberOfSlots in the inventory component. This sets the number of slots for the players inventory
and no I don't know what a procedurally generated UI is
so when something is made procedurally it just means there's usually code written to do something automatically I guess? I think that's the dumb way of putting it
Oh, ok.
So instead of making a UI with 30 inventory slots you make a UI with no slots... and then write code to automatically create X number of slots for you. That's procedural
That's just want I want to do
do you know of a video that can show me just how to do that. The samples I have found on google. are very old and just don't work.
Hello everyone. This is a quick Tutorial, how to create an Inventory System.
I used the Version 4.27.0 of the Unreal Engine for this one.
Discord: https://discord.gg/exuHzHjahe
Map: https://www.unrealengine.com/marketplace/en-US/product/modular-houses
Assets: https://www.unrealengine.com/marketplace/en-US/product/smart-archviz-interior-pack
Hmm, I'll check it out. Thanks and have a nice day
something in here makes the game crash at some point, idk maybe some brilliant minds will see through it
wth
become the brilliant mind and check the logs
the thing is
it loads the level after the invalidate
and if i dont invalidate it
the timer still goes despite all the lag spikes and stuff
and when you play it in standalone mode everything goes to shit
there's just so much wrong here.
;D
thats the only way rn
well gl then ๐
whats wrong with invalidating timer after it ticks tho?
it will still do the logic after
You still dont need the timer
but it first waits till the level loads
you're instantly bypassing it anyways
no it works man
You're sitll bypassing it
how do i replace it then
theres a delay and it does
What is this monster?
๐
Literally curious. What is this for?
Its code the works perfectly that crashes game
yes
but only in standalone tho
i mean its not crashing only in editor
lets put it that way
You should still fix it
clearly not working correctly when it breaks in standalone ๐
yes because its my commercial project
This seems oddly complex for a slideshow.
its just every "slide" is in a different level
and i couldnt do it otherwise
im pretty sure its the level load that gives an error
First of all. Ditch one of those bindings.
You can do it otherwise, i've just shown you ๐
Why not have the level tell the gameinstance that the level is loaded, and then game instance waits X time and loads next level ?
and yes, ditch one binding
You have two things doing identical things. Cast to the base class to get the level name, and only do it once.
As in your SlideshowButton1 and SlideshowButton2 widgets need to have a parent class that has the level name, button press function and delegate to call.
Also on this note. I would consider ditching those entirely, that's way too complex.
Have an array of level names in this place. Make buttons with a simple on click and create them by passing in a simple integer or name. Use that for clicking the buttons. This randomization logic doesn't need to use the widgets, remove them entirely from this and only use the array of names here with a randomize integer.
^ This
Ho do i take text input
In what context? Like allowing players to write something to a variable?
https://www.youtube.com/watch?v=zncQpFk88tA&ab_channel=MathewWadstein
https://www.youtube.com/watch?v=tc9QpPzmrsM&ab_channel=MathewWadstein
You can make widget to take input.
Yes
Pretty much what G33k said. Make a widget with an editable text box. Use the widget's OnTextCommitted, or OnTextChanged, or a button to do the logic processing you want to do with the text.
Ok , tysm
i believe that is what im doing?
im populating the array of buttons first
but i can only use this array in the future
Hello any idea why it doesnt get the overlaping actor (which is cone) i turned on the overlaping events on the actor.
how can I access level blueprint from Widget BP? When I type "Cast to Level Blueprint" nothings shows up
What are you trying to do?
probably easier to tell the widget instead of asking the level
I have Widget BP, and I created Blueprint Actor which holds business logic for that Widget BP, so I want to call some functions/events in that Blueprint Actor from Widget BP
so that Blueprint Actors acts like "controller"
and Widget UI is "view"
and you wanna tie them up via level bp?
it doesnt need to be via level bp, it doesnt matter I just want to see each other ๐
because I dont want to mix logic with UI
if there's no ties to them, no collision nor traces going, a dirty get all actors is possible
I feel dirty just by typing it
yea but it is no correct way I think ๐ I wonder what is the best practices
Depends on your setup
but usually there's some connection between them ๐
Perhaps it could make sense for the Actor to Spawn the widget ?
even UE devs says that we should not mix UI with logic
Separation of business logic and the visuals of your UI
UI is simply for displaying things
yes
UI should not be responsible for anything beyond userfriendly conversions
right now widget is spawned by level BP as level is loaded ๐
yes
So since you're already spawning it by the level bp, perhaps it makes more sense to spawn it in the actor afterall
I mean solution is to put all logic into game instance but its dirty ๐ I would like to pslit it
(altho there are better places to spawn widgets)
it should work in this scenario, but what if I want to access other actor (other controller) from that widget? ๐
Sorta need more context
Almost sounds like you're clicking on actors
And if so, there's interaction going on
And a trace result to be used
Also on that note. You don't access the level blueprint from a widget. You don't access it from anything. Advise against creating UI anywhere other than other UI, AHUD, or AController, unless it's in a WidgetComponent on an actor.
Also advise against the level blueprint. Make actor classes for managing level wide logic if you need, and do a GetActorOfClass to reference it, or set a reference to it in someplace like GameState.
Hi can I ask questions here about widget? Guessing I can, so ive been working on unreal for about a week not a long time and I keep running in to same problem widget not showing up and that is the only thing I can't get working
Simple answer is "CreateWidget, select class. Drag off of the return and AddToViewport."
Long answer is that it really depends on what you need to display, how you want to display it, what needs to show it, etc.
well i'm going to say it now that its not a hud, what im creating is when I interact with a object it should show some text, lemme try to do what you said
Can be something as simple as hiding and showing a WidgetComponent on the actor. If it's an actor.
where can I check that
It's a component you add to an actor, similar to a StaticMesh.
My Widget BP contains user and password fields for login and button, after clicking on button I want to run some logic, and this logic shouldnt be in Widget BP, so I wanted it to run in Actor BP called "BP Login Controller"
Easy enough. Just make the controller add the widget to screen, pass self as an exposed property. Use that to call what you need on the controller, and pass back the GetEditableTextBlock->GetText
Sounds like widget component space
and what if I want access from that Widget multiple controllers?
At the same time?
yes
if my widget will need to use 2 different logic
like from 2 different controllers
over course of level ๐ I mean when some callback or event happen ๐
how do i create a boolena, how do i set it
@maiden wadi is it okay if I send pics of it, ive rewatched the whole guide haven't found a problem
how to get image size (widget)?
Just started UE5 a week ago or so and realized delays are only counted by their execution in for loops and not by the actual time. So now I need to make my own macro according to resources online. Is this issue the same with c++ In UE5 or is it just a blueprint thing?
C++ does not have delays in this sense and you cannot delay a for loop in C++ in this way either
I'm not sure what you mean by "counted by their execution", but a delay in a for loop will only run once, as each iteration of the loop retriggers the delay node, and each individual delay node will only ever hold one delay at a time
how do i create a boolean, how do i set it
look in the variables panel, create a new variable, set its type to boolean, then you can set its value the same way as other variables
ok thx, but how do i check if its inside a trigger box or not?
I'm not sure if I follow... it's a variable, it isn't really inside anything in that way
yes, forget about the boolean, i want to know how i check if an actor is inside a box trigge
r
you can use the Begin Overlap event to detect when something begins overlapping with something else
Thank you for clarifying it! So I assume it's just as complicated for some sort of timed/delayed loop in C++ as it is in blueprint?
I'm wondering cause I'm trying to do something similar to this:
- Have a for loop between 0 and 2 (so I presume it loops 3 times) that runs it's loop body after 2 seconds each time a loop is done.
Example:
For loop with index from 0 to 2:
- Wait 2 seconds
- the rest of the body of the for loop
Yeah, you would probably use a timer in C++ to do that, so you'd be iterating the list manually in the same way as in BP's in that way
wouldn't you use a timer instead of a loop if you want delays ?
You could in theory use a thread, and actually just sleep the thread, but it may come with additional complications depending on what you're doing in the loop
i made this but its wrong i want to create a boolean that is true when the thirdpersoncharacter is inside the boxtrigger
Hover over the Blue Note, you dont need to cast
You might want to look at some tutorials on yt or such, I'm fairly sure there's a bunch that cover how to do this :)
Ah, Im not too sure about the functions that UE5 blueprint provided since I'm relatively new to using the editor. Usually with other languages I can just have some sort of time check with a for/while loop, or with Unity there were other ways to time actions/operations.
I'll look into using timers. Thank you!
Got it. Thank you for the advice!
Yeah in Unity it's pretty handy to do this using coroutines so you can just yield in the loop body
Nothing has been set into the variable you have named "AsThirdPersonCharacter"
yes i already resolve it thx
what does this note actually mean? it does not disappear no matter if my delegate passess by reference or not
i made this to test
can you tell me why i only can see the test when tolerance is more than 10000
Here is a delayed loop i setup
its just a bp thing, you usually can ignore it. It just means that the arrays cant be passed as ref or something i am not very sure
This is a little bit strange. You're effectively adjusting the tolerance based on the X distance between the two. So if the actor is at 10000 and the trigger box is at 0, then your tolerance would be 10000, but if your trigger box is at 10000 and your actor is at 0, then your tolerance would be -10000.
If you're just wanting to know if they're close to each other, you can simply do a GetDistanceTo and then check if it's below a certain amount.
do i use a less equal?
GetDistanceTo <= MaxDistanceYouWantToCheck
Sure, just make sure you plug in a value for the <= and you connect the actor you want to check into the "other actor" on the GetDistanceTo.
I'm shooting a ray out of my players camera, grabbing the name of the object its hitting, then testing if that objects name is equal to the objects name in the script I want to run. (TLDR: Testing if a player is looking at a certain object) I'm storing the name in a blueprint interface, but it's not working when I'm trying to compare them
thx it worked
This should call the "event object hit name" right? then running the rest of the code
You're calling it on self.
Mind elaborating? I don't exactly understand
Interfaces are just functions that run on a class without casting to it. You're calling it on self, meaning it's running in the same class that the trace is being called in.
The first screenshot is a different blueprint than the second screenshot FYI
Yeah. And you're calling the interface on self. Which means it's not calling it on the object that is in the first screenshot.
You're looking to call the interface on the hit component or hit actor.
So that self input needs to be changed to my hit component
I'm quite new so bare with me, thanks so far though ๐ฏ
Correct. And also change the call type to message. Drag off of the Hitcomponent and start typing your interface function name.
It should show up with a message type call.
Hmm. Curious. I just remembered that PlayerController ticks mouse over events and calls them directly on the component's moused over. I might have to try overriding that and calling it on a trace as well when input is set to game only for using "MouseOver" events on stuff from the center of the camera.
Would be a really clean way to implement "look at" effects.
I couldn't rack my brain around setting up the player controller
After watching a bunch of videos and looking at the docs it still made zero sense to me
hello guys, need help with my box i can interact with
https://cdn.discordapp.com/attachments/938823285142085642/938823694652960838/unknown.png
cant make it smaller
any solutions?
Oh, what I was talking about was in C++. ๐ But Controllers are easy. They process a player's input. Whenever you have input in any actor, it's processed from the controller. They're also responsible for networking stuff on clients. Essentially a player's nervous center in the game.
Oh, were you asking for help or suggesting that to me? Didn't mean to space you out
Just randomly considering implementations. Your trace made me consider it. Have done that before with a trace and interface. But I have a personal issue with interfaces thanks to this channel and Youtube.
@frail frostIf you want to make it look like the bottom one, then you need to set it to size to content in whatever canvas panel you've added it to.
That or it was added to a container with horizontal and vertical alignments set to fill, and the container at a forced size. Setting those to center will also work.
im new to unreal can u describe the solution in a more basic way? ๐
how do make tihs rotate the object around a pivot
Have the pivot as parent, then add relative rotation
Also, haven't you asked this question a few times before and people keep repeating themselves?
i can't have anything else as parent since then bouyancy doesnt work
Yes but it never works
ok i had to check this box
@maiden wadi THANK U !!!
rly appreciate u and the community
rays are ment to hit collision boxes
do some testing
you will get there by yourself
does smb know can I make some widgets unremovable? Like it doesnt remove when I use "remove all widgets"?
I don't think that's a thing you can do
If you don't want to remove some widgets you need to use some other method of removing the others
Hi all, I have an issue with scene capture 2D components... wondered if anyone might be able to shed some light?
Basically, there's a BP actor in the scene with a scenecapture2d component, that goes to a render target, in turn used by a material. When the game over interface is displayed, the material is used on an image to render out a 3D model. There are 3 of these, so 3 BP actors (scene capture components), 3 render targets, 3 materials, and 3 images displayed on the UI.
All of that is working as I want, but what I've noticed is a significant impact on performance..
When I run "stat unit", not that I understand it fully, in viewport mode, the game will hit around 35-40ms for both draw/frame. When I run the game in fullscreen mode, this jumps to 50-60+ and makes the game very laggy.
If I delete these actors from the world and run the game, in the viewport the draw call is 3ms, the frame around 16. In full screen mode, both are around 10 and its very smooth/playable.
Realising they would be "working" during the entire game, I set them to not auto activate, and also added code specifically to deactivate them in BeginPlay (just in case!), and then when they receive the game over notification, they activate. I've tested this code with PRINT nodes and the scenecapture2d component is definitely deactivated during the game, and then comes to life when game over occurs.
What I don't understand is why these are having such an impact when they are not activated? Its like they are still capturing every frame, regardless of being activated or not.
Sorry for the long post... but if anyone can help me with this I'd be very grateful ๐
Bit odd answering my own question... but I just found this:
https://forums.unrealengine.com/t/scene-capture-2d-disable/300130/4
Setting the visibility to false (and then back to true at game over) seems to resolve the issue... the ms are still very high at that game over screen, but as its only the mouse moving around it doesn't appear to impact anything...
Not in blueprint. In C++ you can override it's RemoveFromParent. Don't advise unless you really know what you're doing. Alternatively, create your own RemoveAllWidgets function. Also requires C++ to get the GameViewportClient.
so i made this, but the animation is playing inside and outside the box trigger anyone know how to fix?
The fix would be to use montages
i dont think thats the fix coz the only problem is that the animation play inside and outside the box and i only want to play it inside
Calling a one off anim on a character which has an anim fsm like the template third person character should be handled with montages
Is there a way to get the total amount of UObjects within an game instance?
Sorry, when i followed their answers, it almost never worked, which is why I ask so often, in hope of other people that know more of the subject answer. btw i figured it out finally
0.1 <= Distance means you're going to be returning true almost all of the time as 0.1 is almost always less than or equal to how far away something is as distances in unreal are in centimeters. 0.1 cm = 1mm. Getting to that particular millimeter distance would be impossible. Do Distance <= 0.1 instead, but then you'll probably find that you'll almost never execute as the location of the trigger box is a precise point and does not include the bounds it may have where the trigger would normally fire.
Also, if all you're trying to do is check whether something is overlapping, you don't need to be checking distance to something else.
The whole idea of a trigger box is that it can be used to trigger something when something overlaps it. If you want to use the level blueprint, you can do something like this to check if something overlaps it.
Further to this:
So Atm I have an array of actors as my inventory for the time being, and about every 45 seconds the array just gets nuked. At least I think so I print out its contents and its only 1 item. Can Anyone think why this might be happening
Weird thing is I think the length of the array is still the same, just the contents are disappearing
-I also could be wrong about what is happening but from the behavior I see this is my best guess
Hi, don't know if that fit in this section, but I got a problem I can't understand and hope to get help there
When I try to move some component in my blueprint, it move and then, instantly when I click compile, they all fallback to their default location (0,0,0) and I really don't get why... The component are built in C++ constructor if that could be a reason ? Does anyone has already experimented something like that ?
One more weird thing is that after the fallback location, I can't move anymore the component, I see value change in the location box, but doesn't move on the viewport
Thanks ๐
thx
i made this and it worked, but now when im not inside is fine, but if i go in and go out of the box , i can play the animation.
Thanks for the reply, but it seems that's not the problem here :/
ooh you mean compile inside blueprint
Yes
well then yes it's probably because the way they are set up in C++
I'll give a bit more informations if that could help to understand what's going on
I may have setup something wrong here is the hierarchy :
Class :
MyActor extends USceneComponent
MyActor has Component : UBoxComponent & USceneComponent
ActorCharacter has Component : MyActor
Everything is created with C++ with CreateDefaultSubobject, and SetupAttachement basically :
***In ActorCharacter : ***
CustomActor = CreateDefaultSubobject<MyActor>(TEXT("CustomActor")); CustomActor ->SetupAttachment(RootComponent); CustomActor ->SetUsingAbsoluteRotation(true);
***And in custom actor : ***
`Trigger = CreateDefaultSubobject<UBoxComponent>(TEXT("TriggerArea"));
Trigger->SetupAttachment(this);
CameraSnapPoint = CreateDefaultSubobject<USceneComponent>(TEXT("CameraSnapPoint"));
CameraSnapPoint->SetupAttachment(this);`
The issue is when in blueprint viewport I try to move either Trigger or CameraSnapPoint which have for parent CustomActor (which I can move without issue)
^ that, and it has very little to do with how the setup. more with the actual UPROPERTY is my guess.
Ok Thanks I'll try in Cpp section!
can someone help me
Looks like the branch in the lower one is missing a pin
yeah i know its just coz i dont want to delete him i will use him later, after i play a animation the character just dont use any other animations like i pressed left mouse and than after i realeased it i want to get back to walk. How i do that?
hi guys, i have a simple problem ive been pulling my hair out over. I have a folder of assets, all descending/inheriting from one parent class. on begin play, i'm trying to grab all these assets, and connect each one to a button so that they can be spawned in by the player. I'm using the Asset Registry to find the files, and i'm running said files/assets through a forEach to try to extract the blueprint class for each asset (so that i can link each asset class to its button), but i cant seem to actually extract the blueprint class. what am i missing?
You would need an animation blueprint with a state machine so you check on tick if left mouse button is pressed by setting it true on pressed and false on released and then use that bool inside the state machine to set which animation to play when it's true
use a print string to debug out your file path , and make sure its correct
https://www.youtube.com/watch?v=094zfyog_z4 I found this video helpful when learning about animation blueprints
In this tutorial, we'll look at creating an animation state machine and triggering different animations using enumerations (or enums) and blueprints.
Adopted from the Unreal master himself, Todd Bryant: https://www.youtube.com/channel/UCvKM_s6nQhDwEUHz-PJ77nA/featured
thanks for the reply! it's not an issue with the file paths, i'm able to print the name/path/etc, but i'm unable to retrieve the actual blueprint classes (the purple pin i would plug into a spawn actor or whatever). i attached a shot of my current loop, which works and prints the asset names correctly. i've tried using the 'get class' AssetData function, but all that is printed is 'Blueprint' (i'm assuming this is because the asset data definition of a class is different than the blueprint definition of a class).
I have never used Asset Reg, but you might need a {Project Content Dir} appended to your package path
Question: How would one do the math to make a light brighter based on distance, so if far, brighter, if close, dimmer. This is for a flashlight.
and maybe a suffix after Get display name for file type?
If you wanna set intensity manually based on distance you could probably just use get distance to actor and then do w/e you want with that number i.e *2 or /50 etc. You would need to update it continually though
thanks for this, it jarred me into doing a search for converting a string to an asset class, which led me to here: https://forums.unrealengine.com/t/string-to-class/78767/4
Edit: after messing around with this for a while, Iโve come to realize itโs the same issue as using โGetClassโ from an asset loaded from the asset manager. It returns an object class but I want an actor class and I canโt figure out how to convert them. After poking around for a while in the asset manager, I found a way to do this in 4.26. Not...
Also, i had to use Backslashes, not forward slashes
this is my exact issue
Thanks!
Aye, for context, it's based on a timer in a motion controller hand. So if the flashlight's on, the timer goes on, thus the linetrace starts tracking for visible. If it's far, I'd like the light to be brighter. Thanks for you're suggestion. I'm not tracking to actor, but to visible trace channel on a actor? haha
The idea was always to use distance, I just don't know the good math way to do it haha
You might be able to use the hit actor and use that to get distance to the flashlight but as far as the actual number you'll probably have to use trail and error to create your own equation for that
Thanks for answering dude, I feel like I'm still where I was before I asked though haha
That just leaves it at 200,000 the whole time for intensity, because it's not getting any hit actor, this strat is bunk
why are you clamping the Distance to 2 ?
I was following a tutorial and it had that, I took it off since then
ok
In that tutorial, the dude was trying to dim the light the closer he got, that's not my intent, but I tried anyways to try to understand it
lol
I just wanna go brighter when far and dimmer when close so players aren't burning their eyes
I would start here
Rock on dude, I was slightly getting there and just about to add the lerps
You rock dude
set max and min brightness
Thanks man, This is a pretty simple issue, I guess I just brain farted on it all
i do the same , over complicate things and reduce it to a few nodes
all i see in your Profile pic is this
It's my company logo haha. Attainable Entertainment. Seagull with arms
btw, I settled for this approach, works great! Thanks for rubber ducking man!
So yeah, if you guys ever need a flashlight that changes brightness based on distance, there you go. Simple as that

