#blueprint
1 messages ¡ Page 69 of 1
or if you're dumb like me and play everything on 2x speed because you're impatient, dozens of times
I think the worst ones are the sped up ones, that have music, and you have to manually slow it down and listen to garbled sound
well I did x2 with the tutorial so that obviously increases the chances to do mistakes but with casting my brain goes that slow that I can't go 2x đ¤Ł
Oh I hate those with music and minimal explanation
also, why does every tutorial on youtube start with "hey whats up guys" and make you have to turn it up 2x higher than everything else
"first were going to create our project and im gonna make you sit there for two minutes while i do that"
I thought it was just me being super impatient hahaha
there is one guy I love his tutorials because he is super quick, 1 min most of the time
Mathew?
Royal Skies, not sure about his name
i like those but they're too fast sometimes. mathew is about the right speed tho. i just try to be grateful that theres any information online at all and it brings down my stress a little.
Ah, not Mathew
cant imagine what it was like trying to learn this stuff back in the 90s or whatever
Textbooks
i went through a tutorial and he kept messing stuff up, and fixing it at the end
That was how we used to learn
they had to actually read words printed on pieces of wood?
Yes lol

quick basic was awesome
Then C and Pascal in 97
No such thing as YouTube
Internet is kinda minimal
Those were the days lol
i feel like it must have felt more special to learn programming back then, being on the cutting edge. when im learning i just feel like im trying to catch up to kids who learnt what i have when they were like 14
So I have a question that I imagine the answer to is stupidly easy, but I'm having issues finding an answer to it
people had big books that had all the stuff in it, bibles
Ngl it was fun
but I think he is also one of my favorites (you refer to Matt Aspland I assume?) with another one called Gorka. I recently discovered also a guy really like although his tutorials area reaaally heavy and long but I think are very good (Ali Elzoheiry)
ohh i see. so player 0 bascially means the main player character?
Yep that one
no. i just want to figure out what this do because in the future, i wanna add more characters then swap around đ
Oh wait there was another one
again im not the best to ask as too noob here but to the best of my knowledge yes
Wadstein or something like that
So a few days ago I followed a tutorial which I thought I understood all of the things used in the video, but apparently I don't.
The issue is this, I have a component variable, but it's still returning as nothing.
I'm missing a step somewhere
but I don't know what it is
You just possess them manually at that point. Thatâs for when something gets initially spawned in
Youâll prly want to keep that turned off for later additions so you can possess when ready
For some reason it doesn't allow me to select BPC_Inventory
you mean it's not valid ?
oh okie! noted. thank you!!
Yeah
You need to set a default value to it
where do you set it ?
Thatâs not how it works
You need to have an uasset
Would a uasset be the actor it's attached to?
Ah, I don't fully understand what that is yet, would just casting be a better way to refrence this variable?
Are you using a plugin?
what is that variable supposed to represent ? you need to set it's value somewhere
get actor of class maybe ?
or what parent class for bpc_inventory ?
So I was looking at the tutorial again, realized I'm an idiot.
and confused two things
ended up basically copying what they did for BPW_InventoryGrid and BPW_MainUI to communicate with eachother now, which is a funciton.
huh i dont get it
why this #include got an error??
it was working on my previous script before
Sometimes when I get problems with include I ignore them, after I build it works fine
Or I add ../ or just /
Not sure why it sometimes needs it
well you don't really want to ../ much in unreal
It sometimes fixes the red squiggles
Do you have EnhancedInput in the module your in
okie i will try that one for the time being. thankss
don't
The red squiggles are false though, and this is in Rider, which is good at knowing #includes properly
no but when i hover it, it says to add module to enhancedinput though đŽ
ohh okie
Did you add the EnhancedInput module in the build.cs file?
So add EnhancedInput to your module's build.cs, you need to do that whenever you want to use it elsewhere (because unreal uses sort of false include paths)
It fails to compile on my end :/
Visual Studio 2022
if it fails to compile, find out why
if it can't open the include path, correct it.
A ../ or a / will never be the solution
Why i can't cast to Item Drag And Drop ?
ohh add onto that build? okok. thankss
okie i will take note of this asd w well haha
Include file not found
Putting ../ fixes it.
again, that's rarely the solution
what file are you including
because there's nearly always a better way in unreal land
(except a few very very very exclusive situations for your own code)
what are you trying to do?
Some Enums and Structs but I haven't worked on the project in a while
Maybe you forgot to compile? Or are the stuff in C++ and not visible to BP?
get Object Item Drag And Drop from Item Drag And Drop Operation
@floral stump is that a component, a scene component, a variable?
compile your other class you are trying to cast into
and it should appear unless it is private
or "Local"
seems like you don't have experience with UI ?
in DragDrop we generate payload and assign it to DragDropOperation
did you cast correctly?
you wrote "DragAndDrop" but you cast in "DragAndDropOperation"
its not even getting it in the list
what are those circles all about, what kind of bp are those ?
show the folder structure for them in #blueprint
and it looks like they are seperate
what i am doing in here?
Is the object input compatible
that operation should get the drag drop class
helloodid add it and my inputactionvalue.h greyed out. is that right?
ofcourse not, in other user widgets i can cast it
that should'nt matter, when she drags off the pin what she is looking for isn't there. I suspect it's the wrong cast
i mean if it's a blueprint you can look at what your casting to
and check if it even has that variable
look at the names of her lists she had earlier
they are all named the same except for the suffix
and it's not what was originally asked
this is from another widget
yes
you can see it gets the payload and casts that, something your not doing in your code
uff
yeah my bad
that payload was needed
thanks
can't believe how i missed that
đ
I finally found the issue @lunar sleet @distant hollow @lofty rapids , such a silly billy sausage. The widget reference (ACMSkilltree) is created in a function that I was excluding from my BP character for testing purposes . Thanks again for the help â¤ď¸
Not at all, I'm applying it max 2 times due to I'm basically having an input, multiplied by the torque strength, the poduct of that then is applied on button press, 2 times, one for y and one for x torque
How can I get the previous index from a For Each Loop ? I'm trying to get a position of a previous index, so I can draw a path
your not using index but maybe you can get index-1
or store the last whatever you need in a variable
that you can use on each loop
Take the array index, - 1, ensure it's a valid index
Ah ! Didn't tick in my brain doing a simple -1 and getting the array again after
will try, thank you !
just make sure it's valid on 0 will be -1
That worked perfectly \o/
theres also storing it in a variable
this did the trick for me
got a proper cable network with it :p
Do you guys have issues with Tags sometimes ? I feel like they're not reliable
Pretty sure I have it setup correctly and the Get all actors with tag returns me zero
Printing the length of the resulting array and it's nul
Iâll get called out for shameless shilling đ, but rider is a phenomenal IDE. It would have warned you what the problem is, and included it for you.
it greyed out once i add enhancedbuild to the build. Stupid question sorry so greyed out means i can remove it yes? đ
Greyed out means the IDE thinks itâs not being used/called. You can normally delete it, but every once in a while the idea is just wrong and it is in use
Comment it out and build. If it works, then delete the line
Oh so basically it's stored. Okok thank you so much!
Don't listen to him, he is shamelessly shilling for Rider. Notpad++ is the only true way to go.
Pfft. Speak for yourself. Real programmers use wordpad
can character BPs if you use C++ not have their meshes set anymore in 5.3?
Has anyone tried to send a blueprint interface message from a list widget item? I'm trying to get information back to my player character but it seems to fire on the list item end but doesn't reach my player
show code
where is the pink window to change it?
This is the widget initialization
And then this is the message code itself
I've checked and it does fire when selected
But doesn't send the message to my player
hey guys is returning to me how can i make it 24 hours not AM / PM?
Ii've troubleshooted it and that branch does fire when the item is selected, and surely the object must be in memory if it's my player character?
try a hard reference
that or your player ref is never set?
print string it and see if it exists.
and either way if you use a single player ref, use the "get player character" or controller function
If you never load the soft ref, resolving it will just return null ptr afaik
Can , why not?
create a C++ project, brand new. Add in your folders a new BP of class "Character" and open it
can you edit the mesh's SK?
in the editor, not the construction script or through nodes
@frosty heron
mine doesn't appear to have it at all
Sorry I'm in bed, but will try tomorrow.
I have a project in 5.1 tho and I can edit the character mesh.
yeah i do too, but in 5.3 it's just elsewhere it seems
5.3 a bit cursed, I'm not gonna upgrade yet. There is a bug that wipe the detail panel in that version
there may be a format node, but not sure
otherwise it just picks whatever your system uses
Ben my system uses 24 hours format... it is weird
looking at the code, theres a param for which style to use, however BP always call the default style (from current culture ie. console command culture en)
how do I check if the player's inventory array has space left over before adding an item to the slot?
Hey, Iâm trying to have walking and running speed in two fixed states with the analog stick. So that when the left analog stick is turned a little bit in a direction the character will walk in a constant speed, and when the left analog stick is turned a lot, my character is running in a constant speed. I have it working but only on 4 directions, I would like to have it diagonal (and any direction) as well, whatâs the best way to do this?
@fathom gull read the X and Y axis of the stick. Length of the XY (think pythagorean theorem) is the speed. Round that off as you wish to be either 0, walk, or fast. Direction is just the direction of the unit vector of those two
compare length of the array to whatever you want the maximum to be. presumably you mean "in game max" and not "data structure max".
Is there a way to not see and expose variables of an expanded node ?
I dont want Weapon Actor Reference to be visible, just like in switch node
Where unused conditions can be collapsed
I don't know if Lenght will work, because when you start the game you already have 6 slots (which is the maximum)
so it's an array of 6 slots then. You're not changing the array, you're changing it's components?
yep
How would I implement that when using this as input?
Hello fellas. I have a question regarding "inheritance" in combination with "BlueprintComponents":
Let's say there is an actor "BP_Base" which owns a BP-Component "BPC_BaseComponent".
Now I would like to create a "BP_Special" which inherites from BP_Base. But I want the BP_Special's BPC_BaseComponent to inherit from "BPC_SpecialComponent". But I would like to set the reference between these BP-Components within the BP_Special without adding a new Component in in BP_Special. Instead, I would like to somehow set the inheritance of the component in another way... it's hard to tell what I mean but I hope someone understands me here!
How would you accomplish this? Is that even possible?
No idea what you mean. If Base has the component, Special will inherit it, the end.
If you add a special component to Special, then itâll have that too
Yes but in my scenario, BP_Base has the BPC_BaseComponent attached, not BPC_SpecialComponent, which should stay this way. But I would like the BP_Special to change that without adding a new component to it. Instead, it should use the BPC_BaseComponent of BP_Base and change it's type to BPC_SpecialComponent.
I do not want to exclude the possibility that I misunderstand something or that I made some logical mistakes regarding inheritance, maybe?
Youâre trying to fight the inheritance system. If you donât want it to inherit, donât make it a child of it.
You cannot change inherited components, most you can do is change default values of inherited variables
Maybe donât have a base component to begin with if youâre going to change it anyways. Otherwise, you can always just plug in variables into a function in that component, so you can change their values on each child as needed, rather than trying to replace the entire component (which is not possible if inherited)
No wait, i do not want to "replace" the component. I would like the BPC_SpecialComponent to inherite everything from BPC_BaseComponent so I can use all variabls and functions in BP_Special AND (!) everything from BPC_SpecialComponent.
It seems like there is no other way then adding BPC_SpecialComponent directly into BP_Special from the start. I just hoped, I could somehow define the specialization of that component in BP_Special in reference to the parent's base component...
You want to make it a 2D axis input. two separate 1D axes.
Anyway, thank you so far
@outer brook You definitively cannot do this.
Most likely your design has not utilized components correctly if you feel this is necessary.
Yes, I am slowly coming to that conclusion too haha. It helped to talk/ask here.
Say I have a class structure like this
NPC (with inheritable event called Die), Die does some basic action
--Bear_NPC (inherits from NPC), Die does some additional actions on top of parent actions
--Spider_NPX (inherits from NPC), Die does some additional actions on top of parent actions
and say I want to do call Die on NPC as I don't know what child it is at the time, how do I have them also perform the child Die event?
it will do so automatically
your grammar here is a bit confused though.
Bear is a subclass of NPC.
You have an instance of a bear.
Something kills the bear. It doesn't know it's a bear. It only knows it is an NPC. So it calls NPC->Die.
But it's still a bear. And bears call Bear->Die, not the parent class implementation, unless Bear->Die explicitly class the parent class implementation too
tl;dr you don't need to know the subclass of an actor to ensure it calls it's subclass' implementation of things. This is always the case.
hmm, i must have done something else wrong then, as it didn't happen as expected. is this true in blueprints as well as cpp?
or maybe i got confused because the engine kept crashing without saving :/
Hey anybody able to help out why my spawn actor doesn't attach to my character socket but just get placed into the map only?
Is it because 'get onwer'? I am learning blueprints for 1 week now. Maybe you need to put a get actor instead?
I dont know for sure but i want tk know it so i can learn from it
yes, what do I do now?
ah looks like i was trying to fix it at the wrong location. So my item have collision and what happen is that once it spawn it collide with my character and it doesnt attach it the player
Ohh
Can you send a screen of the working blueprints so i can see the difference
I am just beginner, sorry
the blueprint is the same
Oh
i have to remove the collision type from my item
np
Okay thank you, I have it working :)
iterate over your list of slots in a for each loop and check if all of them are empty. If any of them are empty. it's not full.
I am making a projectile bp, but i will be creating child bps from it, i want to expoe these variables but not sure how i can do it (its just one variable and setting using that one variable) any ideas? Thanks
yes. In c++ it's made a little more obvious because you have to specify that you are overrideing the function.
It's kind of hard to crash the engine with blueprints outside of things like infinite loops too
expose them to what
all variables of a BP parent class are accessible to its children class
they won't show up under "variables" but you will be able to see them in class defaults and you will be able to reference them in the blueprint.
something else i may be doing wrong. i frequently crash from errors including video memory errors.
with the stater 3rd person level and only a few character bps
how much memory
is your computer good enough to do this?
32gb mem and 5700xt radoen card
just updated to the newest engine 5.3.1 i believe. crashed 5 times same error today
rtx is off
is it a laptop
no
does it crash in the editor or when you play ?
Is it slow as a potato when it runs
dunno. that's hard to say.
3.80 gigahertz AMD Ryzen 5 3600X 6-Core
Samsung SSD 970 EVO 1TB [Hard drive] (1.00 TB)
31.95 Gigabytes Usable Installed Memory
AMD Radeon RX 5700 XT
That should do just fine.
thanks for looking anyway. i was on 5.1 then upgraded cuz of the crashes, still happens
5.2.1 runs great for me
oh wait, new drivers. let me try that
i see what you mean, the issue is its all one variable.
what do you mean its all one variable
your problem was wanting that one variable to be accessible in children, no?
sorry for not being clear, i need to use separate variable to expose them all in the child blueprint, but im setting multiple particle spawns from one variable
I'm not sure I parsed that correctly. But I think what you're trying to do is track multiple particles and have them be accessible in th child class. But you don't want to make a unique variable for each particle.
The answer is probably to make your particle variable an Array of particle objects, rather than just one.
What are you actually trying to do, from a mechanics perspective?
When x happens, you want y to happen
it worked perfectly, thank you so much you are my savior
I want to have exposed variables on a child blueprint. But because i am using one variable to set multiple particles in the parent blueprint, it wont work. I need a way to expose the variables for the different particles
i think thats the way
is there a way to make a delay in fuction?
No
howdy, anyone here familiar with cases of the event graph 'skipping' functions, potentially related to the bind event to onclicked function?
Damn I just reactivated the Flat Nodes and the engine graphs feel way smoother for some reason
if so, I have a post up on the Unreal Forum here: https://forums.unrealengine.com/t/my-event-graph-seems-to-be-skipping-sections-but-not-always/1591683
where I've tried to lay out my issue. (that way I'm not clogging the chat up)
I currently have a blueprint for an NPC that is meant to branch between a set set of dialogue lines depending on which item the player is holding when they overlap. Then, once that dialogue is finished, a custom event runs that selects another small dialogue tree at random and runs that as well. Once the random dialogue tree ends the dialogue ev...
Yeah, I'll see if I can get a cleaner pic, the single attachment limit was kinda rough
though, any version would require a lot of zooming, since I'm essentially trying to fit a large portion of my event graph into a single image
I see some binding, bear. Are you remembering to unbind?
Hi, I got a quick question on which I've been lost for some time. I created a hotbar with 3 slots. Each of these contains a border with an image. Whenever I pick something up in-game, the icon gets added to the image slot, but the background color of the image slot changes to the same color as the border color. So say the item is in slot 2, and I got that slot selected, the background color becomes yellow (same as border), but when slot 2 is not selected the background color is black (same as border). How can I make the slot's background color consistent so that it doesn't update the image color to the border color?
how are you highlighting ?
with a yellow image ?
you only change border and it changes the whole thing ?
No, I have a int variable in my playercharacter called selectedindex, which I feed into the function of the widget. This is the code that updates the image slot
Then here I change the border color of the highlighted index and reset the color of the other 2
use select node
and probably an enum instead of an index but it depends
is it possible to configure a decal to ignore certain objects but not others, like, discriminating by actor name or type.
The border is the green line, image the blue one
does the border change that whole inside black part ?
could be going behind the image
and is the icon transparent ? and that's what your seeing ?
WASD key navigation in widgets.
Does anyone know what onKeyDown override function I can use in Blueprints to make the navigation go Right for D keypress and Left for A keypress for example?
Is there a Node I can call on that will move the navigation Right Lefy Up or Down in the Widget?
this is what happens
ya it looks like the border is actually the whole thing
so when you put an image in there the transparency shows the actual background
you could probably fix it by putting another square behind it of a solid color that you want to use
but how does the slot stay as gray when there isn't a texture assigned to the image?
so at the start
What are you actually trying to accomplish? The variables are exposed already. What end effect are you trying to achieve?
i think you set all that in your details
are they images ? or what are they ?
They are images yeah, and I have given them a color in the details pannel
but what I find weird is that at the start the border goes around the image, but when the image is updating the border fills the image
does anyone know how/where (if there are any) tutorials on how to make a spline that you can customize in game?
ok, updated the post with some better pics I hope
I currently have a blueprint for an NPC that is meant to branch between a set set of dialogue lines depending on which item the player is holding when they overlap. Then, once that dialogue is finished, a custom event runs that selects another small dialogue tree at random and runs that as well. Once the random dialogue tree ends the dialogue ev...
ok, made one last tweak because the first image still seemed a bit wonky, still works best on pc though
All good bud, i need to use arrays i think.
Is there a way to retrieve a parent actor from a state tree's task blueprints? I'm having trouble locating any such function.
You can add components at runtime if thatâs what you want. But yeah, otherwise use 2 separate components or modify variable values.
#gameplay-ai for these questions, more specialized help
Fair enough.
how can i generate a random int without repeating the number
Hey gang, I'm messing around with game templates for the first time in ue5.2, I'm having a issue with changing my third person character mesh. when I change skeletal mesh in viewport details it does not change in game mode. any tips on what i'm doing wrong?
if I have a camera that's separate from the player character, how do I make it so the player character's movement direction is in the direction of the current camera angle rather than the world direction?
random int in range is a pure function, it will always output a random int in the range everytime it is called
without repeating
you can cache the number then
from the out value, promote it to variable. Use that variable instead
What is the advantage of using a trigger box vs. a collision box? I need to fire an one-time event when something enters the box. Should I use trigger or fire an overlap event of the collision box? Is it the same?
how to fix the item is over the box?
use uniform grid panel for a grid panel
the item pile up
Why is there a random top knot?
?
that character hair
I see.
my problem is the item pile up
i know the problem but idk hwo to fix
if pickup new item the item icon is moving column
Add brushes to every slot that have no image / transparent one / set to invisible. Add those images to an array. Position them on your UI.
Then simply set teh right icon in teh right slot based on the index of the array.
not liek that
Shrug it's a perfectly workable solution.
this using horizontal box
i want make like this but using unoiform grid box
this using unofrmgrid
@mental trellis this is using gridbox, but the item not change their column when add new item
That looks very much like you're adding them wrong.
When you add a slot to a grid it defaults to 0,0. You need to set the row and column when adding it.
have you assign the row and collumn?
every add item that in 0,0
Then, what do u expect?
i dont knwo the code if add new item the column add 1
You know what a row and collumn is right?
when add new item the column add 1
ms excel have that
You need to fill them up
say you have 30 slots, add 30 Empty slots to it
like an empty item that is represented by empty icon
You could even add the image widgets in those slots to an array so you can access them sequentially.
Like this ^
i get that
i know, make an image alpha 0, when add new item change the image fill
So design your UI in the umg editor, don't make it dynamically.
but i dont knwo how to make the code -_-
Code to do what? You design the ui in the wysiwyg editor.
when pickup item the image change
idk how to do that with 8 image
Expose the image widgets and set their properties from your hud variable.
See the pins in #umg to learn how to do these things.
ask in that?
@mental trellis i Use Wrap
https://cdn.discordapp.com/attachments/978053882905243658/1192925975814602873/2024-01-05_21-16-47.mp4?ex=65aad9e4&is=659864e4&hm=e81ff62e00fa48ba2e2b3739646148fd3d7c33b8d1845bf0d5459418a1027362& Hi! So I made (followed a tutorial xD) a building system where I want to implement a delete building system, but apparently it destroys multiple objects, not just the building, how do I fix this?
Your floor probably has BuildItem Tag too
don't really like the tutorial tbh, I would handle deleting on the building it self. Have a function to delete in the Building.
Player can then just tell the actor to call the delete function
Ohh you are right! ( I didnt follow the tutorial for the deleting, did it myself, but thanks for the correction! đ ) I'll try that!
What Class should I cast to though?
The floor doesnt have a BuildItem tag btw
print string the actor befor deleting
see if the floor gets printed
if not it could be another code somewhere
Is there a good way to connect an array element pin to a fallback struct structure pin from a For Each Loop to a Create Widget? I'm pretty new and have been following this tutorial. It works if I rebuild it by replacing the Create Widget and then compile it but for some reason it breaks when I close the editor and reload the project.
Ctrl F , type destroy actor then hit the binocular icon
determine which one cause the floor to be deleted
Oh wow, never seen that before
lets see here
I see! The delete system isnt what deletes the floor
Ill debug a little
I think i see where it is coming from
How could this be?
Don't think so, this makes no sense what soever
so if it's not valid destroy it? I mean you can;t destroy nothing
can i use this for RMB? without LMB
No, afaik that's a callback when widget is clicked (with LMB)
have other way to maek RMB for ui
You probably want to store hovered widget every frame.
Then On Right Mouse Button Released -> Check the hovered Widget -> If Widget == This button, then do X
?
check hovered widget?
actually can't get the hovered widget
there is, IsHoveredWidget however
OnRightMouseButton Released -> If This Button is hoevered -> Do X
working but need double press
Hello, I'm having issues with my character movement. I was following a tutorial that was setting up 8 directional locomotion and it works fine for him. However, if I hold down W, my character is stuck moving in one direction no matter which direction I'm facing. The same goes for A, S, and D. Can anyone help me out? I know this is a dumb question but I'm pretty new
How so?
you probably don't have focus if you need to do it twice
on hover -> Set Keyboard focus
how game use unreal like apex when using item need to press ui with RMB
No idea, don't have their source code
if their code is leaked, someone can just make a copy of the game
I would make a base Widget that have the functions I described
that way you can make a right clickable button as many as you want
is there a way to restrict a character's movement so they can only move within a navmesh? Or is the only way to restrict movement using things like walls and blocking volumes?
What type of game are you making? Ultimately, only characters controlled by AI can fully use the nav mesh. (You could use the simple move to but it's limited)
it's an isometric puzzle game set in cyberspace, so the level is built of a bunch of platforms sorta freefloating since that's the aesthetic. The character can't jump so I've already turned off their ability to go off ledges but even when I do that the character model is kinda half hanging off the ledge when I go to the edge, I'd like it to stay fully within bounds so I was going to use a navmesh for that
the white box is supposed to represent the character model when it's dimensions are done, and as you can see it's kinda hanging off the edge
Does the character move by the player clicking where they want them to move to?
no, WASD movement
Hello, I'm having issues with my character movement. I was following a tutorial that was setting up 8 directional locomotion and it works fine for him. However, if I hold down W, my character is stuck moving in one direction no matter which direction I'm facing. The same goes for A, S, and D. Can anyone help me out? I know this is a dumb question but I'm pretty new
I'm not aware of anyway to use the nav mesh in the case then. You might need to implement your own ledge detection system. The one built into UE uses the capsule center (hence why it overhangs the ledge).
You'll need to provide more information about how you move your character and the 8 directional locomotion setup.
if I were to add a box collision is there a way I could make the existing ledge detection system to use the outside of the box collision?
You could just put an invisible collision around the ledges but that sounds like effort when you change things lol. If the player is walking into a wall you wouldn't need the ledge detection.
I know but my first platform is octagonal in shape and I was trying to add blocking volumes but it was an absolute pain in the ass
Yea, a custom ledge detection system would probably be better long term. It would just be a case of doing line traces down at the edges of the characters capsule component. Trace from the bottom and then end the trace that's slightly larger than the step height. If it doesn't hit something, it can't go that way and adjust the input movement accordingly.
I have no idea how to do any of that đĽ˛
There are climbing mechanic on youtube. You can draw some ideas from there
I followed this tutorial https://youtu.be/PtuT6R4WM6Q?si=banyLwWDLgBbiG61
In this episode, we finish setting up the character and animations for basic locomotion.
Content:
0:00 Intro
1:05 Animation Layers
2:30 Directional Blendspace
6:06 Setup Base Pose
13:48 Idle state machine, turn in place, stop
24:24 Test (+bonus cat sounds)
30:01 fixing blends and anim states
33:43 Sum up and outro
Disclaimer - this is a part o...
Hello friends
I'm really at my wits' end when it comes to a flying opponent
So now I'm just trying to program a projectile movement so that it moves in the air in my direction.
My question is, is it possible to tune a projectile to move as soon as it sees me, i.e. with Pawn Sensing?
i upload my Bp image
Because the problem is now taht it moves in my direction but not if he sees so at the begin of the game he starts to move
(I know that's not the right way for a flying opponent, but I'm still far too new to unreal to be able to do everything without being able to see the whole thing in a video or picture)
So I am working on a spawn system for my multiplayer game and trying to get a reference to the player controller from some logic I have in the level that runs on begin play. How might I do this? I am not wanting to put the logic on the player itself becasue I only want this spefic logic to run when the player loads into this specific map. Each map handles spawning differently.
Hey there
I want to check if my bool has changed from the last two seconds (if the player doesn't move the mouse for 2 seconds, the cam resets). I made a function for checking if the mouse is moving but I can't seem to find a solution for the timing thing...
A Retriggerable Delay might help, but it has to be in an Event , not a function
You could use the Triggered of of your mouse input @main flume
Oh okay, thanks, how would I use the event there then?
Sorry if its a basic question, I switched from Unity to Unreal a week ago
I think you are on the old Input system, so you would add it in Input Event LookUp and LookRight
I am using the enhaned input actions
so, whenever the mouse moves , it resets the Delay
if you don't move the mouse, the Delay is allowed to finish
ok, so in main graph, add your inputs
Where can I find the delay though?
you wont see Delay nodes inside a Function
ohhh
has to be in the Event graph
Something like this.
Like this?
nope
Why do yo square the input value and then square root it straight after?
Under your tick , right click and type LookUp
only positive values
just abs it.
Ah thanks for the tip!
there you go, plug both Triggereds into the Retriggerable Delay, and unhook it from Tick
Is there any reason you're using two sperate input actions for looking around?
Currently not really
It might be worth putting them into one to help simplify things.
Ill look into that! Thanks
The project templates use just one if you need an example.
This still doesnt seem to work
Using a timer would be the best option. (look at my example above)
Oh I found out
I need to put it into started instead of triggerewd
since triggered is tick based
the Code after the Delay will fire after 2 sec after no input
How would I set the mousenotmoved there?
how can I smoothly update an objects transform? i tried the following, but it was still very jittery) I also attached a video showing the jitter that I want to fix (starts at approx 20s)
Yea so you have a bool you set to true when you start moving and then set it to false when they stop. The other stuff is just to reset the cam after 2 seconds which is independent from the looking bool.
is it being updated on tick?
It is.
O you'll need to swap out the vinterp to the constant one if the end location moves. It jitters because it's trying to smoothly interp the values but the following tick the end location has changed which messes up the smoothing it's trying to do.
Now the cam instantly resets after I stop moving my mouse
then it's being called somewhere else.
Move your camera movement stuff off tick and add it to the triggered on the input action. Some of these checks can then be removed.
They need to be on tick though, cuz I got some camera movement, based from the speed
Triggered calls each tick but only when the player is wanting to move the camera. (pressing the input button)
it still seems to be jittering, and increasing the interp speed only makes the train slower. yes, it will be smoother, but i need it to be fast
Yea, but the car still has a speed even when the player isnt moving the cam
What are you trying to do with the camera regarding the speed?
So this should only call when the player hasn't move the cam for x amount of seconds?
Yes
and the normal camera movement should be called otherwise
This should be all you need
You can read the Is Moving? on tick if you need
And 2 sec after not moving Reset Camera will trigger
You should learn timers , but they are overkill for what you need atm
Simplify and build from there
oh thanks
In which case, create a new bool called 'bShouldResetCam?' when you call the 'ResetCam' function, set this to true. In the function where you check if the cam is moving, check if it's false and should reset cam is true.
Thanks alot, this works perfect
Yea the other solution from @versed sun worked perfectly though
Thanks for the help!
I just realised that the locomotive doesn't lag at all. this is being updated in the tick function, but all of the others are actors which get spawned in by the locomotive, do lag. I think this is because they are being updated in a for loop, meaning they get updated 1 * number of cars times slower. ill do some testing to make sure this is correct, and then i may need some help
I'm not a fan of the ambiguity in the vars such as 'IsMoving' being true for an additional 2 seconds even though technically it's not. Just be careful as you continue to add stuff as you might forget there's actually a delay in the IsMoving being set when they stop.
Here's the other solution in case you have issues.
Are you not attaching the additional actors to the locomotive?
no, im not sure how to do that
When you spawn them, attach to the locomotive and they'll move with is so you wouldn't need to manually update their locations and rotations.
but wouldn't they be in a straight line? the rotation is based on a spline and it has curves which is why i did that
If the base locomotive rotates, so will everything attached to it.
thats the problem. the cars at the back of the train shouldn't rotate when the front of the train does, because it isn't up to that part of the track yet (where it curves)
Ooo, i get what you mean. I thought the jittery carriage was the front of the locomotive lol.
no, the front is perfectly fine, but somethings up with all the rest
You could try having the front carriage controll how much the back carriages moves forward. So if the from carriage moves x forward along the spline, all the other carriages move x distance along the spline. That way you can remove the interp as you wouldn't need to lerp it.
Thanks!
ill give it a shot, thanks
im trying to make it so when the player steps on this actor it will change its material however its not working does anyone know why?
Print string the other actor, make sure it gets called
hey developers, im trying to call an event in a blueprint from a blueprint but for some reason im getting some errors.
thanks in advance!
you are trying to access BP Lamp Gas station when it's not set
it simply doesn;t know which BP lamp gas station in the world you are pointing at
Hi guys, I made a switch between camera, the first one is on the character, the second one is attached to a socket on a weapon (to create an aim down sight), the one on the player works fine but when I switch I loose the pitch control on the weapon, I can look left or right but not up or down. Anyone has an idea ? (I have an anim off set that works on the player I though it would follow with the other camera?)
the only thing i have is this variable thta has a type of the blueprint
but how can i set it?
using the set node
like this?
Nope, this is very wrong, you are setting it to it self
So nothing to nothing is nothing
XD That is such a perfect pic
i know its wrong but i didnt know what to do
Well which BP lamp Gas station do you want to Turn State?
there might be 1 - 2 - 3 or hundreds of BP Lamp Gas station
every BP lamp Gas station placed in the world
you need to set the Variable to one of them
You are pressing E to use it , so i assume you are looking at it/ mouse over it / close to it?
no, its a switch, where the switch turns off/on all gas station lamps
Then you want to make use of arrays
but if you don't know how a single pointer works, an array can probably wait
something that points to the memory location of variable right?
An object reference (Blue pin) is a pointer
BP lamp Gas Station pointer, points at a BP Lamp Gas Station Instance
^ That will work to turn off all the BP lamp gas station but you better off learn how to use array later because there are times where you don't want to turn off every BP lamp gas station in the world
wow
Eww... Get All Actors of Class. 𤎠lol. Yea it definitly would work but not recommened. đ
Assuming the lamps are placed in the level by yourself via the editor and not spawned at runtime, create an array var of type of your lamp on your switches and set it to instance editable. In the level with the switch selected, you'll see the var in the details panel. You can then add each lamp you want the switch to control that is placed in the level.
When the switch is toggled, you would just loop through the array and call the Turn State function.
or..
The first part i understand but on my world i have spawned 4 lamps with same blueprint BP_LampGasStation, and now on the details panel when im selecting the lamps that i want the switch to control, i only select the BP_LampGasStation right?
Lamp(s) will require the use of array
A BP_LampGasStation variable will only point to one instance
Cool, how do you fill the elements? did you pick from the level?
If that's the case all you have to do is just For Each Lamp -> Turn State
no, i just clicked in dropdown and choosed the BP_LampGasStation, i assume thats not the right way
Show me the variable type, Did u select class or something
it should be object ref not class
Hi, I want to fire off an event in BP_Item_Flashlight from my playercharacter. I made a variable in the character of type BP_Item_Flashlight, but I can't make a reference as you can see on the right. Does anyone have a clue why?
Because there is no BP_item_Flashlight in editor time. It needs to point at an instance of BP_Item_Flashlight.
The Level is unreachable in the BP class because at editor time, the level is not spawned yet
Yeah usually I would assign the reference in the details panel outside of blueprint mode, but since I don't have the character placed in the level I don't know how I can assign it
Currently it's just placed in the level
and how do you want to grab it?
Interacting with it (which already works)
ok show me your interaction code
it's early strokes, but this is it basically
I got info about the items stored in a struct called ItemInfo
yesh but i was expecting that
accesed none trying to get flashlight
but i'm unsure how to set it, since i can't get a reference to the flashlight from my character
I'm assuming you want to Spawn the flashlight in that code?
if that's the case, you can get the return value from the Spawn actor node. That will be your flashlight (or w/e you spawned)
not quite, since that's the actor that gets dropped when I already have something else in my hotbar on that index, it just drops it (which is what the spawnactor is for)
but the actor that gets spawned from there I don't use, it's just dropped in the level
Then you should expand your interaction system
pass in the object ref of the item that is being picked up
that will be w/e u pick up. Including the flashlight
in the struct i assume you mean?
Create a new Input, call it Item_obj
in your pick up logic , pass in the object you are picking up
is there a simple way in blueprints to rotate a single bone in a mesh?
In thos one right?
what should the type be, since it could be anything that I pick up
It should be the base class of Item
all of your item should derive from that base class. FLashlight, food, weapon w/e
ah right makes sense
Yeah you can Set the bone transform in anim blueprint. That's how I make an NPC head to look at my player's head
Ah so I need to set up an anim blueprint?
Well for my case, I have to. Not sure with what you want to do
Ah ok thank you. đ
And from the class, I can then make it into an object target?
not sure what you mean
How are you picking up the item? By pressing button that do overlap checks?
so i got the class, how do i make it so it's a single pointer target
yes
what ever method you do to obtain the item, pass in what you are picking up along
An object ref is a pointer
it only points at an object
Yeah but I have the class input coming out of the event.
change it?
altough I don't know why u want the item
How I would do it is
Pickup Item -> Get the Item Info -> pass it to Player inventory -> Destroy the pickup item
Player use a weapon -> Spawn the weapon for the player
Because I want to run a custom event in another bp for which I need a target ref
yeah but why do you need that object you picked up on the floor. The object you pick up can just contain information about the item. If it's a flashlight, what hp and so on.
What I mean is you want to handle equipping in the Item Class
but anywayyyyy
you can still pass the object ref if you want
it's just not something I would do
@feral night This is the node btw
incase you need it
So in my case, I just want the flashlight to light up. I got a BP_ItemMaster and a BP_Item_Flashlight which is a child of it. Would I make the functionality of the flashlight in the BP_Item_Master then?
So BP_Item_master will have template events / function.
Such as Equipping/Use
Drop
Remove
Trade
etc etc
Each child (BP_Flashlight) or BP_Sword can handle the Equip Function differently
like Use on Potion will regenerate HP while Use on Flashlight switch it on
I see, and the bp_item_master would take the object class? Or how would it know what item should be used?
No the BP item master would just have the template function like mentioned
SO when you grab a BP Flashlight -> Use
It will run the version in BP Flashlight
Hmm so i am attempting to setup a camera for third person in an RTS, similar to the men at war series. I have most of the logic down but can't figure out which value to use to drive the aim rotation such that the camera mouse xy values drive the aim of the controlled pawn. any thoughts?
@fringe junco PlayerController->Get Hit Result Under Cursor By Channel
this is unfortunately not what i need. I need to drive something like the control rotation. the issue is that i dont have possess the pawn im controlling, as my controller posseses a camera pawn instead
Is that only one pawn you control
Or more RTS like where you can select pawns and tell them to do something?
@fringe junco
It is still probably what you need. Your units will need to have ai controllers that you will be passing indirect commands to.
theres both -- you have the overhead camera and the direct control camera
i have switching between both
i just can't figure out how to tie the player controller control rotation to a non-possessed pawns control rotation
which sounds obvious that u shouldn't be able to do this but
we'll see if theres a work around lol
it needs to be possessed by an ai controller
because it's going to be doing things when not possessed by the player
i have an AI controller setup cuz i have movement logic going
Ok, so have your player controller send cursor data to the ai controller which in turn uses that to determine where to look
like the basic feature set rn is:
0verhead rts camera with pan orbit and zoom
Third person camera with movement and animation
marquee selection and deselection
ah okay
the ai controller eh
My system has the player controller sending "Unit Order" structs to the AI Controller which reads the queue and executes them one by one. orders such as "move here" or "aim here" or "interact with this".
I would say you should probably do the same.
yeah an order queue is a good idea
im very early on, just trying to make a prototype
its going to be a big thing. Pick one or the other of RTS vs. controlled and just implement one on its own for now.
Although personally I think the whole "RTS where you can be a unit" just won't ever work conceptually as a game design thing.
RTS units don't fight in an interesting way. They sort of inevitably stand still and attack or kite and attack. Humans don't have the micro to handle things otherwise. It's too much. So if you imagine possessing a unit, it's really hard to imagine what the enemy ai should be. If it's dumb like RTS AI then it's going to be really bad FPS gameplay.
Hello all ! Does anyone know how to pass another float variable to the event "Apply Damage" please ? For example for a "Stun" amount
yeah fair lol
My thing is like a real time squad thing and my basic takeaway is that if you're asking people to control multiple units in a setting where you expect to do real time positioning, people will struggle to handle 3+ units
yeah, the only time this whole direct unit control thing worked for me was in like 4 player plus multiplayer coop matches where u split units
and thats specifically in that men of war series, idk if they have good ai or smth but its not so bad
You can just make your own apply damage
u are right tho, i think the micro makes it difficult for sure
Do I have to create an Actor Component ?
maybe. I haven't seen that game
I thought I could work with "Damage Type" tables but I don't really understand it
@odd kiln Probably this should be an Interface. An interface is a set of functions that you can say things implement. Like "Receive Damage"
Ok I'll try this, thank you !
Start by making a "Damage Interface". Give it one function called Receive Damage that takes, say, a float for damage and a float for stun.
Then on all the actor classes that you want to be damageable, go their settings and mark them as implementing the Damage Interface
That's what I'm trying to do
Then finally, you need to actually go into the bp and define what "Receive Damage" does for that actor class
Ok great I just have to replace my "Event AnyDamage" to "Receive Damage" event
yes
But I have to replace also my "Apply Damage" right ?
Yes, you would replace it with TargetActor->ReceiveDamage
Thanks a lot for taking time to help me ^^ I'll try this right now !
It works great, thank you very much !
Ah thank you very much! đ
Got a question, wondering if its possible to hand the server over to another client if the server disconnects. Hope this makes sense?
#multiplayer but afaik. no.
if the host leave, everyone auto dc
Thanks
Listen server is not the norm anymore anyway. Now days people use dedicated server
Hi! I have an array that holds 3 elements inside when i save the game. I have it all on print string so i can follow it. Then i load and i see that those 3 elements are still there as they should be because there is no node in between that resets or sets the array to something else. The only node i have that is touching this array is ADD to the array, so nothing can ever get deleted right? So as i said when i load my game and the elements are still there BUT if i load again and again and again, it will stop working sooner or later. SO without dooing any changes to the code, after loading a few times ( sometimes after 2 loads, sometimes after 5+ ) the elements in the array just dissapear. I see it because my print string no longer shows them and they are really gone. What could possibly cause this? How can elements of an array just dissapear if they are once saved to slot? Everything else works, enemies, ammo, guns, etc.. i made it all work but this is giving me nightmares.. đŚ please help. thxđ¤
I'd just have a dedicated server instead of a "user" being the server.. So you don't have that issue..
Then any/all players that join connect as a client and you could have like an admin login UI or something..
Thanks. Just looking to save on costs.
hello!
I want to send a duration in seconds and control a interp node with it.. not sure what the formula is
Thanks. Just looking to save on costs. This is just a hobby project that I would love to be able to run on its own. I found that its possible and called host migration. Looks lilke there is some stuff on it.
Sounds good, hope the best works out for you bud.
Thanks man! I am seeing a pretty good solution that is for 5.1. So at least its possible.
players have to be re-connected even with that plugin
but I suppose that still an option
better than dc all together
Thats okay. Having them reconnect is fine.
What would the best way be to go about wounding a stat? Like lets say health's max value is 150 but you take 10 wound damage and now its max is 140, but that wound can be healed latter so max health will eventually be 150 again.
I would attach a buff that reduce the player's max hp
Can you elaborate?
applying a buff that reduce player's max hp. There are many ways to do buffs, in my old project I use Dynamic combat system from marketplace, it already come with it. For my new project
I would probably use GamePlay Ability system GameplayEffect to apply buff
Oh I see you mean just reduce max health by 10 then increase max health by 10 when removed? That won't work because I want to show it on the health progress bar as black or for mana as brown
I don't see why not, you can represent the black area as the penalty
A buff is just something you can apply to your system, it should be able to do anything code wise.
You can probably use component. Have basic features like if the buff is stackable, removeable, etc
Hello! I'm new here and encountering a problem with Unreal Engine 5.2. I've managed to spawn an actor at the point of projectile contact, but it's creating multiples at repeated points of contact instead of destroying the previous one. Attempts to destroy the extras haven't worked, as it doesn't validate their existence. Can anyone assist?
i suppose this is in the Hit event of the projectile?
are you spawning a new projectile each shot?
if so, the variable could not be the same, hence Last Perimeter BP wouldnt be valid
@visual crest Actually Gas already do what you probably want.
You can see the modifier on the Max health as well as the base
this one have duration, but it can be changed to infinite. And can always be removed with Tags (To remove the wound effect for example)
yea it's in the hit even and no im trying to spawn ad different object with when it hits another object and oh thats why so how could i make it valid
I don't use Gas I made my own version of it.
well I can't re-invent the wheel (a worse version) , that's why I'm trying hard to understand this system
Yea probably should of done that but I like knowing exactly every line of code does in my project lol
you could move these logic into the "firearm" or have the Last Perimeter BP variable saved somewhere else(maybe the "firearm") so you can check and remove it.
Hello , Should I learn how to code, or are blueprints enough?
sure but there are times when you want to use abstraction. Some components of the game just take forever to make.
Imagine making our own movement system instead Character movement component for example.
essentially, you will need a system where it manages stats modifier/stacking
then a buff system for temporal buff/debuffs
and maybe percentile correction on Health when the MaxHealth is changed
Yea your right I should probably used it but now I am to deep to turn back
Use Component for the Buff so you can apply it to not only your self but to enemies too.
On Buff Applied -> Do X
On Buff End -> Do Y
enough is rather broad. BP is enough to make a small scale game but you can hit the wall very quickly.
It's the trial version of unreal. The tool is made for designer
ok i'll try moving it some place else i wanted it only revolve around the type of projectile im using, but if thats whats causing the issue i could try making a BPI
for starters, i think you should localize this functionality to your HealthComponent, unless you can forsees you will need the same buff/debuff system for many other stats, then maybe think of a standalone Stats/BuffSystem
GAS localizes every stat you will possible need into the same Attribute system, so you could apply the same buff/debuff system to them
I think what I am going to do is make a new stat for each health/mana/posture name it wound or degrade and then make its max stat = to its master and change its current stat to damage the max stat of its master. That way my health/mana/posture max stats can always be kept safe and no bugs that can permanently damage a max stat
essentially stats modifer stacking đ
now i want to add a potion that will increase the MaxHealth by 50% for 3 minutes!
Trying to orient the character to the surface normal, so that it's forward vector is pointing towards the surface. Currently running into an issue where -90 and 90 angles work, 180 and -180 degrees result in being rotated directly opposite to the surface and the inbetweens are, well, inbetween the two. Any idea if I'm even on the right track with my 'solution'. What am I doing wrong?
To get the 'vaultNormal' I am performing a line trace and taking the 'normal' parameter
I feel like I've scoured the whole internet for the solution, nothing though
You are trying to get your character to face the same way as the vault ledge, yes?
Yeah, essentially. Something like this
you want to negate(multiply by -1) the normal then rot from x
This seems to work. I'll do some further tests, but thank you
RinterpTo doesn't have a duration anyway
your speed should go to speed. Delta time from Tick (or some other time with delta time) should be an input to the function and it should go into delta time.
You don't want world time or anything like that.
you're just trying to say "I'm turning at x speed and it's been y seconds since the last frame so figure out how far I should have turned
Hello everyone, I have a serious question about how to save the fact that when I picked up a flashlight, the save system would save it. I have already made a Save System and made it so that when you click âSave Gameâ it saves the âPlayerâ data and when I click âLoad Gameâ I teleport to save the playerâs coordinates, this is of course good, but it does not save these things that I have already picked up please tell me how to fix this.
I'm trying to recreate the cropout project that comes from the Unreal Engine example. But the enemies are crossing my building, does anyone have any idea what to do?
I'm using method AI Move To in Blueprint
Hello! I can't figure out why this code doesn't remove the members from the array:
You're always removing whatever item is first in that array. Is that correct?
You need to⌠make some data to record the fact that you picked it up and save that too
Yes, because it doesn't matter which item it is as long as the array is getting emptied
At first, I attempted to remove the exact item (the "Enemy" input on the event), but it didn't work either
So I switched to index, figured it'd work more reliably
But no, it just doesn't remove anything
Do you want to remove just a particular item or clear the entire array?
Just one item per dead enemy
As the player kills the enemies, this event gets called again and again, and eventually, the array is empty, which triggers a second wave spawn
That's the problem, I don't know how to do it đ
My only hunch is that like, I'm changing it but I'm not setting it?... But I don't know how to go about that, the "REMOVE INDEX" node doesn't have an output
yea you need to set the array again otherwise that node removes it but then keeps it in memory without actuallying applying the change back onto the array
Well it really depends on your game. Does the game contain one flashlight like a Zelda game? Then maybe you just save a bool PickedUpFlashlight. If thereâs a hundred different flashlights maybe you need to save a struct about all the items in the inventory.
???
the Remove node passes array by ref, so it directly changes the array rather than first obtaining a copy and changing the copy
hang on
nvm I think I misunderstood
yeah i think you have to set it again
Does the struct break provide values by ref though?
.....huuuuuuuuuuh.
this returns a copy
When you spawn a wave, store the current wave as a var
which you know since you're using one :P
I mean like yeah. That could work but generally speaking try to think of structs as immutable. Donât edit things within a struct.
?
I use arrays of structs to keep multiple sets of data lined up properly
is that bad?
No
Okay, that actually sounds like a really good advice
thank you
then I'm misunderstanding this
Let me try doing this
Iâm saying donât edit content within a struct. Worst case create a new struct based on the old one plus a change.
ah
I mean Iâm a functional programming guy but I think you should try to avoid mutating objects wherever possible.
Game dev requires otherwise but structs are going to be data and you can obey clean functional thinking there
OH I realised what I wasn't getting
rather than grabbing a book from a bookshelf, tearing out pages, gluing new ones in and putting it back
get the book, copy it with changes, put the copy back
Yes
đ
Well for example right here we have someone getting confused because they were mutating an object that they thought was a reference but was in fact a copy
If you avoid functions that depend on something being pass by ref and treat it like data youâll just have a cleaner workspace
To begin with I would try very hard not to have a stored struct (ideally immutable data) that has references to an actor (stateful stuff)
oh ok i didn't think there was a difference between delta time from tick and world delta..
hello , this is the year integer but it looks like this. do you have idea how i can fix it ?
year x 1000?
or, is it a comma for grouping
open up your Int to Text if you have it
I think that will work đ
thank you so so much đ
I got this error message, and I have found a rather reliable method to reproduce it - what is the best method to go about contacting the development team?
"LogOutputDevice: Error: Invalid object referenced by the PersistentFrame: 0x000000000000001e ... - If you have a reliable repro for this, please contact the development team with it."
hi guys , I have this variable that will display in a widget whatever you write in the description box. Is there any possible way to make a variable to be a warped text? The problem I am facing the description has to be very short otherwise
Wrapped
Itâs in there somewhere. I canât check now. Maybe it was only a rich text box thing but I think not
sorry are you sure? when I use the filter nothing shows đŚ
Iâm sure itâs in there or at least on a rich text box with some name in the same vein
you are actually right, i was looking at the wrong place thanks!!!
Is there a way in BP to round floats to a nearest tenth? The only function is see is nearest int.
multiply by 10, round, divide by 10
you could even make a blueprint function library and make a pure function that can round to any number of decimal places
Can someone help me figure out a way to add and remove items from arrays depending on if they're spawned in or not? Basically I want to spawn certain power ups but not if they've already spawned in. And then add them back once they've despawned.
where are your arrays stored and where is the function that spawns your objects?
also show code if you have any
My array includes 4 power ups and are stored in my game instance, The event that spawns them is the death of a character in that blueprint. I'll post what I have in a sec
The array code is just off to the side because I wasn't sure how much space I'd need
well for starters I don't know what your random float in range is doing - that will always return true
I need to still plug the class in once I've found it, but I'm not sure which one I'm going to need. I've tried setting this up other ways and while I can get it to spawn the first time, It's spawning stuff with a different array
that's just for testing purposes
nvm then :P
I'm still trying to get my head around what you're trying to do
what is the desired effect?
If they currently exist or have ever been spawned?
so basically it has a x% chance to spawn a power up, when it spawns it, remove it from the array and add it back in after the power up ends.
ahh
Just for each class in your array, get actor of class, if it fails, there isn't one
When the power up is active, is the actor still around?
It's still valid yeah. Basically I only want the power up to be in the array if it isn't
the array is just in the instance blueprint. The array is made up of classes though
wrong kind of instance :P
oh wait
he means instantiated class
yeah i just realised lmao
wouldn't the get actor of class node in here deal with that though?
I'd do it like this.
Spawner:
PowerUpClassesArray
When you go to spawn a powerup:
For each class in array, add a copy to some other array if there's no instance in the world
That 2nd array is your array of allowed classes, get a random element and spawn it
lemme do a little mockup to see if I get what you mean
SpawnRandomPowerup -> for each element in PowerUpClasses -> get actor of class -> if not valid -> add class to AllowedClasses
-> finished -> get random entry in AllowedClasses -> spawn it
Don't do that on tick, just have like a 10s timer or whatever your spawning interval is
That's a quick and dirty way to do it
So I have power up and allowed power up arrays, Would the power up array be completely empty and the allowed one full?
no the first one stays full
the 2nd one gets filled every time you go to spawn something
you never remove any, just clear it after spawning
AllPossiblePowerups
CurrentlyAllowedPowerups
It can just be a local variable in a function
so something like this? The is valid goes back into the for each while the not valid just spawns the random from allowed.
Apologies if this is not at all what you're on about, never really done much arrays all that much aside from basic for each loops
ok I don't think that's worked. Ran into an infinite loop on the first spawn
got rid of the infinite loop
but it still keeps spawning duplicates
why not just check on a timer if any are missing from a full array to respawn them ?
so have an array of all the powerups, remove from array when you destroy, loop through and create the ones that not valid
or they are all seperate classes ?
yeah they're separate classes
one is the parent so idk if that might help
I've tweaked it a bit so it doesn't duplicate but instead it just keeps missing one out instead
so do you destroy the actor ?
so the power up spawns when one thing dies, you can choose to pick it up and when the power up is finished then it is destroyed
I'm just trying to make them spawn randomly and not duplicating it though atm
Quick question - should I test for interfaces before trying to use them, or is that redundant?
For context, the above screenshot is executed when the interact button is pressed
they all have seperate class names ?
yeah
what if you kept an array of destroyed ones
so you could loop through that array to respawn
and just just empty out the array after
then add to it, when you destroy
Anyone have advice on how to get this to continuously fire as long as the player holds down the input (right-click)? At the moment it just instantly turns the player character to where the mouse was when right-clicked, I want the player character to rotate to be looking at the cursor location while right-click is held down. I've considered event timers but wondering if there's a more efficient way.
currently I have an array of ones that could be spawned at any given time.
well, started for the Mappin Context part, Triggered for the Set Actor Rot
what is the random connected to as far as the power
i mean on the execution it's in the loop body ?
both the not valid path and after remove go to the spawn which takes the random
because your removing the element so if it's after loop body it will not work the array will be empty
This seems to have worked. I was suspicious the answer was that simple, good thing I didn't waste time on event timers. Still a bit iffy when it comes to making inputs work how I want, thanks.
what would go there instead?
are you removing if it's valid ?
you probably want to keep those classes of what you removed in an array
I've got the power ups and possible power ups, I was gonna remove them but neither of them work
so you pick up power ups, and along the way you store them in array ?
wdym "possible powerups" ?
power ups that could spawn
and that updates when you remove one ?
your possible spawns should be the ones that are destroyed right ?
I think? Whenever I've tried that it's not ended up randomising when I did that way
show where you plug the random in
but you are removing items and trying to get random
but i don't see where that should matter, you remove the item, get a random, and then spawn
I also tried this one as well
before you destroy the actor, save the classname in an array
that you can check and spawn whats in there
the actor isn't being destroyed for a while in this case
the power up is only being destroyed after it's effects have worn off
right but you want to respawm it right ?
yeah but I don't want to spawn another one if it's already been spawned/being used
So im trying to setup a third person camera view switch in generally overhead RTS. the camera switch works fine, im just wondering how I can move the aim rotation of the pawn because i merely attach the camera to the pawn and dont possess them, but need them to aim lol
Hello im trying to create an execution system by playing another AnimMontage when the enemy is below 25hp, however if one enemy in my scene is below 25hp the animation always changes. Is there anyway to make this instance only, possibly with a trace? although ive tried to trace and couldnt work out what to do with the Out Result
an array of needed to spawn would make sense, loop through the array and then clear it when your done
I have an aim offset set up an all, its just driving those pitch and yaw values. do i use the control rotation?
to use the out result you use "break hit result" and take one of the variables from it
I can get the instance and print it from the out result but im unable to get that instances health
hmm
why are you adding before checking if one is around?
Check, then add if there isn't one
that ends up giving me an infinite loop
Show current code
why are you going back into the loop?
to get another one that isn't valid
Do you know what for each loop does?
the loop body runs for each thing in the array
do you have a variable on the actor ? or how do you store it's health
The Health is stored within C++ attributes file that the Enemy C++ class uses and then the enemy is a Blueprint child of that class
th health works individually
so i can kill different enemies and the health doesnt go down
idk anything much about c++ or how you would get those "attributes"
but when i get a ref to that health in blueprint it is referencing all actors of that typ
type
show your code
so it randomises properly. Sometimes it spawns duplicates though.
but i see that im not referencing a enemy instance and rather the whole enemy class
but im not sure how i can reference a single enemy instance
That is referencing a single object
Show how Enemy Ref is set
see how you sent attack type, send the actual enemy or just the health
if you can
is there a way to check the array every frame?
event tick ?
that just gets the first one
I have 2 enemies, one 100hp and one 23hp in my scene, i want to be able to add a finishing move on the end of my combo if the enemy im fighting is below 25hp
But im not sure how to go about it tbh
what bp is that ? character ?
@slender dagger
Thts in my AnimBP where my play Montages are done
Then make it be the enemy you're fighting, not just a random enemy from get actor of class
Im not quite sure how to do that
That's up to you
The enemy you just hit, the enemy you have targetted, whatever you want
In plain English, how do you know which enemy you're "fighting"?
targetted is a good call i have a target component on my enemy
Tested it a couple times, Randomisation works. But sometimes it just skips a power up entirely
Hey guys. I'm starting fresh with blueprints, and lets say I'm super new. I need a prod in the right direction. I decided to set a new task each week to develop a small functionality that won't really be used anywhere. I just need to create stuff so blueprints finally click for me. This week I'm making a "dice roll", and to determine what I rolled I figured I'd make a sphere at the top of each face, and the sphere that after rolling the dice has the highest X value would qualify as the roll result. (screenshot attached). If I wanted to add these spheres to an array, and compare their transform details .. how would I go about doing that?
Because they all are on the map
it will randomise 3 of them and only sometimes spawn the 4th one is what I mean.
not a pro here but here's how I would tackle it.. instead of creating the spheres manually, I'd spawn with an instance system using a for loop. I believe this would do the same as the array you're trying to build because you could fetch each instance via their index in a for loop or something
Ive set the last actor hit ref but now i cant access the variables?
Hello, when I make an open level it doesn't load my gamemode in the level because I can't control my character but when I launch the lvl through the editor it works.
That's an Actor ref, not a YourEnemyClass ref
You need to cast Hit Actor it to YourEnemyClass and save a ref of that type if you intend for it to always be of that type
Highest Z value, and just add them to an array on BeginPlay
Running with this design because of your stated goal⌠first off donât do child actors like that. Theyâre kind of annoying and come with some baggage. Basically each âchild actorâ is more of a container so youâd need an additional node to get the actual out. For a task and implementation like youâre suggest use âscene componentsâ, which are basically just transforms not visible at runtime.
Those aren't child actor components I don't think
look like meshes which are scenes anyway
Ah yeah. Thatâs more ok. But I would say use scene components properly to make it cleaner even for this toy example. No collisions ever. No visibility at game time.
@rugged wigeon i used now your way at it works!!! đ The AI ââfinally moves in the air. I've spent the whole day on it, but I would be very happy if you could watch the whole thing again over the next few days... since the AI ââdoesn't exactly move forward as soon as it sees me pounces on me from above but at least it's alive!!! đ
I can then show you the new, functioning bp again; it would really just be a small finishing touch
But enough zzzz for today and thanks again for your tip đ
Anyway, since each of them is part of your class, you can reference them at any time in the BP. If you want to make an array of them you can do Make Array <whatever type> and then add pins adding your 6 elements manually.
You can use a for each loop on that array to iterate over each and track which is the furthest along your chosen axis on its transform -> location
And then finally youâll need some method to figure out which side that scene components corresponded to. This is a bit of a convoluted place to be in but you can come up with some silly to do that association, like perhaps, a map of the components to int values
Congrats
if i create an array in a specific order, can i guarantee it will keep that order if i don't change it ?
@tropic peak#blueprint message