#blueprint
402296 messages · Page 928 of 403
what to GET if I am casting blueprint UI?
I meant the object
Yes
Is this the best way to take a snapshot of a material and store it?
Basically saying, is this reference what i want it to be before i try to do X on it
Thats what a cast is
When you create the widgey
You need to store its reference in a variable
You don’t need to store them as a variable
You can also get actor of class
You can use getplayercharacter
Not for a ui...
warning when compiling
I mean the character variable
That still doesnt work
It does for me
The character has nothing to do witht a widget
Ok so you got a ui ref
The character variable in the widget
Is what i mean
You also apparantly have no idea how that works
What you mean?
The character is not, and will never be the object to cast to for the ui
If i cast to the ui, i need a reference to it
Not the olayer
What are you on about?
I said the variable in the UI
:)
And you are going to get that how exactly, without casting to the ui
Right
You get the player character right in the widget class
Noooo
I’ve done it multiple times in my game
it says warning though
But it doesnt help at all
Ignore futureize
Ok?
Yes
Ignore you
Because youre trying to use the player var to cast to a UI
Omg
Do you know how to read?
I never said that
Yes you did
No, I didn’t
You said get player character
Scroll up and read through my posts
In the ui
Cast a player to the ui?
That needs a reference to the ui
When did I ever say that?
It was implied
As they were asking about casting to the ui, and what to use as the object, you replied with get player character
I said his multiple variables in the ui are unneeded.
Bruh I never said that
Thats my bad i thought you were trying to help
That I replied to
I was
To answer the question
and listen to who
you guys want to start an argument when I ask a question
You need to get that ui ref you have saved to cast to the ui
What is your question?
I made a remark on you saving multiple unneeded variables in the ui
Wrong
So you can get hud -> get all the ui refs you need
Its quite common
Hud is deprecated definitely, but using it as a non persistent medium with easy getter/setters does help
The actual hud specific uses are ehhh
so I cast to NEWHUD to get the CAMERABAR variable?
Sure, but what if you need certain UI on certain pawns
But its a good container class
Easier to store references on controllers/pawns
And usually what I’ve seen in games
Ok I will restate my question
It all depends really
I have a variable from a BLUEPRINT UI
I want to get the variable
from the blueprint UI
But store a UI reference in the player controller
In some form
can I have an example
GetWidgetUI.AddToViewport
From anywhere
Using the class with that reference
Then to get variables from the ui, cast the player character to your character
Accessing the variable needs an actor ref, in a class you can already cast to, then you can get the ref, cast to the ui and do whatever shenanigans you want
Again a cast is nothing more than a type check
It just wants to see if the reference you have is of the type it wants
I tried casting to newhud and didnt work
No no you missunderstnad
The ui
You have created
That reference
You save
In a var called ui ref
right
You need that as your object to cast to WhateverYourUIIsCalled
So you need to access it somehow
You can store it whereever you want as long as its easily accessible
then what
I like mine in the hud if its for stuff like main menus of single player games
We have given you a step by step
If you cannot follow that then it may be tike to take some beginner learn.unrealengine.com courses
I would suggest looking into some more documentation on blueprints and the actor types
So retrieve that from wherever needed
Using Get (variable name) on the actor it’s in
And then do whatever you need with it
I swear they need to start paying me for that advertisement 😅
Do be warned with the documentation tho
Its iffy in places
No
Not like that
Then get the ref from there
Then set the variable on that object
No cast needed after that
I apologize for how things got a tad heated back there Futurize, it was a misunderstanding blown a tad out of proportion
No problem
get hud when casting to newhud? its not an option
Also make sure newhud is the hud class defined in your game mode
I store mine in player controller
I think it is get hid ye
I lile mine in hud personally however that falls apart a bit for more multi use elements like enemy heakth bars etc.
it is
I only use my hud class for doing main menu, and player HUD type things
So if its an enemy health bar, specific to each enemy
Also needs a player controller hooking up there
Now you can use that ui ref to cast to the ui
ok I think I got it now
Ok
Now if you ever need to move that elsewhere, all you need to do is change where you get that UI ref from
The ball might be simulating physics on its own
Now that sounds like a great chaotic game idea
Personally I would've just fake it
like this right?
ok it works now thanks
appreciate it
oh yeah I promoted to variable
I will change it
thx
also everytime I press save all it makes me name a level idk why
You only need to save the vars once really, anything else is a precious waste of bytes
If you press save all and it does that then it means you have a new level that hasnt actuakky been saved into content browser
Sort of like an untitled word doc
im not creating new levels tho
idk why its doing that
they're just dupes
of my level
just checkd
checked
Thats odd
yeah I just backed them up and deleted
Dont think ive heard of that one before
maybe ue5 bug
or somehow my fault
how can I set a level to boot up when I load a project
when I moved my level to my content folder now it starts with no level
Priject settings > maps and modes
thanks
Theres an option for edotor startup level
it says its not here how can I get it back without having to remake entire sequence
nvm ill just copy and paste
Is possible to disable input on a character, but still have it enabled for one of the actor component?
Is there a better way to invert a vector than this:
In c++ I can just -vector. So this feels weird :p
Negate Vector
Thank you
My skeletal mesh flies away whenever my character moves! Does anyone know what could be causing this? It seems to magnify the input (when my character moves a little it flies off)
would anyone know how to fix the player spinning issue?
What is the Flip Flop Node in Unreal Engine 4 Blueprints?
Source Files: https://github.com/MWadstein/wtf-hdi-files
Matthew has made one of these for almost every node in unreal
idk why i had that in my node wtf
im trying to rotate the root bone in my animation blueprint for this character, but instead of rotating laterally, it rotates into the air. is there a way to force the rotation to happen on a certain axis (i think thats whats going wrong). i have the aim offset yaw set for the rotation.
trace?
I bet this is Mixamo Rig.
hey I need someone help xD I made an openable chest for my fps game but it won't open can anyone maybe take a look at it I've looked through it but I cant quite find the point where it went wrong (msg me for the code its very messy and long)
Hi everyone, I've managed to get my virtual camera working in unreal. Is there a way to map a vive controller to a cameras zoom focus etc using blueprints?
Hi, why does MultiLineTraceByChannel actually stops on the first hit?
And so MultiLineTraceForObjects returns two, but still not all hits???
If it hits something that is set to block either the channel or object type it will not trace behind it
If you want it to return everything make sure your collisions are set to overlap for the trace channel or object you are using
Interesting that this negate node is pure, I noticed lots of the other ones like negate float aren’t
seeing as youre right, yk how to fix it?
Hi guys I trying to make a sliding blueprint for my character that triggers when I press the walk, the sprint, and the crouch key at once Can anyone tell me how I could do that? I would be very important to know
Hi, I'm having some troubles using my "Interaction" interface. The interface has a function (Interact), which receives a PlayerController as an argument. (pic 1)
When I then try to implement this function in a class implementing this interface, I get this (pic 2). However, I can't seem to understand what the error is there. Can someone please point out?
Oh and this is the error
nvm, i hooked the aim offset yaw value to the rotate root bone "pitch" input. works like a charm lmfaooo
@broken night what does it look like on the parent class?
Oh no! I'm retarded again... I need some math help with something so simple I'm ashamed lol. I want a variable that would set playback speed of an animation "in seconds". If my var = 0.5, the playback speed (which is always 1 second for all anims) is 2. If the var is .25, then playback speed is 4... Oh man, being dumb is so hard, I swear!
1/seconds = playback speed
@trim matrixThank you! *somehow feel like crying not smiling now tho

How can i find the vector from the centre point?
I want to create 4 walls around the square
in runtime
i made this death BP to respawn the player when it falls too far down im just wondering if it is efficent or if there is somthing very wrong with it
Unreal has a kill z built into the level by default
Set it in the world settings tab
The way you should respawn is in the controller you bind a delegate to the on death event of the player, unpossess, spawn a new character at the respawn point, and possess it
how could i do that and what is a delegate
@icy dragon I am considering it but at the same time, i really want this to work somehow...
here's the issue
ignoring the fact the ball is always visible, it just rolls off and i can control it
hm lemme upload it instead
can anyone please help me?
what is it you want to do?
@slim grove inside the player controller event on possess-> "get controlled pawn"-> assign on destroyed
That will make you a delegate event.
Off there do what I described above
Place an actor (wall) on 4 sides of the square based on the centre point location
get actor location. This is your central point. Get forward vector -> you can use that direction and offset it by X in front and back. Get right vector -> same but for the sides
Get bounds of the square
It will return the origin and extents.
Use them to place the walls
Looks like the error was because I didn't save (not compile) the parent class after editing the blueprint it was implementing. The children had the right signature from the inherited interface, but not from its parent. Not exactly sure this is it, but that looks like it
Do i multiply forward vector on centre point vector?
Just get the bounds. They give you the extents and the origin
Add to the x extent to the origin for the front, subtract for the back
Repeat on y for left and right
thats not the result I want to have
You want to place a wall along each side of a square
First of all, one wall per square
Is possible to disable input on a character, but still have it enabled for one of the actor component?
and it has to be a random direction out of 4
Ok so you want one wall per square and you want it to be totally random which side it spawns the wall?
One actor (square) contains 5x5 square grid within it. I want inside of the grid to be what you said. And for the outside face of the actor to be always closed.
Do u understand what i mean?
Ok. Did you spawn the grid in the construction script or place it in the BP viewport tab by hand?
BP viewport. It has 25 panels
I later on inside of the blueprint made an array that connects all of those panels together
So in this instance it'd have been easier to do it procedurally.
However you can loop through each tile in the array get the forward and right vectors, invert them to get back and left. Do the 4 line traces to determine if there is anything along the sides and use those results to place the walls
well then, i made it work! @icy dragon
https://youtu.be/TtfEM8KEebI
The only tweak left is the excessive sliding
Still need the bounds to place them on the selected edge(s)
Assuming corners have 2
I only have problem with getting walls vector
What do you mean?
getting the vector of where the wall should be placed
Maybe I wasn't clear. When you "get bounds" of the tile it will return the origin and a vector for the extents.
The origin is the location vector for the origin point of that tile.
The extents are the distance from that point that the tile extends.
If you split it and add the x value to the x value of the origin point you have the edge along positive x.
If you subtract the x value from the x value of origin point you have the edge position along negative x.
Same thing applies for Y.
hello. is there a way to save all of my blueprints with all of the latest class redirects so i can remove them all from my DefaultEngine.ini?
maybe like a commandlet?
Erm... somehow Ctrl+W does not work in UE5... I cant duplicate the collision box.
CTRL + D
idk why the HECK they changed it
CTRL + W now closes windows, which is so fricking annoying xD
ctrl+w is used everywhere now
yes
it'll take a bit to get used to for sure
but if your mind is trained to use it to duplicate in UE you'll have a hard time
i honestly even manage to hit CTRL + W, open the blueprint which i closed and just do it again 😄
Always thought you can't duplicate them up until ue5 cuz I always used ctrl + d 🗿
is there a way to arrange an array? Say I have 2+ players, and I want to identify Player 1 and 2 respectively.
or is that not possible?
You can sort it however you like ofc
Yes, but how would I go about it? I'm using get all actors of class to get all my players.
You can make a function with insert if the players may enter at different times yet beeing pre-destined to a specific player numero
Youd usually add them to the array when they join the game
Assuming multiplayer
Ah
Then on their beginplay Register them to your AI Manager or whatever 😄
Have you played the Xenoblade series for example? You can order your players, and they all have their health in the respective order at the side.
No i havnt
Hmm
Isnt that just representation
So their bg array would be the same
Just the index references differ
Wouldn't this clear it up? Basically I want the controlled character to be in position 1.
@gentle urchin I was hoping for it to be possible to sort the array by a variable perhaps?
There's no real advacned sorting methods in bp, are there?
Not that I know, and its annoying.
Somebody wrote one in here a week or two ago if you can find it!
Ive shared some sorting before
But i dont think you need it here really
You know which pawn the player controls
And which pawns are in the group
Yeah, I use auto possess.
Whether it works or not, I have no idea.
The get node and the < operator in the middle is where the comparison is
Its somehow in Simulating mode and I cant add a new function
The button is grey
ah
got it
I have a problem. I hit 'play' but My dummy character does not appear and vurtually nothing changes. Im an still not there. What do?
my gosh making a save system has to be the most complicated thing in blueprints. 
is this a new project?
wait nvm looks like you have history i won't interfere.
no
not sure the history of the project so not sure what you want so probably i shouldn't say anything. 
Im already several days in it
I had my character running in it before, now I dont
And the play button has some extra 'gears' in it
weird
press the 3 dot button next to the eject button
and check if play in current viewport is selected
Yeah, the "gears" indicate that you are playing in "simulation" mode
Gotta go to PIE (Play in Editor)
Simulation is basically just physics sims, not proper gameplay.
So here's what I did.
I set up the BP ball to work as you would want it to do (minus all damping logic) so it rolls and doesn't overslide.
I added that same ball into a character, did some set up to change the camera to the ball when needed and to move the actor with the physics object.
However there is something wrong in the character setup where the ball inexplicable slides too much or spins too much.
Any ideas?
bp ball:
character ball:
literally everything is the same
i thought maybe the char movement comp is the issue so i set the tick to nothing and it didn't do much
probably gimbal lock
a what?!
how do you set the rotation?
this is for the char
and this is for the ball in char
this is for ball
the manip in the ball is so that if i move my camera, the direction is updated
roll torque amount is the same for both
the accel change bool did nothing
print the torque on screen every frame?
maybe you just need a cap for the torque
i haven't worked with torque yet, so it's just an assumption of mine
Is there a better way to store material values then this?
yea probably because you keep adding torque
so limit that somehow (idk if theres an option in the physics settings, or if you have to limit it by comparing the actual torque to some limit before you add more)
i just compared, the torque amount is fine
Maybe as a full blown dynamic material instance?? Dunno
huh actually weird behaviour
if i start and make it go forward, for char i get torque in Y for max amount and X for some reason
but for ball i get only Y
actually nvm
same behaviour
Ah.... mmm ... I think i need to get myself checked. thank you.
gonna ask in physics
Is it normal to get this many landscape "parts" when making a landscape??
have you tried limiting the torque?!....
also if your ball is ON the character, it may inherit the torque?
but the torque amount is the same
no no, it is limited to the roll torque i set and when compared to the regular ball it is the same
the values you showed are insanely high
again, same as the template
i couldnt find an offtopic channel so i will just ask this here:
anyone know how to disable the ukraine flag emoji on a discord server? im getting tired of seeing this political shit all over the place
🚮
I don't think you can stop people using emojis, I've never seen anything political here, only people helping each other
from all the places this is the wrongest to ask this
my advice: pick your discord servers wisely 😄
Hi, I was wondering if anybody could explain why my character doesn't rotate copying the code from the unreal documentation on top down character movement:
they seem to be able to have a character rotate and move with this, but my character doesn rotate, I added additional blueprint to have them rotate, but now when they finish the movement, they snap back to their default rotation
I have a Parent class , and many children.
I bind a few events to a custom event on the Parent, but don't need/use them on most of the children.
If I want to use the bound custom event, I Call it and add code after
What can an interface do that a Parent/Child cannot ?
anything special ?
it can exist while not existing
and you dont have to fully implement it for every class
ok
i think his case is exactly the opposite
the parent uses things which some childs dont
?
maybe you should rather do that special case in a child then
its empty on parent, if a child uses it , I add code
yes, Basic question is, does an event with nothing in it cost anything ?
so, if I have 100 actors that DON'T use the event , and 5 that do, I should remove that event from the parent and add it just to the 5
ok
learning C++ is on my to-do list, hoping to make some income with blueprint projects first
here's a cool perspective I like to use
unit ?
Top is control
Bottom is 500 line traces on tick
you should only worry about performance when it becomes a problem
🤷♂️ they're concerned with performance of a single event not being used. here we're showing that tick called to perform a linetrace 500 times/tick has almost no performance hit
yea, in a scene with like 10 collision primitives 😄
3k child actors all doing something at same time, but not on tick
hah
more fps, so yall better do as many line traces as possible
so from 12ms to 17ms game thread time
which is almost an 50% increase
you got a point there.
yea capturing a single moment isn't cutting it
the graph could tell more, if you had it for both, scaled to the same values
stat unitgraph
or maybe allow toggling it on and off, and enable the line traces for half the graph time
lower left shows the graph 😄
yup there it is
yeah, just hiding there
yea, its not 50%, but it still has an noticeable impact
unreal did a cool demo a while back where they were able to get thousands of traces without a performance hit, but can't find that video now
it was lol, but they had something like 25k traces
e.g. if you trace on a specific channel with only a few objects on it, it is obviously cheaper
very very true
I Don't see a performance hit between this and empty code
and you never will
cool, that solves that, starting question was:
Does an event with nothing after it cost anything ?
nothing much tho
the only ones that don't are the ones that are semi grayed out
like beginplay and tick before you do anything with them
yup
IIRC those have no overhead.
keep in mind that the code from the parent will execute on all childs, too
unless you override the event in each child
yes
hi guys can anyone tell me how I can trigger an event by pressing multible keys at once like shift and sprint for slide etc?
I do not understand how to configure the physics asset. Why the sled is not touching the ground?
Hello I'm trying to access my shop using the Interact Interfact that I have, it was created using Ryan Laleys new inventory system for UE5
Basically I used to just walk on my trigger box and open up the shop UI but I want to be on the Trigger box then press E so I can open my ShopUI to avoid overlap issues of the shop opening upon exiting the shop.
My question is how do I do that? I can't seem to get it done
why do you use a skeletal mesh in the first place?
I'm sure I'm missing something simple
I want it to be a pawn. and I want the character to possess the pawn. And I thought of snapping the character to a socket on the sled.
You have another idea?
all of this also works with a static mesh
you only want a skeletal mesh if it has moving parts
attach actor to actor doesn't work with a static mesh
neither with skeletal mesh
Attach to component
attach actor to component^
and what component?
the static mesh component
and I just simply add a relative transform on the forward axis so the character can stand behind?
you create a socket in the static mesh "editor"
and that name you can use in the attach actor to component call
it works pretty much exactly like with the skeletal mesh
yep
Can I just 🤮 at my code real quick? I don't know what I was drinking, or what that execution wire was drinking.
For some reason, my landscape material wont save when I do edits to the material itsself. I want to change it to masked and add a landscape visibility node so i can edit the visibility, but whenever I save, it fails to save
Any help would be greatly appreicated
other discords are full of ukraine flag cancer, they litter every post with it
so i guess we actually have to make a bot that removes them, and maybe even puts people on timeout
like if we post a model in showcase, nobody wants to see a shitty ukraine flag on it lol
same for russian or any other flags
POV: you got offended/angry by an emoji
🇺🇦
we just dont need any political hype stuff in our community
🇦🇹
my country flag resembles a stop sign lol
I don't see the Ukraine posts often anymore, I rarely see it
depends on the server i guess
Maybe your server is full of Ukrainians
now you brought that convo here, for what?
i dont want to ban all ukraine supporters so i would rather just disable that emojis
Do that and you gonna lose your community
i dont really care tbh, someone who has nothing better to say than posting ukraine flags isnt exactly credit to the community
Also, #lounge is as close as offtopic you can get, not #blueprint
but yeah i just wanted to know if there is an easy way to disable them, sorry for the offtopic i couldnt find a correct channel
@spark steppe
So if I use the ball BP, works fine
Ball inside character BP, slides
Ball spawned by character BP and possessed, works fine.
I disabled the movement comp. No effect.
I disabled collision with capsule. No effect.
I disabled mesh collision. No effect.
I have no idea what is causing this...
@spark steppe oh! My! God!
Begin playing scale 0 bug....
Physics applied are inconsistent
Starting scale must be non 0
Nvm i found a better way to do interactable detection that returns the value i need as well
is there a way to change the output pin of 'get overlapping actors' to have the same type as the one its searching for? i need my array (Overlapping Interactables Array) to be an array of Interactable Object Reference but the get overlapping actors returns Actor Object Reference Array which i cant append to a Interactable Object Reference Array
@spark steppe yup. And I knew this. You must use near zero values. Physics uses coefficients so when you scale 0 you are way too near 0 and your physics are messed when you scale out
@junior hedge what is the timeline looking like?
(0,0) (3,1)
Show me
so (0,0) (3,3)?
I changed it to 3
im just making an animation that slides a door downwards
the timeline is saying it's paused
could that be the reason?
What is the initial vector?
before it starts the animation?
159.465613 254.878637 332.826019
I know the issue I think
ok it works with autoplay but the script wont execute
normally
i think its my bind
idk why this isnt working though
(Action Mapping)
yeah my binds wont work idk why
i changed to J, U, even tried making a new bind
my old ones work tho so idk
Dude made the gamedev equivelent of a black hole.
binds that are X out won't work and idk why
if anyone was wondering you need this
is there a node to stop all timelines?
nvm
anyone got a few min to help a noob, Im stuck
Just ask your question. If someone knows they'll chime in
Imma send a few screens, this is the normal way to move the camera in game
But Im making a game where you cant move camera normally, but I want it to be possible at some locations
here I made a new camera for this area
but I also want to enable camera movement here
everything is in third person blueprint btw
Easy fix is to use a bool and branch to only allow the input to reach the add controller yaw if it's active
I wouldn’t run that in eventtick
The axis input event is already running every frame also, so you could leverage that instead of having a tick too
Just set a boolean to false in certain areas and create a branch with that boolean in inputaxis turn
gimme a sec
Using an actor overlap event in that area
inputaxis event must be in thirdperson blueprint?
Am I suppose to be able to connect these somehow?
This is just giving me errors
Blueprint Runtime Error: "Accessed None trying to read property CallFunc_Array_Get_Item_1". Node: Branch Graph: EventGraph Function: Execute Ubergraph BP Third Person Character Blueprint: BP_ThirdPersonCharacter
I understand you guys dont have time, sorry 😦 Im noob
What are you even trying to achieve
When I enter a room, I want to be able to move the camera with my mouse
lite you normally can, in a third person game template
but only inside, not outsie
Just have a boolean variable that changes to true when the player enters the room using an overlap box or something
Hi does anyone know how do I get the foliage instance of the grid where my character is currently standing? (I am using world partition)
Then build that camera control functionality into your pawn, with a simple ChangeCameraMode event that you can call. Once that's working, just detect entering of a room and trigger the camera style change.
Break things down into logical parts.
What actor are you doing that on?
Show the error. It tells you what's the problem.
I dont even remember, I tried everything
How can I make my character's up vector always point towards another actor? I've tried using Find Look At Rotation, Make Rot from Z, Make Rot from Y, Make Rot from XZ some googling and all that.
Scenario is - I'm trying to have my character's head point towards a grapple point. Sometimes it works, sometimes it doesn't. This beautiful illustration is what I want. But depending on the angle, sometimes, it will do it completely upside down. Like, if I attach to the Grapple Point from the side, the character ends up completely upside down, when it should be the other direction.
You will NEVER get a true from "Camerakebab". Your "for each loop with break" is effectively doing absolutely nothing
How can I optimise this so that I wouldnt have to check for every chunk
what is the usecase of this node?
It's for teaching you how to take screenshots without using a phone camera
You can play normal animation in a slot, without using a montage
Seen this happening more than once, does nobody use the printscreen button anymore?
Shift+Windows+S is the best way.
A for each loop is going to check every index in the array regardless. If you are looking for the first index in that array that meets a certain criteria, you need a for each loop with break. Once the criteria is met, add your variables or whatever needs to be done with met criteria and feed a line back into the "Break" input on the loop and that stops it from searching the rest of the array. Something like this.
If you know the specific index you need, you can forgo the loops and just use a "get" node on the array and tell it what index to get.
how to break away from your in game camera
did you see my explanation pn physics earlier?
Isn’t that for windows 11 only? Or windows 10 had that keybind all this time…
How do I organise my variables into different "folders"? I have like 30 already and it's becoming a concern
You can assign them a category in the details panel for the variable. Variables in the same category will be grouped together and can be minimized. You need to type the category name the first time to create it but then afterwards you can find it in a dropdown list.
If you want subcategories you can use the | symbol, for example Character|Input would make a category called Character with a subcategory called Input within it:
Thanks!
Windows 10 since around Creators Update has it all the time
It's basically Windows's new Snipping Tool, but you don't have to have it open all the time and just works.
No?
I use it all the time in 10...
@mental trellis if you begin play and your mesh is at scale 0 all physics get messed up if you scale back to 1 later
anyone know?
Your cast is probably failing.
What BP are you inside and what's it's relationship with L_Door?
L_door is an actor blueprint, I am inside the playercharacter
Casting is changing the level of classification of a variable. The player character is also an object, actor, and pawn. varying information applies to each of these classifications.
Print strings are your friend when trying to troubleshoot.
What you're doing is never going to work
already did that, everything else works except for the event
You are asking is the parent actor of the player an L_Door
The answer is no, so cast failed
what should I get then
Well if you had print strings on the cast failed you'd know that's why its not firing the event
I know that already
I said thats the only part of the script that is wrong
You need a reference to the door to call one of its functions
How best to get that depends on what you are doing
I dont know what to reference
Then why ask why the event isn't firing if you already knew the cast failed?
The door you want to shut
I only sent a snippet of the event anyways
idk what i can get
Just add it. Have an array of the same type as whatever self is, or a parent class of self, and add it.
Are you only ever gonna ignore self or potentially others?
No it doesn't.
the one in array and self
like this then i need to plug it to the array in linetrace but how
thx
Depends on what you're trying to do. What else is meant to be inside of Actors To Ignore?
the self and the on in array alr
Which one is that? In plain english, what should be ignored by your trace?
"I want to ignore self and allies" or "I want to ignore self and children" or whatever
so is there nothing I can grab to cast?
What are you trying to do
you can cast anything to anything, but it sounds like you don't know what casting does
I know what casting does
I just dont know what to grab from L_Door
I dont need an explanation
You need to get at the door in some way
line trace, saved ref, get actor of class, however you want
You only need to cast if you only have an actor and you want to CHECK if it's the door
if you KNOW it's the door, you can just do door stuff to it.
What are you trying to do, shut whatever door is in front of the player or shut a specific door no matter the situation or what?
the script I am doing just plays a timeline animation
and the script thats connected to the cast is a mouse hitscan
OK so the hitscan will return an actor. THat's the one you cast to your door class to see if it's a door
break the hit result
so I need to cast the button im hitscanning aswell?
No, that's not what casting is.
You do the line trace. The line trace returns a hit result. The hit result contains the actor that was hit. You cast THAT reference to your door (to check if it's a door), and then do the door specific stuff.
Is your trace hitting a button or a door? Is the button meant to control the door?
Are they seperate actors or one actor with a button and door inside it?
seperate actors
K so the button should have some ref to the door it is hooked up to. The flow would go like this
Line trace -> Cast hit actor to Button -> call event
and then in the button
Event -> get MyDoor -> open door
The button would have a door actor variable MyDoor, which you would set when you place the button in the level or whatever.
like this?
You should have MyDoor be of type DoorActor, not just Actor, but that'd work too
Then you wouldn't have to do any casting
It depends on what your plans are. If you plan on having buttons be able to activate lots of things you'll want to look into interfaces but I'd get this working first.
@faint pasture
Just setting a variable to a specific type is not all you have you to do. Even though that variable is "L_Door", it still needs to know what "L_Door" instance to reference.
You can use your hit result to set the MyDoor variable to the hit actor if it is the correct actor
I've already modified it
Does it work?
I did it a different way
I made a function in player character and called it from the door
is there a way I can make 2 different input events? (same keybind)
You talking about adding to the input section of the project settings/enhanced input? Or using 1 key to trigger 2 different events?
1 key to trigger 2 events from different scripts
by key I mean mouse click
Unless I'm misunderstanding you, you would just need to create a check to make sure the correct event is fired if the conditions of your check are met
you have to use the enable input node on the object if it's not a player
they're in different scripts
already added
different bp's you mean?
if I remove script 2 then script 1 works
yes
click on both the input action nodes and turn off consume input
Ok, then click the input node and there are some options on it for allowing the same key to be used more than once. Its been awhile since I've used the normal inputs but it's something like allow use in children or something along those lines
Thats it^^ what paranoid said
that worked thx
both of you
I'm following this tutorial series for holding multiple guns. Particularly I'm working on equipping and unequipping different types of guns (rifles, hand guns): https://www.youtube.com/watch?v=-_ss4Cnyb5I&list=PLl5i300DoPxeHtoK45l1MxEy-15ZseSyT&index=6
We will complete the all weapon attachment and equipping system in this tutorial. After this you will see a complete AAA grade weapon system with any errors or bugs.
We will continue blending animations and gun mechanism in further tutorials.
Thank you so much for watching
Like and Subscribe
Right now, I'm getting an infinite loop error for my pistol holster. I think it has something to do with the way the YouTuber is coding the pistol holster slots.
By holster slots, I'm talking about the sockets I added to my character.
Also, how could I rescale my gun meshes without changing the scale of the sockets?
When you place the door and button in the level, set MyDoor
make it public and exposed on spawn
I'll look into it tmr
Karan fixes the infinite loop issue in the Part 4 video: https://www.youtube.com/watch?v=-_ss4Cnyb5I&list=PLl5i300DoPxeHtoK45l1MxEy-15ZseSyT&index=6
We will complete the all weapon attachment and equipping system in this tutorial. After this you will see a complete AAA grade weapon system with any errors or bugs.
We will continue blending animations and gun mechanism in further tutorials.
Thank you so much for watching
Like and Subscribe
Hi, I am working on a game but I have a problem with the camera, how can fix this problem? I want to have a smooth and nice camera like battlefront 2 heroes vs villains
For the scaling, the guns look fine until I pick them up in game.
is there any fast way to fix it ? since it is just for a demo showcase, do I need to work on all objects collision channels in the environment as well?
I tried setting the world scale for each weapon in BluePrints but the gun still changes size when I attach it to the player.
Should I use "Attach To" instead of World Scale 3D? The "Attach Weapon to Player" is a custom function.
I tried both snap to target and "world scale" but it doesn't affect my guns.
Persistent between what?
i guess editor only works for me, but apparently i cant really use the GUID without c++
i went with an random int64 for now as unique id :>
fingers crossed that it will be random enough for the amount of use cases it has 😄
So I have a pretty standard aim setup that when triggered toggles between a free circle cam and aiming, but I when aiming is toggled the characters rotation instantly snaps. What would be the best way to smooth out this rotation? I have a rotation lerp system already that I use for smoothing out dodgerolls, but the best I can do is get it to lerp to the value fed in at the start which if the camera is moved during the lerp time a hitch still occurs
My first thought is to somehow use a float to create a weight influence between the two modes (0 means that rotation is only influenced by movement, 1 means that rotation is only influenced by camera, making .5 a 50/50 average between the two for z rotation as I could just plug that into the same alpha output I use for smooth camera zoom in)
(I also just realized I set the target arm length in the bp above which was redundant given my use of a timeline, so ive already fixed that)
TLDR is there a way I can use these bools as two ends of a scale from 0 to 1
Ok I figured it out and this is what I have
All I did here was clean up the error from earlier and remove the use control rotation setup from aiming as it is controlled by the timeline. The reason I check the alpha value and use that to enable controller rotation yaw is that it makes the transition between modes seamless, while you get a bit of a camera hitch if you check on finish while in slomo (Apologies for posting all this I'm admittedly proud of this solution and want to share)
Missed and error and fixed it with this. Still a little hitch in slomo so theres still improvements to be made
Hi,
I am currently playing around with instanced foliage in combination with world partition.
The first issue I had was to find a way how to get the foliage instance from the current position of my character.
I found a way going through all foliage instances of the world partition and picking the one which is has the closest distance to my character position.
But I have found another issue which maybe some of you can help me with.
I want to spawn a instanced foliage on the position of my character via blueprint.
The issue is to use AddInstance I need the HierachicalInstancedStaticMeshComp from my foliage type so I can add another foliage of the type to.
In case of using World partition there is no HierachicalInstancedStaticMeshComp in case there are no foliage placed in the grid with the editor.
Means I can only add foliage if there is already a foliage in the grid placed with editor.
Does anyone know how I can add a HierachicalInstancedStaticMeshComp on my own or maybe some other idea what I can do?
when i added a camera to my player i cant look up or down anymore and without the camera it clips through the mesh is there a way to fix this in the BP or is it an unrelated issue.
They have a course on unrealengine.com in the learning section on making a character from scratch. It covers how the camera and controller work together as well
im just asking for a simple soulution and i cant find what your saying is there
its first person so this wouldnt work
Thats almost entirely irrelevant
ok
Your only difference is gonna be final placement and weather you have the pawn rotate with it
Guys, I've never asked a question, but I would like to understand what is the difference between the visibility trace and the camera channel?
They are different types of traces.
You can set them to be ignored, overlapped, or blocked
You can also make your own custom channels
Its just a way for you to organize what things are relevant to a particular trace
ok i got the camera to look up and down but when i move left/right/backwards it all shakes violantly
Can someone please explain to me why this is not working? I have checked that the owner is the actual player
I can still see the damn thing 😅
Is "self" the player character or the controller?
Actually, I know it's your character. The one who does the "seeing" is the player controller, meaning they need to be the owner of that actor
Character
Yeah, so the "player character" shouldn't be considered the player. That's the purpose of a player controller
That's to say that the controller is the one who actually possesses the pawn and sees through the camera. You need a reference to the controller to make it the owner
Okey will correct it and try again. Thx for the input 🙂
On that mesh you can set it to "Owner No See" before runtime btw
If not you can always track the used numbers in some container and check for it :p
i should make a subsystem for that 😛
Hi ! For a character inventory, is it better to create multiple blueprint, or one blueprint and change the skeletal mesh/default values on construct ?
Your inventory has a skeleton?
no sorry
I'm selecting a character in the inventory
Let me explain it better :
So I have an inventory and the player can select a character to place it in the level
But when selecting the character, is it better to obtain a 'actor class reference' or a 'skeletal mesh' + default variables values
Ok the placed characters do not have to be different classes
It depends on how different there overall logic and behaviors are
No it doesn't need to
Just the animations, default variables, skeletal mesh are changing
If they are essentially gonna do the same stuff then I'd just have an enum or something to determine in the construction script which sk mesh, animation BP, and default values to use on spawn
why are all the tutorials out there keep using casting? isnt it much smarter to add a component or interface?
are they just eejits or did that stuff not exist in UE4?
or is there actually something behind it?
because 90% of tutorials are made by noobs or are for the sake of the tutorial simplified
our code is littered with castings which doesnt only make systems incompatible with eachother but also costs alot more resources
because other team members actually adopt that shit
It really depends what you are doing to be honest
In some places casting is relevant
yeah like here
but my friend made interaction system that literally casts everything to some base class instead of just using actor
Oh yeah interaction is better suited to an interface or even a component, but im just saying casting isnt always bad
yeah sometimes u cant avoid it, but in general its really bad practice
How did I never know about "Find nearest Actor"? I could've used that half a dozen times by now but I've done some janky line traces instead
yea but dont use it like that....
what would be a better way to make this?
good thinking
Limiting the scope at all is always better, yeah
That cast is redundant there. You already know it's a patrol point actor
it outputs an actor though
weird but ok
Oh yeah, I didn't notice that. So you get an array of patrol points, then go back down to actor lol
guess it saves u some casting in other cases
so yeah thats one of the rare cases that i found where u actually need casting
You need it in a lot of places, just not all of them
If you made it just change the return value. If you are taking in a patrol points array, then I don't see a benefit to dropping down to actor ref
i dont like how pure node with multiple output in bp would get called multiple times if you lined off multiple of them, give me an unpure version of it 😥
I've seen some dumb shit like
Get MyCustomActor -> cast to MyCustom Actor
Or just cache the results
like in the case above
it would been called twice
since you linked off both distance and return value
the function gets executed all over again when the value is taken
I'm not 100% sure it does. If you saved both outputs to variables, would it still run twice?
I'd think it'd be called per usage of the main return value but idk, BP can get weird
the function i tested was this https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Game/Player/GetHitResultUnderCursorbyChannel/
Get Hit Result Under Cursor by Channel
Anyone has an idea why my Axis Value is ALWAYS equal to 0? The binding in the project settings is correct, and I'm able to move my camera. It's only this part which doesn't work for some reason
luckily the return value is exactly the same within the hit result -> blockinghit, so i went and use that instead
I mean the BP node might execute twice but not actually trace twice, there might be some caching somewhere.
You're saying it all works, just not the debugging?
possibly, no idea how to check that though, frontend did mention multiple calling so i changed them 😅
For testing, maybe make a pure bp function that generates a random and sends it to both outputs. Then call it and print them. If it's different it got called twice.
Sorry, that's not what I mean. I'm using BP_FirstPersonCharacter as my playercontroller, and I'm trying to make a replicated grabbable door. I need to lock the cam/movement while grabbing, which works, and now I need to pass the angle of my actual X axis so the door can move. I'm unable to get a working Axis Value in here
Character isn't a playercontroller
Does this means that it's normal that I can't get Axis Value when calling the event from BP_FirstPlayerController?
And if so, why does this works?
You need to put a player pawn reference in the target pin
What do you mean?
yups, i even tried using the same randomfloat node, same thing
Nvm. Misread your question.
Is your axis event called anywhere else?
No, it's the only place it's called on this BP
What does the binding look like in project settings?
why does my animation bp stop working when i add a state
It looks like this, nothing special
idk
Hmm
Looks ok to me
I mean disabling input would stop it from receiving the axis value
Well even without this the axis is still 0
Are you disabling input to the player anywhere else?
No, that's the only place
But I'm just disabling Look input
I'm enabling input back right after
Try it without that
can it be this? 😆
without the two last blocks?
Still nothing, and even with the "Overrider parent binding" which makes sense as I have not override anything :p
Is this in the controller or the pawn?
I could imagine that the controller would be consuming the input before the character gets it in some cases
Only if the axis event is called on both
That's what I was going to ask about next
I just tried it in another BP and it's not working either. I also tried the Get LookRight accessor and it returns 0 too, value never changes
Try with a different controller class
i have set up a key to play a sound but for some reason the sound isnt playing, any ideas?
the sound works when i call it from this
You know play sound isn't connected
i added breakpoint but it doesnt seems to trigger the input action
second screenshot doesnt matter
Ok
i have set the distract action to C key, it just doesnt seem to actually trigger
maybe its conflicting with something else
ok yeah changing the key worked
What would that change? 🤔
It was probably used by another input and consumed
If you mean what would using a blank controller class change. It's just process of elimination. Switch out everything one by one to pin point what is causing the issue and then you can focus on figuring out why it's causing the problem
What was that MoveTo-equivalent node that has an 'on arrival' execution pin?
AiMoveTo?
Not sure how to phrase this question, but my textboxes are 'jumping' into where they should be positioned after my menu widget is already loaded/visible. I thought it was just my slow pc, but realised it's an issue with the game itself. What causes this and is there a way to stop it happening? Or does anyone know what I'm referring to so at least I can know what to search for on Google? I haven't been able to find anything so far.
Can you upload a recording?
How do I get a single instance of a blueprint I've used multiple times as done in this image?
When it's in the level you can select it, open the level BP, and in the right click menu it should appear
Did not work for some reason. Got referance to player controller, and set that to owner. Mesh is still rendered
Send another screenshot please
How about when you spawn it without attaching? You'll probably need to put it near the player character atm to be able to test that
It's definitely redundant to set it at runtime, then
Cannot spawn actors in constructionscript and set no see there
All other mesh that is predefined the no see works fine and are set in constructionscript
Are they actors that you're attaching to the character, though?
It's likely that the issue relates to ownership rather than "owner no see" not working
Yes, NVG ref is an actor that is attached to the chars helmet mount. I have double checked ownership with printstring, and from what I can tell, no issues there
Tried no see before attaching. No difference
Dumb question, but you're referencing the correct mesh, right?
For sure
I can hardly guess what the issue would be in this case
I think that's an arrow component like they use on the template characters. AFAIK it anchors to the scene root and always points +x, as that's its main purpose. Never used it, so I may be incorrect
Also checked the mesh with printstring. Is correct
hmm, got it to work like 5 min ago
On the other actors that it works for, I'd say to look for literally anything that's different between them
Thing that is different is that they are components added in the BP manually and not spawned in
But I`ll search some more and see if there is something that I am not seeing atm 🙂
I can't remember if I ever got owned actors to work like you're doing but I was having issues with it a while back
That was different, however, because it was a widget component in screen space
If I push a button and a door in the same blueprint moves down in response, does it not move down the door's collision too?
hi all, I'm trying to create a circle of line traces (for now) around a point defined in front of the player. Having issues figuring out how I can generate the axis for the 'Rotate Vector Around Axis' block as it will always be different.
tldr need a way to get the axis between 2 vectors or help rethinking this approach
why do you do that? @modern mountain
My first thought would be, why not do a sphere trace or something similar?
My ball when bouncing off of something is calling the "onhit" event more than once on contact. is there any way I can only make it call once? no matter the angles I try it seems to call the event more than once.
If I have two blueprint objects with variable "Health Value" and want to call those in another blueprint, how do I refer to that variable? Whenever i refer to that variable I get a specific variable reference to just one of the two blueprint object classes, Ex: get Healthvalue from class Cake_BP
Trying to essentially get a '2d' circle of points against a surface, but having it as points means some can miss the surface or hit other surfaces further back. This is what I get when setting a defined axis, but trying to get it dynamic to where the player is looking
I already saw it, didn't respond because I don't really know. Can your specific use case not be filled through another method, like a sphere trace or maybe an inrange?
Sphere trace doesn't provide multiple points, but might look at the inrange route. Potentially just going the wrong way with it. Appreciate the thoughts 🙂
It sounds like, if anything, you'd want to get the forward vector from multiple different rotators and multiply the vectors and translate them to the starting position
can add a small delay to whatever is on the reading of the onhit, or whatever is delaying it
I'm currently trying to make a laser maze inspired game but the lasers only render for a frame
Context clues lead me to believe that you're not using a mesh for the lasers. What are they?
raycasts im rendering them using line trace
Like a line trace debug?
line trace
Couple things. 1. Your duration is set to a single frame 2. I'm like 90% sure that the debug line is editor-only
Or dev-only maybe, but you can't ship with it
yea I'm just using it before I use a niagra particle
Fair enough. There's an enum on the line trace node that lets you set the draw type. None, single frame, duration, persistent
oh that worked I have know Idea how I didn't think that
I'm following a tutorial on how to tell some units to move to the mouse position on screen, but they always get [0,0,0] as destination from the "get cursor position by channel" node. Ground collision is set to block all, and the trace is using a custom channel. How do I make them go to the trace hit location against the ground instead of the coordinate origin?
Also this is the tutorial: https://www.youtube.com/watch?v=kRW-xNArxlQ&list=PL4G2bSPE_8ul0VWqaxhv7gm2oXTVFC3as&index=7
Assets Available from here: https://marketplace-website-node-launcher-prod.ol.epicgames.com/ue/marketplace/en-US/profile/PolygonBlacksmith?count=20&sortBy=effectiveDate&sortDir=DESC&start=0
In this series we are creating the common mechanics found in RTS games, everything from unit selection, AI combat, and base building.
In Part 6 we get our ...
is there a node to restart the game as if it was just opened?
So I tried to solve this making a parent BP class, and then making all consumables children of that class, with different values for "Health Value", but I don't know how to retrieve the currently held items health value. when, I just keep getting the parent health value
You need to drag off of the cast node's output pin to actually use the reference. Casting is meant to take an input object and give you an output object of class if it inherits
I understand that its just disconnected right now, but if I connect it, it just gets the Consumbale_BP Health Value, instead of the child Soda_BP health value
its casting to consumable
Are you sure you're getting the correct object? Referencing the variable stored on the parent does work
but I dont want to cast to the child Soda_BP because I want it to be able to take any child of Consumable_BP's health value
You also might have made a health variable in both the parent and child. That would be redundant
Object != object reference in this case
Casting an object doesn't change what it is; it changes what the engine interprets it as. Casting contextualizes a generic reference to make it usable in a specific context
So how can I generically retrieve a variable from different objects of the same parent class?
Either one can reference the variables they inherit from their parent
hi, trying to make a voxel world that generates similar to minecraft.
For some reason, whenever i walk right or left my test chunks wont generate, but only front and back.
@smoky rivet start by checking your vector math. You're probably only using 2 dimensions in something
Boys Can I ask for helP?
Just to double check: did you create a variable in both of these BPs?
Yeah I have a variable in both, but if I delete it in the parent then I can't refrence it
I cant make this
Yes, so only use the parent version
im not using z dimension so all vectors regarding z are set to 0.
So how do I get that to have a different health values for different objects
does ue5 have a chunking system?
i tried using open world map but not sure if thats a chunking system or if i should make one myself
cant find documentation on it
They will have different health values because they're different objects. If you mean you want to change them before runtime, you can change the value on a spawned actor, or on the child you can change the default value of the inherited variable
I still don't understand, since I'm using the parent in the call for the variable, its going to use the parent variable. Even though the object im pointing to may have a different variable value
so like held item is a child of consumable BP
Can someone say me why my actor won't move along sprite
So the parent has its value, and the child inherits it. In the child's blueprint outline page, you can show inherited variables. You can modify the default value from there
let me try a more complex scene.