#blueprint
1 messages Β· Page 217 of 1
You should. π We're using it in our latest project. It is amazing.
Just heavy time constraints π
imagine one would like to take ones time once diving into that
We have like little region areas and each region has it's own biome sort of thing, but the regions aren't exactly grids, they can be complex concave shapes. So it's hard to decorate with the right trees and such easily, but I wrapped the region in a simple cube volume and used it's edges to generate a closed spline around it. Then our environment artist uses a PCG graph to design the area, so that it works regardless of the shape. Can't say much more than that for another week though. π
Yeah I've seen them work with closed splines for areas, and it looks really versatile
I assumme they're mostly used on larger things tho, not so much on something like a single fence, right ?
altho i'd think they'd equally handy there
Ah okay, yea its very effective.
The First iteration of grids forced an Unreal Crash... xD I wish they had an protection for Infinited Loops. x D
In this case, our artist is using the spline as an area. So he's generating points all through the inside of the spline, not just along the spline itself.
oh, i thought an Infinite Loop forced the Crash like in Unity. ^^
Mhmh
That wasnt working how I intended but you gave me an idea. I set that "StartBugTimer" at begin play like you said but I made it so that the function "SpawnBug" that ran from the set timer by function name have the "StartBugTimer" event at the end so that everytime a bug is spawned it will set the new loop time for the next spawn. Your method was adding the time alive to the Looping time. Which you didnt have all the info so its more my fault
It works good now though
Glad you figured it out !
Right, but is that the only thing they're using it for or would they use it for small things as the fence example aswell ?
might not be applicable to your project ofcourse
just curious if there's a treshold before one starts with the PCG
We are using it for visual stuff mostly. Trees, rocks, etc. Stuff that doesn't directly affect gameplay. Though there are a few gameplay affecting things in there like volumes spawned along certain things for the nav area modifiers. Gameplay critical stuff though we keep as basic actors spawned from gameplay code.
In a sense I would probably say something like... If you have a survival builder? I would make the gameplay code spawn housing parts. But PCG could handle spawning certain meshes or particles in places depending on the biome to make the housing feel more alive. Such as wind blowing snow or sand off of a roof, without actually hard coding that particle to the roof piece, because maybe someone made their roof out of floor pieces, or some other weird building piece.
PCG is usually very "On top" of gameplay stuff for our usage. There to add extra pizzazz.
Hi everyone, it can be simple to solve, but how can I adjust the tangent programmatically to adjust such edge cases?
the end of the spline supposed to curve upwards but the tangent (I think?) is causing it to curve downwards instead?
Anyone? Thanks
suggestion blueprint on a 3d rotational spaceship movement?
I'm having problems in understanding how to merge all the axis in local space and use different keyboard input for different axis
like roll, pitch and yaw
Hey Guys,
I am thinking about creating a OTP Screen
Does anyone know a better way to do it.
At First I was thinking, adding a png and a text box as a overlay - that will give a perspective on entering the OTP, But this method is not immersive.
Secondly, I thought to make a array of Editable Text Box (Custom Widget) make a array, and switch the select to next text box if an number is inputted (Event on Text Changed).
but we can't directly change the selection via blueprint form One Editable Text Box to other?
What kind of movement are you doing? If it's realistic physics movement, then UE5 has built in force and torque functions that are well suited to it. It's a little more complex if you're going for Star Wars style movement, I'd recommend looking more into plane movement controllers for that.
i use 6 linear key movement and 6 angular movement for my spaceship
QE TG 13 are angular movement
for pitch yaw and roll
but i stumble across a problem in merging different inputs together, didn't work
or in other cases work strange
this is my setup actually
but whatever key I'm pressing, it rolls in one way only
not pitch or yaw
surely some logic incomprehension on my part
but just need the way to understand it, not a simple solution, wanna learn
cannot find a relevant answer online
and every flight tutorial are the same online
Try clamping the value coming out of the multiply node, then adding it to the original world rotation
I think what's happening is you're clamping the actual rotation instead of the input, so when you hit a certain angle, it just locks
but this does not solve the main logic
that other axis doesn't work
and the only axis that works, works only in one direction, not clockwise
surely need to rework the input for force
I notice a big error in my configuration
but my main question is only relevant to the joint axis in a rotator
how to create a matrix that works in local rotation for mesh?
i need some sort of mathematical matrix to mix together and get local variance when inputting on an axis
This is the way I'm doing it - the rotator at the start just comes from my inputs, and is measured in degrees/second^2
So it's the target angular acceleration - i.e. the desired acceleration to produce from the ship's thrusters
Hold on I'll get them, it's a kind of long chain to get there
how do you choose to rotate on a local Z axis with a button?
and then, the editor calculate the world rotation if local is different
you need to input it into the input
? every axis on its own works good
my question is about a mathematical merging process
that blends on world position from local
1 - the inputs happen on the player pawn, and they update the seat the player is in - as if manipulating a flight stick
2 - the ship the seat is in gets the inputs
3 - the ship uses them to add the forces
okay so you recall other axis of that variable before assigning to it
in this case you will stacks the current manipulation on axis, without screwing the others
I think I got it
will try firstly to fix my input signal, then to use this method in order to have an outputted variable clean
will be back
thanks for the advice
I just wanna add that you don't have to do all the casting if your ship is your pawn, it's just that in my case I have a ship with separate seats inside that can be occupied by a player
sure
within my blueprint i have this sphere but i cant find when trying to generate force
something iam missing
Hi everyone, I have a question on plugins. Let's say I'm trying to build a system for my game to select the desired actor. The system is intended to be seperate from the project, more like plug and play, this way it will be easier to update and I'm making sure not too have too many hard references. If I want to pass a variable to the Player Controller or the player pawn, what would be the best way to do this ? I could use an interface but it wouldn't be a separate system anymore as I would have to add an event to the core blueprints ( player controller, pawn... ) and if I have multiple systems intended to select an object, then I would need to create multiple interfaces. The other way around, if I put the interface inside the core element, then it won't be plug and play anymore as I won't be able to call the interface inside the plugin blueprints... How to work around that ?
how do i attach a sphere from my scene to the blueprint
I tried to do it with Array, where Once editable text box is listening for input, and if numeric value is provided, It will Update the Text as per Index.
But with this OTP Text can't be modified in middle, like let say, out of 4, i need to change only 3 number, how do i do that,
Does anyone know, how OPT Screen are made or a possible approach
Cant you set focus?
6 editable boxes -> auto focuses next one on input
Generally i never ever modify otp in the middle, it just wipes it if its wrong and we go again
That might just be me tho
Hi guys, I'm new to UE5. I'm trying to implement a wall run and wall jump mechanic during the wall run, but I'm stuck on the jump part. I've tried different approaches, but every time I've had problems getting the character to jump away from all angles of the wall. Sometimes, instead of being launched away, the character gets pushed toward the wall.
this is the wall jump blueprint part
You need to linetrace the wall and get a yaw value facing away from the wall to the character's location so that you have a valid direction to jump towards.
What are you selecting? Is this for interaction? Like looking at a door in FPS, or selecting a unit in an RTS?
I'm selecting blueprint actors, they are static meshes, and the selection system allows me to move them using a gizmo at runtime. It's a RTS
@vocal mirage didn't work for me
i copied and created the flow without calls since it's on one blueprint
double checked everything
my spaceship doesn't turn
print says 0 0 0
I'm wondering if there's some settings that can alter
Is there a way to show a directional hint to the player?
I think you skipped too many details about your problem
I am very sorry, yeah that was too brief
I want to make a hint when player reaches near object, I can make the hint with collision sphere, but how do I create an arrow to show the player the direction of the objective?
You can get object's position on screen
So that you can have the indicator purely in UI
Then it's a matter of drawing a line or sth
anyone able to help me with how I can find whats causing my Video mem to be over ?
I get little burst where it complains about it but I've already lower all my textures down in the scene
I see, I am very new to BP. May i know what keyword should I search for to get a tutorial or some resource on how to get object's position on screen?
Have you tried "unreal engine get object position on screen"? π
haha , no actually it hadn't occurred to me that getting the object position would help me here! Yeah guess I will do that
Thanks for the help π
No problem. Ping me if you get stuck
Yeah, I have a lot to learn about BP π
that is great! I will surely seek help here when I'm stuck. It's just a matter of when lol
Does anyone know a good tutorial for advanced doors? I tried using this implementation "https://www.undeaddev.com/advanced-dd-doors-and-drawers" but it feels extremally outdated, and I think there is a better solution somewhere that requires less or none "Cast to" for example using Blueprint Interfaces
Are you worried about this cast?
Casting to a StaticMeshComponent is not a problem under any circumstances.
The only circumstance under which casting to a StaticMeshComponent would be an issue is if you're planning to make a game without a single mesh and don't want to incur that linker load.
Otherwise you can assume that the concept of a static mesh will already be present in Unreal Engine.
Casting, with regards to performance, is free.
Alright, it does one additional cast to the PC which is a bit redundant.
ok, thanks for info, for now I was trying to reduce all cast to, because I heard that using many of them may kill performance
No, it is a beginner's misconception.
Casting is free, but it incurs linker load.
Which means that whatever you are casting to will require loading when that Blueprint is loaded.
If you're not careful with them it will cause dependencies which causes your size map to bloat.
If you're casting to a data only class, or something that is already guaranteed to be loaded (such as StaticMeshComponent), it is no problem at all.
this might not be the best place to ask but it's sort of relevant to the topic I guess.
Can Animation Blueprints implement BP Interfaces? Or can they only use casting?
Casting is a part of programming, Interfaces are not a substitute for casting.
(in relation to the previous :)
I don't see why they shouldn't be able to implement interfaces.
Alright, then I'm going back to project
Just checked, looks like ABP:s can implement interfaces just fine.
ahhh sweet π I'll look into setting it up then
I've recently started using AnimBPs as a hacky way of setting up "EditorTick" but right now I've just been casting directly to the BPs I want to tick, and handling some of the logic inside the AnimBP. Would be nice to just have a single, very simple AnimBP that ticks in the editor and then uses an Interface to make sure any BP that implements it will also tick in editor.
(fwiw it's for pre-rendered cine work not intended for a game, which is why I always try to avoid using BeginPlay/EventTick code and instead try to get it running in-editor as much as I can)
is there some trick im missing to adding children to horiztonal boxes at runtime? I'm trying to add a # of children depending on a length of an array, but it's only ever adding 1? or it keeps overwriting the first child somehow?
oh i see you have to add the 'create widget' to the loop, you cant make a reference to it at start and then populate that a bunch of times
ok interesting now this loop is adding 5 boxes despite the last index only being 2?
I'm semi curious, what are you trying to make?
is there any issue with using this? (the context is a main menu). My worry is the "get player controller" may not always work for whatever reason
its a menu where you are selecting from a list of roles and when you select a role, you see the available advisors you can hire for that role, so i want to populate the advisors in the horizontal box when you select it
i've been relying on "get player controller 0" for most of my code
That's fine.
Should use GetOwningPlayer instead.
when I have it print out the horizontal box children count, it shows this
so its doing it correctly, then running through it again?
can you post an example of how it'd look when applied correctly?
no worries if not
GetOwningPlayer instead of GetPlayerController.
Get Player Pawn
Get Player Controller
Get Player Character
They are common reference nodes designed to reference the player in some way. They're accessible in near enough all BP.
Until you get into multiplayer. Local or Online. Then you're going to have a very bad day.
another victim. welcome to the circle

True
Well the word completed gives it away 
Select the node
I hope this isn't a weird question, but is there any way to load or save SaveGames into another location other than the default location in the AppData folder?
Through blueprints of course.
You'd have to do some C++ coding for that I'm afraid unless there is a plugin that can do it?
Are you talking about writing C++ instead of blueprint or modifying Unreal's source code?
Its one datatable for each client
And all clients have all the necesaary meshes
Referenced by said datatable
No
Server has its set
Singular set
From the servers point of view they all reference the same asset
My mistake then
I would assume so
Anything else would be annoying, to say the least
Test it
Profile it
To fully control the save path, you'll need to use a plugin or C++ for advanced file manipulation (e.g., using FPaths functions). Blueprints are somewhat limited when it comes to directly manipulating file paths.
Throw more money at it
This is a big might but you might be able to change the file locations by using the UE plugin blueprint file utilities but you'd have to see what nodes it gives you access to.
UE plugin for Blueprint File Utilities is free and comes disabled with the engine, You just need to enable it in plugins
If you really want to. You can serialize manually (surely a bp plugin does this too)
Is that part of the plugin?
This can definitely help me then.
(If not, I do know C++ but never used it with Unreal.)
I'll go look into it.
Thank you so much, you're a life saver!
No problem. What I would suggest with that plugin is once its installed and you restarted your project (required), find thenodes and drag them out into a blueprint and just see what they can all do. It's not meant for complex file stuff, just simple stuff so should work for you.
Yeah what I need is pretty simple anyway, if I can just put the save files somewhere in the packaged game folder, then have them moved to the AppData folder when the game opens or something, I'm set.
I'll experiment with it and see what I can do, thanks again.
Why not make it so you reference that folder all the time when checking / save / load game files rather than checking / save / load in one folder than moving them.
Yeah that's sort of what I'm planning, the move will only happen once, probably when the game is opened for the first time.
From then on, saving and loading will happen normally as it does in every other game.
I basically just wanted to include the premade levels made using the in-game level editor (Which uses the save system) in the game, that's what this is all about.
Fair
Oh piece of advice, always do directory checks to make sure they exist first before you do anything with file manipulation
Makes sense.
I'm guessing the plugin has a node for that as well.
Perfect.
Thanks π π
Sorry I haven't seen all your messages. What are you trying to do?
You should prly be using DAs
.csv files?
No?
Data Assets
With softrefs
The docs are decent on them should give them a read
Idk that you need to soft ref a DA
Long as the second DA soft refs the actual class
I'm trying to figure out why aren't my players at different PlayerStart(s). I have 2 of them in the level, and both players are spawning in the same one. I the screenshot is from the player controller BP
Hello everyone, I'm in need of a solution to a problem. I'm making a game where characters walk around a nav mesh and the player builds around them and detects if the path is blocked, if it is a spine is created with arrows showing the path traveled, however, I can't figure out how to identify which specific blueprint actor placed by the player caused the character to become blocked. Any suggestions?
why are you subtracting 2 from the length ?
i would just use last index
but there is a reason your using 2 ?
Why not just put a tag on each player start and assign each player their own player start by referencing that tag?
If playerstart has tag a, player a starts here.
If playerstart has tag b, player b starts here.
I added the tags, but what node would I use to reference them ?
thea actor has tag ?
I mean, what's the logic if I take this approach? I'm not that good at UE
Component has tag
You should use soft referencws for all assets in the DT
And only load what you use
Memory viewer includes all hard references to assets, as they must be loaded along with the class that references them ( this includes and is part of the cast conundrum)
Smart memory management is key
Which also.means smart asset management
Where it.makes sense you can hard ref them in a DA that you only soft ref to. Then when you need to load it, it includes all its internal assets
How do i get rendering bounds of a skeletal mesh?
In-game taking into account the rotation
Hey everyone, I hopefully quick question. Why is it that I can pass a reference to an actor to an actor component, from the actor component create a widget making sure to pass a reference to the actor component to the newly created widget. But then when trying to reference the actor component from the widget i keep getting "Accessed None Trying to read property AC Volume". Any help would be greatly appreciated and thanks in advance!
Order of operations
Add print strings that tells you what fires when, and it'll hopefully show you
Also, you can prob just do getOwner for the actual actor?
There is a IsValid node that might help you debug where this is going wrong.
I have 2 rendertargets that show fine in pie https://i.imgur.com/prriId1.png
but in shipping build they are blank https://i.imgur.com/8hfT9r5.png
Does anyone have any suggestions as to how i could troubleshoot this?
Just to explicitly confirm this. No. Your other classes have a linker(pointer) to that table. There is only ever one single table in memory and multiple things have pointers to it's location in memory.
How were they created?
No?
If the Sizemap says a character has 2gb linked to it. Then that 2gb needs loaded before that character class can be.
But if you have 2 character classes that all reference the same 2gb of content, you don't need to load 4gb. You load 2gb and both can load.
i am facing lots of load errors on loading a level being imported from otherr project
CreateExport: Failed to load Outer for resource 'AssetImportData': CommonGenericInputActionDataTable /Game/ProMainMenuV3_Blue/Blueprints/CommonUI/DT_PMM_InputAction.DT_PMM_InputAction
lots like this
After 7 different print statements and trying to explain all the troubleshooting steps i had taken it just magically worked xD I now have a new problem where I can add the widget only to the viewport and not as a child of another widget. I dont get how when I hover over the parent widget block it knows the parent widget blueprint but then during runtime it somehow cant access the parent π¦
The render targets ?
Is there a standard way of getting the angle of the ground with respect to player direction and location?
Since im not sure what "they" is specifically referring to:
The 2 actors that have SceneCaptureComponent2D are in the level at all times, so they arent "spawned".
They each have their own render targets,
The materials are just texture (RT) to output, with domain as UI and alpha as one minus.
They are capturing a childactor that is a pawn.
Can't you just take your direction and the ground normal, and get the arccosine of their dot product? I'm not sure I understand what you mean.
Like, blueprint nodes? Still new so I only know like ... Super basic node names.
I don't have unreal at hand right now, you should be able to do a trace downwards (line trace by channel) to find the floor from your character's location. If that node returns true, from that impact you can get the normal. After that it's just math and doing whatever you want with that result
Gotcha gotcha. I'll give that a shot!
trying to package a project... I get this error... I have IOS unchecked in supported builds.. just trying to do a windows build:
LogClass: Warning: In asset 'None', there is an enum property of type 'EIOSVersion' with an invalid value of 'IOS_12'
LogObj: Error: LoadConfig (/Script/IOSRuntimeSettings.Default__IOSRuntimeSettings): import failed for MinimumiOSVersion in: IOS_12
When making a main menu, do you have a bunch of different widget BP's working together or just a single one responsible for everything?
I can either keep everything on a single BP or seperate them and construct each section seperately (options, player select, etc)
I would normally advise having multiple BP's rather than just 1 large one. Think of each menu as multiple classes each doing their own thing rather than 1 large class trying to do everything. Just helps break things up.
Race conditions, beginplay unreliability
You cant trust one beginplay to execute before another
So the bind might come to late
And if it suddenly works, it's just a lucky hit, unless you made your logic more explicit
Can you get race conditions in blueprints?
well you can in the animation blueprint. but idk about regular bps. ig you can if you use async physics tick event?
Is it bad practice to cast to an actor component's owner, if I know for a fact the owner will always be a given class? I figure the owner would already be loaded to memory for the actor component to exist, but maybe I am wrong there?
If it's not bad practice, would I cast once on begin play and store that as a ref, or should I cast each time I need to access the owner's data?
I am familiar with interfaces and how to use them, I'm just wondering if it matters in this situation from an optimization point of view.
it's completely fine to cast to the owner if it's already loaded to memory and it doesnt matter if you cast everytime you access it or just cache the ref
ok thanks
For sure
BeginPlay is one of the easiest traps for this
Hi, idk really what channel it is suitable the most, but i have a problem with "Capsule Component", i am working on q/e system and i need to expand Capsule Components radius, but if i do it near the wall, my capsule expends, but does not push player out of the wall, it pushes after any movement related button is pressed, how can i fix it?
π€―
curious though, is each section of the menu just a seperate widget BP or do you mess with child classes etc?
like the options menu is a child class of the main menu bp
Each section is just a widget
ah ok
You can then drag the widget into the main widget and it does what you tell it to
hmmm. so like do the smaller widgets become one with the main widget or something?
or is it like you need to cast to the smaller widgets
sry for the stupid questions i'd check now but im away from my main computer
idk for sure without knowing every event that affects control rotation but some ideas:
- Reverse is actually triggering an update and not play or vice versa
- you may be missing a setting in the capsule collision/physics preventing an update outside of input. Some older engine versions don't have the streamlined collision / physics settings. Could try manually calling it as part of your Update
- Depending on how play and reverse are configured, you may be getting only the final Set Capsule Radius
- I think you should try adding a push to the character to make sure they don't collide regardless because updating a collision like that could be problematic with complex geometry and this additional failsafe will also solve this issue
Thanks a lot, and sorry for late response! But i am not fully understanding the second and forth ideas, what setting possible i have missing in second idea, and what do you mean by "push" in forth? Like? to set location 1 pixel out of wall?
Am I dumb, in UE 5.2 do data assets just suck?
The PDA variable shows Data Assets, not PDA's
Trying to make a map of int to data assets and access the data on the asset. Not sure what I'm doing wrong
Edit: I'm an idiot and didnt set the key to target "PDA NAME" and instead just set it to literally primary data asset
can anyone tell me what is the difference of actor component, interface?
and how do I get an actor's hitbox overlapping actors with that component -> triggering a function that reduces hp
I can't seem to cast to the interface but an component
and what simpler ways can I implement damage function?
the point of interfaces is not casting.
it's a way to implement behaviour over classes to prevent needing a specific heirarchy. So common functionality for unrelated things.
you just check if it has the interface, and message said interface
Hey guys,
I have a folder 'Localization' in which I have subfolders with different data tables for a custom solution for localization.
After not touching it for a while, I'm trying to add another folder to it, but I can't. I see this for the first time. Any tips?
Hey so, I've been messing around with the nodes and, I can successfully find and round up all the files I need, in preparation for copying them, simply using the "Find Files" node, but it's the Move node itself I can't figure out.
What do I put in those string fields exactly? Any idea?
Is the Src Filename simply the file's path? I don't know because I can't get it to work.
Is the Dest Filename simply the destination folder? Why is it asking for a filename in that case and not a folder? I also don't know because it's not working.
Do the tooltips or docs shed any light?
None.
The node specifically doesn't have a tooltip, and you know how bad Unreal's documentation is.
Sorry, what do you mean?
Tried both with and with file name, both types of slashes, no luck.
VHi all.
How are you?
So, I have been trying to figure this out for about 2hours now. I've tried as many "solutions" as ChatGPT and other AIs have suggested. Tried what I found on Google, still nope.
Problem: How do I prevent acceleration mid-air?
Observations:
-
only when I hold down the Shift-key to Sprint then jump, does the acceleration in mid-air happen
-
as this is happening, it feels as if the player-character is being push forward more or further than what it would.. ahh.. "naturally" ... ahh "'arch". Like, its velocity is increasing unnaturally compared to just sheer, ah, inertia.
-
if I jump then hold down the Shift-key, nothing happens.
Here's a screenshot of the code:
Video:
Hey guys and ladies, someone have a quick solution to limit the angular speed ?
this is the solution I tried but have problems
If I start spinning in Z axis for example, it suddently become unstable, being influenced in other axis as well and I don't understand why
instead without this limit, it works normally but cannot limit speed.
someone have a hint?
Question, why does the left image not work while the right one does? What's the exact difference between them?
Not work, as in the event does not trigger
Question
After Adding Motion Matching and chooser to my project and adding it to ABP
like shown in picture it perfectly works the movement and jumping everything beside the following
Anyting related to Anim Montage or montage and any animation that can be played through BP it doesnt work player just freezes and goes back to the Motion Matching/Movement/Idle i tried with differernt animations still same the character freezes for couple seconds and goes back to normal like the animation doesnt get to be played i dont know what is blocking it.
Btw i tried different animations and in different BP still doesnt work
Because there's an entire node and a red line missing.
The left is from an EventDispatcher from the IFSGameState object
What your AI cannot understand to tell you is that you need to set the movement speed when you jump as well. In essence, you have multiple complicated states where you need to transition your movement speed between them. You need a simple state machine setup.
solved sorry i forgot to add Default Slot in between
Chances are that binding is not bound. You don't normally use the leftside's style unless it's a subobject like a Component with the Actor. Binding to another actor's event like that likely won't work. Those events likely attempt to bind before your beginplay runs, which is where you're setting that pointer.
Like this?
Ok thank you! That makes sense indeed!
Maybe. If I understood you correctly, the air movement should never exceed the normal movement speed's max speed? As in it should ignore the sprint speed?
dasdad
Does my (-sarcastic tone-) beautiful illustration makes sense?
thank you so much
Let me try and explain myself.
- what I'd like to see, is for the player-character, to stop being pushed by the power from the Sprint.
... think of it as a tennis love (whatever it's called). You hit/serve the tennis ball, and it makes this arch'/curve.
- essentially, I'd like:
... to disable the Sprint
... as soon as the Play-Character
... is in the Air
- because, from what I have observed. When it is in the air, the player-character is still being pushed forward rather than its intial, ah, inertia / force.
I just woke up so no idea if you've solved this?
Can someone tell me if I'm making an obvious mistake? I guess my problem is somewhere else in my stamina system but gotta ask:)
Image 1:
BP_ThirdPersonCharacter
I try to set "CanRun?" to false when "Stamina" is <= 12, and I try to se"CanRun?" to true when "Stamina" >=13. And I try to print this to string.
Image 2:
Stamina is set to 100, print string message shows correct.
Image 3:
"Stamina" < 12, still no new print string message.
Image 4:
"Stamina" >13 , print string message shows correct.
Forgot to mention I'm new to Unreal and gamedev
And programming
Think can't run can't print because you have it checking the boolean for whether to print at all
so break the link to print to screen on both of those
maybe
That makes sense! I will try:)
Hehe
Removing the string showing the cant value
Also yoi have a 1.0 gap there
Between 12 and 13
It should just be > 12 else
I constantly make similar mistakes with print string, where I'm trying to check the value of a float and accidentally end up with the float connected to the display time instead of converted to a string
Also, CanRun() should be made a pure function
Thanks, I'm Aware, Just messed with 10's of outcomes to make it work xD
And return stamina>=stamina_run_treshold
Thanks! I was thinking of this, but were so uncertain how to do it. Thanks alot to all of you!
I would suggest as what Squize did to get it into a function at some point.
The sooner the better
Now it's working as intended! THANK YOU!
Next problem is why can I run even when out of stamine, but have to look into that later xP
If running and stamina <= 0 stop run
I mean it! Thank you so much for your quick responses! I allways try by myself + google, but get stuck very often:P
I just stumbled through my own stamina/sprint system recently without checking any guides or best practices, I'd be terrified to let people see the abomination I created tbh
but hey, I go when I should go, stop when i should stop, only consume stamina when I should. good enough for now.
You learn from your own mistakes and as Squize just said, we all started somewhere
At some points in the process, getting things done can be more important thatn making them right
I normally work with the process of
A) Get code working
B) Tidy code
C) Can I optimize code
I don't know why it's working now, compared to 30 min ago, but It's working!
It's cos you changed that 1 thing that you forgot you changed and now you can't remember what you changed.
Might as well 'show it off'
even if I don't fix it now someone will tell me something useful for when I get around to it
probably faster than if I just asked for advice, good old Cunningham's Law
Exactly something like this! xS
To be fair, just needs tidying.
this is what happens when you just keep hammering down each problem one at a time, no hesitation
no planning
I have to ask, do you comment your code?
when I'm afraid I'll forget how something worked or what it was doing
usually I'll go comment it if I'm going to ask someone about something, both to catch obvious problems on my own and to help with insight
this all makes perfect sense to me though and I mostly posted it because I'm sure it's a wreck
hold down the sprint button and when it first triggers it turns off stamina regen (used elsewhere and to tell other stamina-consuming actions that they can't occur) and starts a timer that fires off an event, assuming adequate stamina
event drains stamina and sets movement speed to the sprint speed every quarter second, as long as I have enough stamina and keep moving.
running out of stamina, stopping movement, or letting go of the sprint button kills the timer, turns regen (and other stamina-consuming actions) back on, and sets movement speed back to normal
Sprint IA can give you the tick you need for sprint depletion fyi
No need for secondary timer
Using world delta * staminaDepletionRate and you're golden
I'm deathly afraid of putting anything on tick that doesn't really, really need to be on tick
Sprinting = IASprint AND CanSprint()
Stamina depletion is tick worthy imo
Smooth UI update rate aswell
Simple delegate OnStaminaChanged which UI hooks up to
Used both when decreasing and increasing stamina
@dense garnet I was messing around with that a bit. This might be a solve to your issue. Set the character's velocity directly. Limits it to what it would be if there was no sprint and they were moving in the same direction.
I get consistent jumps from sprinting and non sprinting like this. You just need to limit that clamp to whatever your non sprint speed is.
Or reduce jump velocity while sprinting π«£
More realism π
Or something
But for consistent jumps this makes sense
Might look strange with the sudden velocity reduction?
It's odd feeling as a gamer, for sure.
You should really ignore people who cry about tick usage. Make you game. If it works, great. If not, fix it. But by the time you're in a position to care about the performance of something running on tick, you'll likely have the skills to understand why and find a solution for it.
Spending excess amounts of time avoiding tick is just going to prolong your dev time even more than fixing it later. At least you'll have a game to optimize at that point.
I've finally got my damage function going
but its variables (hp depends on its own, not set by the actor's variables)
Youtube tutorials really made some damage lol
Tick has its uses. It's just easier to "educate" people not to use it instead of teaching them when it's appropriate. π¦
Stamina drain on timer is fine aswell in this case, just less... pure
In my head I know I can trample every single 'rule' of performance and probably still run the game on a toaster, since I'm not making anything too complicated in terms of programming.
But there's still a part of me that's like 'but what if, though'
Yeah. But the problem is that people "educate" people not to use it by being fuckwads who advise using 0.0001 timers.
These people are idiots.
Damage causers
And all too common.
Stuff often scales beyond what you imagine. Little extra feature here and there adds up quick. I'm not advising you to throw everything on tick for the fun of it. π Just simply that avoiding it for the sake of avoiding it is equally bad, and a lot of the "Fixes" like spamming timelines(which are an extra component that ticks anyhow) or the 0.0001 shit (which is actually less performant than tick since it runs the same function multiple times every frame) can be worse than a simple tick function. You should definitely be performance conscious when designing systems of course. But you have to have the understanding to be conscious of if first. This requires having profiled, and seen how certain code performs and understanding why. You have to hit the walls before you can learn to avoid or scale them.
I just looked at my relatively small project where I consciously checked with myself whether I need Tick
Instead of hanging everything on Tick, I now have several Rube Goldberg-esque systems that is somehow functioning
I typed that comment and went to sleep, so no.
Dest Filename is where you want to move the file to
Src Filename is the file you want to move.
Remember that when dealing with unreal file operation nodes, it uses / destinations and not \ destinations.
\ destinations are system paths where as / destinations are file management locations
Also here is the node list for File Utils. Might help you out further down the line.
https://dev.epicgames.com/documentation/en-us/unreal-engine/BlueprintAPI/FileUtils?application_version=5.0
File Utils
The slash thing I know about from getting the package's file path in blueprints previously.
And the documentation tells me nothing as I said.
But again, assuming Src Filename is just the file's path, that's easy.
Dest Filename is probably where the problem is, is it just the destination folder? Why does it say "filename" then? Should a file already be there or something? I already tried everyway I can think of to type it, and nothing worked.
So I did this and it works
Apparently it doesn't actually care about \ or /
I literally made 2 folders on my desktop. Test 1 and Test 2. Made a txt document called Test.txt and it successfully moved it.
@grizzled roost
You use the rank as a reference as to what info to pull from a variable. You could use a data table and pull all the info from that using the rank as the row name. If rank 1 use this row of data, If rank 2 use this row of data, etc.
Sigh It turns out I messed up the order when appending the file name and it's path, that's what was messing everything up, now it works, but it's good to know the correct way to do things anyway.
Thanks again, and sorry for the inconvenience.
Thank you for your response.
And thank you for your efforts.
Can I try that tomorrow, can give you feedback? After 4+ hours of trying to figure this out. I have a massive migraine.
However, here I have some initial sucess.
@maiden wadi
Okay, good news. After trying many different nodes, node setups, "tweaks" in Character Movement component.
This is the closest to what I am looking for.
Attaching a screenshot to the closest solution (so far).
Also, a uploading video after.
@maiden wadi
This is the video.
Information on [What is Being Tested] during Record:
... I try to explain this as simple as possible.
1st Jump = I have to jump then click Shift key (Sprint) to activate ... something
2nd Jump = Showing the initial problem meaning it is still there.
3rd Jump (and up) == Notice how I am "Sprinting" then I Jump, the Player-Character gradually stops (not immediately).
-->> [#3] = This is what I am looking for. <<
A slow-down, a reduction of "lateral movement force", a Tennis love/loob. . .
while Jumping.
Currently Problem:
~ Sprint must be active (hold Shift key) or player-character must be Sprinting then Jump and finally, let go / stop pressing Shift key
for the "Force reduction" to the "Lateral Movement. . . to be applied.
... after 4+ hours of trying to solve this. I am going to stop. I feel like this is very close.
Not an inconvenience. This channel is meant to help others out. It's the purpose of it π
I can't find a solution to this, if anyone has a better way to do this please feel free to advise.
I'm trying to build an equipment upgrade (think like attachments) modular system for my game. I'm testing my implementation using my already existing interaction system. I have a blueprint component that I want to reference inside my interactable actor (the idea being, when the player interacts with the attachment on the ground this will be "picked up" and the corresponding equipment on the player upgraded") and add that to one of the player character components (a static mesh), I know about the "Attach component to component" node but it's asking for an already existing component. I want to be able to create the component and pass that to the "Attach Component to Component" node using blueprints
I know there's also an "Add Component by Class" node but that will add the component to the Interactable actor, I thought about doing that and then passing that to the "Attach Component To Component" node and then destroying the newly created component from the Interactable actor, but for some reason when I try calling "Get Component By Class" on my Player Character, it's not there..
hi guys, i'm hard stuck with the wall jump feature, it only work with a specific wall angulation, i'm working on this issue from 2 days and i still got nothing, someone can give me an int? here are my blueprint for the wall run feature and the wall jump
Because you're creating the component within the pickup and simply attaching it to the character.
You need the target of the AddComponent node to be the player character too. So that the character itself creates a new component for itself and then it can be attached.
The GetComponentsByClass does not care about things attached to the actor. It only cares about components which that actor manages.
π
so if I want to make logic to say if player gets x points he wins in a single player game , is game mode the preffered place to put the game win logic?
I'm just throwing this out to see if this is the simplest way I can do this?
Any tips?
I know I could keep the cooldown bool in my main actor vars but I don't want to >:(
you mean the cooldown? I would fire up timer for that
See I saw a thread about timer nodes but there were too many options when I right clicked
Would that go were the delay node is?
yes
set timer by event. drag the red callback pin, create event, hook your boolean set to true there
Okay, thanks :)
Does anyone know if theres a way of passing a function as a variable in a struct? I tried looking into blueprint function libraries but they seem to be intended for multiple functions and ideally I would like to have single functions not under the same library.
You could do the ugly function ny name trick
Function by GameplayTag is better
Requires custom setup tho
do you need it for any "dangling" function? @rotund harness
or for like a single known type of function like "Talk"
Im not sure i understand what you mean sorry
what functions do you need to pass like that?
and from different angle: do you know about interfaces and if so are you positive you can't/don't want to use them?
Its basically functions that check various variables in the level, player and gamemode, and depending on each case modify some values in the struct.
Yes i use interfaces, but I dont think they could do what I need
Its just a way for me not to have to modify the code each time, so it just adapts to the function it is given basically
Beacuse of this i dont think i can have inputs to the function for example, bacause they depend on the function
unless they all have the same input (which isnt the case)
what if you put those functions on an object. and pass that object
Yeah i thought of that but wouldn't it be easier to use function lists in that case?
I havent done that much research on function lists btw
I would prefer having objects with clear responsibilities and ease of management over some C-style programming
Im inclined to agree
but that's me. and don't know much about those functions to claim it would be better
look from aside if refactoring is possible and whether it could bring benefits
Hi, I want to know if it's true that when I use the "remove widget" node, it really removes it, or not?
Yes
Should I use something else tha "Event Tick" for this? I would also like to add some sounds when stamina is less than a certain value, but I don't know under which event, any ideas?:) (I'm new to kinda everything)
cause remember that you need to call those functions with different parametrs anyway, right? so you have to have some context in which you will be doing that. and having a dynamic invocation feels wonky and is not suited if you don't know much about c++. source of way too many headaches to me
@visual ember @gentle urchin oh ok thanks for the advice, I'll see what is possible, otherwise ill try and find a way of obtaining something similar in some other way
Ypu can set the bool directly
If anything you can compare the result to the state of the bool, and execute an event once it changes
yet another victim of "don't use tick", ehh...
Haha, yes:P
π works like a charm
I never said anything like that at all π
I said i'd use tick for stamina depletion earlier ,
Valid candidate
How to translate that to a 'execute on change' event is just a memory state comparison
@gentle urchin Oh no, I didn't mean you have said so, I mean I've read and heard it elsewhere several times. If you meant me:P
@rare mortar in short. use tick if it feels ok and makes you implement logic faster. keep in mind that spamming tick and putting heavy stuff there will affect performance. but don't be bothered initially. by the time you happen to get bottlenecked by it, you will know "ways of programming" to the point where you will know what to put there and when, and what not
Ok good, π
I avoid tick cause I hate refactoring
Oh ok, thanks. Then I'll continue π
and when you happen to have performance issues, first profile to see what is the cause, then start cursing at that thing
My performance issue is my ego thinking I can make nanite and lumen work with VR on a large map.
you gotta be a perfectionist at that point
Gonna make a slideshow game.
turning "bug" into feature. nice
I'm trying to recreate the door physics from Amnesia. I'm using a physics constraint on the door mesh and the SetWorldRotation node to move it. How can I make the door move slightly in the opening direction after I release the mouse button?
what if you don't set world rotation, but apply a force?
I didn't thought about it
i'd lerp it untill released, then add force depending on last momentum before release
ok, I try it, thanks
Gotta lerp your lerps
just track delta rotation for the last frame or two , and use that as the base
Thanks! I will try this later today:D
I'm trying to make a rich text field, but the styling isn't reckognized and if I try to input it into the text field directly (screenshot example done trough variable) styling will get removed
Question: is there any way to fix capsule component location after simple move to location, it stops at front of capsule but not at the center? (if you take top down template movement stops at front of capsule component). or i should do some math to accommodate capsule radius.
How hard is it to switch out movement, mesh, skeleton and animations from the default ue5 character, while maintaining all custom functionality? Is ti just easier to make a custom player calss and just copy paste what I can?
Is the styling recognized when you simply test it in the UMG Designer of your Widget?
Also #umg for the future.
I think I found what was wrong, I was closing the styling with </HLRed>, but it works fine if I use just </>
I just kinda assumed it works the same as HTML
That sounds like the AcceptanceRadius is roughly the radius of your Capsule.
This is usually a fail-safe to ensure the Pawn doesn't need to reach the location 100%.
Ah, been there :P
May I ask what your goal is?
I'm not entirely sure what "all custom functionality" entails. Swapping out the Mesh, Skeleton and Animation(Blueprint) is relatively easy. Just open the Blueprint, click on the Mesh Component in the Components Hierarchy on the Top Left, and select your new SkeletalMesh Asset, as well as the matching new AnimationBlueprint.
Oh, I just term searched for "UI" and noticed there's no channel with they keyword, so I assumed there is none
Sorry for that
Makes sense. Unreal Engine's UI systems are called "UMG (Unreal Motion Graphics)" and "Slate". With Slate being what drives the whole Editor. Slate is more or less to UMG what C++ is to Blueprints. Not 100%, but it's somewhat easier to picture it that way at the start. You can also write your Game UI in Slate. UMG is basically just wrapping Slate Widgets.
I wouldn't do that though, unless you 100% know what you can't do something in UMG, or you need the performance boost.
noted
need to check about it, thx!
Hey everyone, can anyone see why i can create a widget from an actor component successfully but not add that widget to its parent widget? I can pass information from actor -> actor component -> widget -> actor component -> actor. but I cannot for the life of me figure out how to add the WB_SongControlSlot to WB_ActiveAudioControlUI. The error I am currently getting is "Accessed None trying to read property K2Node_CustomEvent_AC_Volume".
Hello, I have 100 folders called ex1-100
How can I rename them for 1st time with ex to T_Folder1-100?
I checked in the Editor Utility if it's possible, but I guess it's not possible
there is something like this for the Level Sequence Editor
but it doesn't work
when I select all folders
I need something similar for Get Selected Asset, but for folders
Why would you set Self to a variable ?
There is a lot wrong in your Code.
First Image:
- GetActorOfClass is not an ideal setup. Why does whatever Blueprint you are in there need to spawn the SongControl Widget? Why can't the ASongChild not do that itself? And if you need to have something spawn it, use something that is easily accessible, like a Component on the PlayerController or GameState.
- Why are you setting AC Volume to "self"? That makes no sense.
- Why is your code littered with Interfaces? This looks a lot like you thinking that Interfaces are fixing something for you which they aren't. A lot of stuff you do there has no need for interface calls.
Second Image:
- You are binding an Event to the AC Volume pin of the Event. That doesn't work or even make sense. You should also not use any pins of events that aren't even connected to the same node via the the exec line.
solely because it wasnt working when i didnt have that and i was trying everything i possibly could to get the actor component to work with the widget. in the end i dont even know why the actor component and widget decided to start working togethter but they did
The error I am currently getting is "Accessed None trying to read property K2Node_CustomEvent_AC_Volume".
That means that AC Volume is null, which makes sense, cause you use a pin of an event that isn't even part of the Execution Line, and at that point thus null.
ahhh
but I cannot for the life of me figure out how to add the WB_SongControlSlot to WB_ActiveAudioControlUI
Ensure that your WB_ActiveAudioControlUI is spawned by something that is easily accessible. E.g. let your PlayerController spawn it and save it to a Variable.
Then remove all that shitty GetActorOfClass stuff, and let your ASongChild Class, on BeginPlay, get the PlayerController, from that you get the AudioControlUI variable, and on that you call something along the lines of AddSongControl, while passing it the AudioComponent.
You are totally overcomplicating that setup.
The AddCOntrolSlotToControllingUI interface call seems redundant.
Interfaces are meant to bridge the gap between classes that have no common parent, as well as remove dependencies between classes and allow the actual implementation of the class to be swapped out (e.g. OnlineSubsystem changes, or a Test related version for AutomationTesting).
You shouldn't use Interfaces if you only add them to one Class, or if the Classes yo uadd them to share a parent. Then you can just call the methods directly.
Also, assuming "ActorSpawned" is called on BeginPlay of ASongChild, you can't guarantee that whatever the first image is from calls their BeginPlay before or after ASongChild.
Unless that is an event that calls "sometime later".
Which I can't know of course.
giving context in case this changes anything, I am trying to create a system where a user can click a button and it will spawn an actor playing the associated sound. then have a widget be able to individually control the volume of each spawned actor.
Ah wait, is AddControlSLotToControllingUI an EventDispatcher?
Or an Interface? I can't remember how the nodes look like.
everything is using event dispatchers
Right, then ignore the Interface part. I mixed up the node visuals.
The EventDispatchers are still only really meant as a way to notify something outside about something changing. E.g. "OnControlSlotAdded".
If you want to add a ControlSlot to the ACVolume, just call an event on it directly.
Yeah, that's fine. But your EventDispatcher in the ASongChild is wrong fwiw.
You can't really listen to it spawning like that. It's like someone setting up a Newsletter and instantly sending the newest post. No one could have subscribed yet.
Instead, in that BeginPlay, you'd get (e.g.) the PlayerController, and from that the VolumeControlUI, which you'd have spawned in teh PlayerController too.
If you want to clean this up even more, you can of course have an EventDispatcher in some SongChild Manager. Maybe a Component on the GameState.
When the Player click the UI Button for the Song, you could get teh GameState (GetGameState), cast it to your custom version, grab the ManagerComponent and tell the ManagerComponent to spawn the SongChild Actor.
The ManagerComponent would then, after spawning, call an EventDispatcher "OnSongChildSpawned".
Your Audio Control stuff can also get the GameState on Construct, and bind to that.
And when it calls spawn the new Widget inside of itself.
Not sure that exists. I know there was a plugin for bulk renaming on the Marketplace. Only other way would be renaming them in the explorer, but then you will break all the references.
bless, thank you. I just started trying to do this project about a week and a half ago and put close to 90 hours just watching videos and trying to make this into a working system. I only learned event dispatchers two days ago and have been trying my best to make things make sense both in an organization sense and just a comprehension sense. thanks again!
It's tricky to explain this to someone who just started out. A lot of this is learning by failing fwiw.
100% been coding for a while but blueprints are wonky to me for the time being
Question: Is this a good way to do a death system? If not, what would be a better way?
Note: The OnDeathDelegate is activated when a GameplayAttribute hits 0, it functions alright so there's nothing wrong with it. I'm really just looking into if this method of having the character send a ServerRPC for death is a good idea or now.
That might look rather unorganized, but give it a read.
That's one of the setups you can try.
Anyone have a super fancy wall running system?
Why is the Instance itself binding to its own Event? Wherever you are calling "OnDeathDelegate", is where you can just call "OnHeroDeath" directly.
if this method of having the character send a ServerRPC for death is a good idea or now.
In theory, really bad idea. But if you are doing a coop game, then it wouldn't matter too much. But in theory, it's the Server that will deal the damage, and thus will know that the Character died. The Client shouldn't handle this.
Wherever you are calling "OnDeathDelegate", is where you can just call "OnHeroDeath" directly.
That's in C++, so that's why I'm binding it here.
But in theory, it's the Server that will deal the damage, and thus will know that the Character died. The Client shouldn't handle this.
Originally, my idea was that because the death involves the character, it should be contained within the character. Regardless, if it's a bad idea, should this delegate be on the GameMode or smth else? Or what would you suggest instead?
That's in C++, so that's why I'm binding it here.
BlueprintImplementableEventexists. :/
Sorry, you're gonna need to elaborate on that
Originally, my idea was that because the death involves the character, it should be contained within the character. Regardless, if it's a bad idea, should this delegate be on the GameMode or smth else? Or what would you suggest instead?
I don't think this has anything to do with Character vs GameMode. You should not need a ServerRPC to notify the Server about the Character's death.
If you want to react to C++ code, you could just make this:
/// Header of AHero
/// General C++ only OnDeath event. Virtual in case AHeroChild wants to do things differently.
virtual void OnDeath(AHero* Hero, UAbilitySystemComponent* CauserASC);
/// Has no C++ implementation. Solely meant to be implemented in the BP Child Classes.
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "OnDeath"))
void K2_OnDeath(AHero* Hero, UAbilitySystemComponent* CauserASC);
/// This requires the Delegate to be Dynamic, which is fine here, cause you only call that once in a while, but you should generally consider not making delegates Dynamic if Blueprints wouldn't need them. The cause in Performance is there.
UPROPERTY(BlueprintAssignable)
FOnDeathDelegate OnDeathEvent;
/// CPP of AHero
void AHero::OnDeath(AHero* Hero, UAbilitySystemComponent* CauserASC)
{
/// Do C++ Death Logic
/// Give Blueprint Child Class a chance to react to the Death
K2_OnDeath(Hero, CauserASC);
/// Notify outside Systems about the Death that need to know, e.g. UI.
OnDeathEvent.Broadcast(Hero, CauserASC);
}
There is no need to bind to OnDeathEvent in AHero itself basically.
And I don't know why you need the RPC. If you are actually using GAS, which the ASC shortname would suggest, then the Attributes, which Health is probably one of, would already replicate, right?
So Server and Client would know already when the value falls to 0.0
If at all you want to bind to the Attribute changing on both sides, and limit the DestroyActor call to the Server.
I may also note that calling DestroyActor instantly is generally a bad idea (also you have logic behind your DestroyActor call. DestroyActor should be the last node!). Reason for that is that the Clients won't get any more updates that you might still want to send.
I would suggest you use the bIsDeath boolean as an OnRep/RepNotify boolean, and when that value is true, "turn" the character off, aka Hide it, set Collision Disabled, etc. and then either call DestroyActor delayed by 3 seconds, or make use of the Lifespan variable.
The code I posted doesn't care about Server or not. It's up to you where you call this.
So it should work for a server multiplayer, or I need to do a bit more myself?
I have this logic that spawns my players, it's from a template that I'm working in. I tried to change the spawn in the ChoosePlayerStart function of the Game Mode BP, but it doesn't seem to work, any clue what am I doing wrong ?
You can do things like these too:
/// Header of AHero
/// Struct holding Death related information.
USTRUCT(BlueprintType)
struct FDeathInfo
{
GENERATED_BODY()
UPROPERTY(Transient, BlueprintReadOnly)
bool bIsDead = false;
UPROPERTY(Transient, BlueprintReadOnly)
UAbilitySystemComponent* DeathCauser = nullptr;
};
/// Callback for Clients to react to the Death
UFUNCTION()
virtual void OnRep_DeathInfo();
/// Replicated DeathInfo
UPROPERTY(ReplicatedUsing = "OnRep_DeathInfo")
FDeathInfo DeathInfo;
/// Server only function called when the Player died based on HealthAttribute being 0.0 on the Server
virtual void HandleDeath(UAbilitySystemComponent* DeathCauser);
/// Similar functions as before.
virtual void OnDeath(UAbilitySystemComponent* DeathCauser );
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "OnDeath"))
void K2_OnDeath(UAbilitySystemComponent* DeathCauser );
UPROPERTY(BlueprintAssignable)
FOnDeathDelegate OnDeathEvent;
/// CPP of AHero
/// Server Only
void AHero::HandleDeath(UAbilitySystemComponent* DeathCauser)
{
if (!HasAuthority()
{
return;
}
DeahtInfo.bIsDead = true;
DeathInfo.DeathCauser = DeathCauser;
/// Optional, cause Server doesn't call OnReps in C++.
OnDeath(DeathCauser);
}
/// Client Only
void AHero::OnRep_DeathInfo()
{
if (DeathInfo.bIsDead)
{
OnDeath(DeathInfo.DeathCauser);
}
}
/// Calls on Everyone
void AHero::OnDeath(UAbilitySystemComponent* DeathCauser)
{
/// Do C++ Death Logic
/// Give Blueprint Child Class a chance to react to the Death
K2_OnDeath(DeathCauser);
/// Notify outside Systems about the Death that need to know, e.g. UI.
OnDeathEvent.Broadcast(this, DeathCauser);
}
@astral orchid
Updated, pseudo code so fast is tricky :D
So from my understanding, this should work on a server implementation.
No worries, thanks for the help
Also, it was just to get an instant reaction so I know it works
I did code it for Multiplayer. You gotta know yourself what stuff you want and need to call when. Β―_(γ)_/Β―
alright
I mean, the first image you sent doesn't seem to use the whole GameMode's flow for spawning the Player, so why would ChoosePlayerStart even be used?
Given it passes "Self" as an owner to the SpawnActor nodes, I guess that's in the PlayerController.
that's in the player controller BP
ChoosePlayerStart is only used when you use RestartPlayer and let GameMode handle everything.
The first image clearly shows that it's using GetAllActorsOfClass to spawn the Actor, not your ChoosePlayerStart function.
This isn't compatible.
In other words: There isn't supposed to be any Spawn code in the PlayerController if you want to make use of the ChoosePlayerStart flow of the GameMode.
do I have to add the posses pawn logic in the game mode BP as well ? and all the other stuff that comes with Spawn Actor BP VRcharacter and FPS VRCharacter
Assuming OnHeroDeath is executed by the server because the server has set the player's health to zero and that you want the Show Respawn Screen logic to go where your comment is, another event called Client_OnHeroDeath with Reliable True and Run on Client should be after Destroy Actor. That should then create and reference all of the client widgets.
In theory yes. The GameMode uses the DefaultPawnClass for spawning when calling RestartPlayer (which will happen when joining the first time automatically).
You override functions like GetPawnClassForPlayer or whatever it is called to do that dynamically.
If you don't want do move all of that or there are reasons this won't work for oyu, then you need to write a custom function to get the PlayerStarts and call that where your first image calls those two GetAllActorsOfClass nodes.
@dreamy sail
But just to be clear, this would work for a server. I would need to extend it a bit more, such as having something calling the HandleDeath function, as well as the C++ death logic in OnDeath. The OnRep_DeathInfo is for relying death info by the causers and whatnot (pretty self-explanatory in hindsight), the only thing I'm a bit confused about is the K2_OnDeath and the OnDeathEvent.
I would argue that the "Death" of the Character is a "State" and should probably just be an OnRep. A Client RPC would work here too fwiw, it's one of those cases where it's not THAT set in stone.
But I wouldn't call any RPCs after DestroyActor. I would call the RPC on the PlayerController before destroying the Actor. DestroyActor should always be last.
I could see either working but that's the way I would do it to avoid network buffer overflow in all cases for something as important as dying
Do you know if its "GetDefaultPawnClassForController"?
Yes, something has to call the HandleDeath function. Presumably the code that listens to the Health reachign 0.0. Idk how you currently trigger that stuff.
Some peeps call this from within the AttributeSets for example.
The K2_OnDeath and the OnDeathEvent have two different purposes.
K2_OnDeath (called K2_ cause we already have an OnDeath and K2_ is usually used by Epic to indicate that it's a Blueprint Version (K for Kismet)) is simply used to give any Blueprint Child Class of AHero a chance to also call some code.
You could also make OnDeath an BlueprintNativeEvent, but I usually don't do that as I fear that Blueprint users miss to call the Parent (Super) node and my C++ code own't be called. K2_OnDeath, as BlueprintImplementableEvent, has no C++ code and is only meant to execute in Blueprints.
OnDeathEvent is a Delegate. You usually use these so other Systems, outside of AHero, can listen to the Hero dying if they need to. E.g. your UMG Widgets that want to display something.
You'd be right with it being called from the AttributeSet
Yeah that's the one that allows you to dynamically specifiy the class to spawn based on the player that comes in. it's a bit tricky to use that if you want to decide this based on VR or not. You'd need to store that info in the PlayerController before connecting fwiw. This is all a lot easier in C++. I would suggest you stick to replacing the GetAllActorsOfClass logic that is in the PlayerController for now.
Fair enough
Hey idk what happened but now my player is using different components from its parent. All I did was change the flipbook sprites. I can't even change the flipbook back in my player blueprint.
This doesn't look like you only changed the Sprites. The whole BP is called differently. All the functions are different too.
Yea idk why it didn't that.
Top right corner shows the parent class of the BPs
It still says my original parent
So BP_Player inherits from BP_ActionChar?
Is there any C++ involved?
Nope just blueprint
I would suggest you restart the editor.
All I did was change the source flipbook and then it changed components of my player
Ok
Otherwise, revert your changes back to the working state.
And I don't want to read you telling me you aren't using Source Control.
Cause if you break your project and you aren't using Source Control, no one can help you anymore.
I'm just wondering if there's a way to reverse this?
Yeah, undoing your changes using Source Control.
There are free setups with Perforce + Free Azure Instances iirc, so there is no argument against having Source Control setup to ensure projects don't full out die when something starts bugging around.
If you aren't using it, then not really. There is no "old version" of your setup. You can check the Auto Save or whatever it is called in the Saved folder, but that's about it.
I was just wondering if there was anythign I could do before I do that
Idk why your Blueprint does this. The RootComponent is even renamed.
This is not normal. If there are no C++ changes involved and everything is Blueprint etc., then it's probably straight up a bug
Ok. I will just revert the state
I'm trying to set up an arcady kart controller using raycasts as the suspension, but I'm running into an issue where accelerating causes the vehicle to lift nose up, and reversing causes the vehicle to lift tail up, any ideas?
Sorry, forgot to ask. Should the OnDeathEvent's FOnDeathDelegate still be a 2 param delegate?
Here was the original code for the Delegate btw:
UPROPERTY(VisibleAnywhere, BlueprintAssignable)
FOnDeath OnDeathDelegate;```
Why is my click event not registering when I click a character class? It registers when I click a static object (default cylinder or cube) but not my character (I have it set to printscreen hit actor) See below for code and collision preset on character
Yeah. The reason the others don't have that Hero Param is that they are already called inside that Hero instance. There is no need to forward that. Outside systems that might be listening to multiple OnDeathDelegates of different Heroes might want to know which Hero triggered it.
so keep it the same?
So... I'm trying to make a track following system, where the track will be split up into multiple separate splines (cause it'll be splitting, merging, and just overall going long distances, can't all be one spline) and I've got this code to notify the little test bed train I've got when the track is changing to a new spline which (I think) should work... but how would I go about initializing the spline component reference variables to a specific instance of the tracks (the one the train happens to be starting on)?
hey anyone know why when I retargeted an animation from ALS V4 to the UEFN mannuequin from motion matching sample it bugged out
Do events last perpetually? I.e they play as many times as needed
or is this bind event only going to fire once
Are you asking if the binding will be able to fire more than one time or if it'll need bound again?
both really
I guess: what's the best way to continually rebind events so they fire everytime they are called
This depends on the binding. Most only need bound a single time, and then can be ran an infinite amount of times until they are specifically unbound or their owner is destroyed.
Rare events like the character's jump apex one, specifically unregister all registered events after broadcasting them. So you're required to rebind them every time the event is ran.
I could be wrong on what you're trying to do, but would interfaces work?
for your issue that is
cause they would be able to fire whenever you needed them to, and collect any data you needed from any other actor or blueprint
Interfaces should literally be the last consideration you ever fall on when trying to communicate between things.
i will cast, i will do event dispatchers, i will create unnessecary bluepritns to liase between modular pieces
NEVER interfaces
...... really? Literally everything I've ever seen said "use interfaces when communicating between actors"
cause casting loads the whole blueprint which people have always said was a bad thing
To be clear. I will happily use interfaces, if the situation requires it. That situation is insanely rare.
imo interfaces are like a malignant cancer on unreal tutorials but i'm dogmatic
So what's bad about them? Cause I've just started my project and the interface I've got is indispensable for my character interacting with stuff
The issue is that there are so few cases where this is a real issue unless you're careless and don't actually understand how linkers work. This doesn't actually directly have anything to do with casting itself execept that the output type on a cast node happens to be a linker. So is a class property, and a function input.
but it seems pointless to load a whole blueprint just to access a small part of it, if not just a couple variables
no?
Er..
This is exactly what I mean about not understanding linkers.
That blueprint is already fully loaded.
i just don't think they're very intuitive to use. event dispatchers and casting feels more seamless, when i return to a project after a long time, interfaces are literally the first thing that causes me headaches from a general "I need to understand what's going on here" standpoint
You aren't accessing a small part of it using an interface. It is fully loaded or the interface wouldn't work either.
huh... I mean I just started using Unreal like 2 months ago so I guess I don't have any background for what I'm saying other than you two are the first people to ever tell me interfaces were bad
ah XD well alright
I'm saying they're entirely overused. π
I see...
every tutorial and their mother seems to use interfaces is quite ridiculous
To start with the basics. Do you understand what a pointer is? The blue variables you input into and get from a cast node?
Ok so if interfaces do actually load the whole blueprint, what would I use if I don't want to load the whole blueprint?
they don't
When trying to call child logic from a parent; is it better to use a function override or an interface?
Ignore the loading thing, that is a bad phrasing.
but the moment something is there to respond to it, that thing will be loaded already
This shouldn't have anything to do with an interface. The child is also the parent. So overrides.
No I don't think so... but I'm also still learning terminology so I might "know" what a pointer is, just not that it's called a pointer
What if I only have a parent ref, and I need to access child logic?
Would I interface, cast, or func override?
there's no universal answer to that
Guys I got some error but only when I played in New Editor Window (PIE) , when I play in Selected Wiewport or Simulate there's no errors.
This is weird, right?
:question: is it weird?
:8ball: Signs point to yes.
And I tried standalone and it worked, but I dont know if that's relevant.
we neither if you don't even tell us what error you get
i guess it's not fine, because it clearly has an null access
Why does it not give errors in viewport
A pointer is a memory address. When you construct an object, it gets put in a specific place in memory. To access this object you use a pointer which is basically a number ID of where that object is. You pass this ID around like a phone number because this single ID is much smaller than the object it's pointing to.
A cast is the attempt to change a pointer's type.
Lets say something like a line trace. You line trace and get a hit actor back right? So you line trace and hit a MyPlayerCharacter. This is a child of Character, which is a child of Pawn, which is a child of Actor.
Your pointer from the line trace IS a MyPlayerCharacter, but it is stored in an Actor type pointer. For this reason you cannot access the variables and implementations within MyPlayerCharacter as the code understands this is an Actor. To change that, you attempt to cast it from Actor to MyPlayerCharacter.
You are not changing the object in any way, you are simply saying take this ID and try to access this extra functionality. If the cast succeeds, then this actor was a tyep of MyPlayerCharacter. If the cast fails then the original ID was null or the ID was not pointing to an instance of MyPlayerCharacter.
What is a parent and a child in this case? I took this as a child class of a parent class.
I haven't tested much, but I don't think standalone will popup the failure point in your nodes. Your standalone is still probably failing, you just don't observe it.
Your issue itself is probably sequencing. I'd breakpoint that node while in PIE, you'll see that it's missing a reference that it is expecting. You can then work yourself backwards in the logic and find out where you need to set the ref.
Ok had to read this a couple times... but I think I might understand at least at a basic level (?)
So a pointer is the ID to an object, and so the actor that the line trace is coming from has a pointer, but also the line trace itself has a pointer, and the thing the line trace hits has a pointer... but because the line trace came from an actor, it's also an "actor" and therefore incompatible with a "MyPlayerCharacter" so casting takes the "actor" pointer that the line trace has, and turns it into a "MyPlayerCharacter" pointer?
Kind of. It's an inheritance thing.
Parent is "BP_BuildingParent", child is "BP_Camp"
OtherObject calls makes an interface call to fire logic on BP_BuildingParent, in that logic I need Camp (and only Camp) to do extra logic.
Right now I have a silly check that looks as self's class, and if class = BP_Camp then do extra logic.
My solution works, but I think there's probably a more clean way to do this.
You have a classes that are
Object
Actor
Pawn
Character
MyPlayerCharacter.
Object
Actor
MyCoolRifle
Your MyPlayerCharacter IS an actor. So it can be stored in a pointer of Actor types. MyCoolRife is not a MyPlayerCharacter. So it cannot be stored in pointer types of MyPlayerCharacter, but it can be stored in Actor type pointers.
For this reason you can store both of these in an ACtor pointer. And you can linetrace both of these actors and get them returned in the line trace as an Actor pointer.
If the line trace hit a MyCoolRifle. It will successfully cast to MyCoolRifle. It will fail if you cast to Pawn, Character, or MyPlayerCharacter.
If the line trace hit a MyCoolCharacter. It will successfully cast to Pawn, Character, or MyCoolCharacter. It will fail if you cast to MyCoolRifle
at that moment you can also cast
comparing the class will load the other class anyways (you can see that in the sizemap of your asset)
the real question is why the parent has to invoke the fire() method
sounds like messed up logic
Camp can just override the interface function and call parent, and then do it's own stuff after?
Can you call parent interface functions?
I think that's the play. Didn't really click to me until now.
interface call to fire logic
sounds like IF_FireLogic should be separate
and only implemented on the child
Refactor needed, but I think I understand what needs to be done. Thanks all!
So I want to try this then: let me explain how I'm using my interface and you tell me if there's a better way:
To start in, in my character, there's code to make a line trace and hit an object like so (Image 1) it has one interface with 3 separate functions in it: Click/Drag Done (image 2) which just fires as soon as I let go of LMB, Click/Drag Begin which is the total opposite, so it'll fire as soon as I click, and it'll take what the line trace hit along with it (image 3), and finally there's the main Click/Drag function that'll fire for every tick I'm holding LMB, it'll take two variables that contain floats to represent how my mouse is moving (image 4).
In, what is currently, the only blueprint that will use this interface (I intend to have many more, any and all actors that will have a control that needs to be clicked and dragged) there is the begin click drag where it'll take the hit component and compare it to all the controllers in the actor to see which one I am looking at (Image 5).
Once that is done it'll start taking the variables it's collecting from the main function of the Click/Drag interface and move the corresponding controller (Image 6)
where it'll then process the input given to it and act accordingly through this... monstrosity XD (Image 7)
then once I let go of LMB it'll basically just reset everything (image 8).
Will read that, but also posting this as well in the meantime.
So with casting understood. And knowing that it is practically a free function. It costs basically nothing to cast something at runtime. We move on to linkers.
Linkers are the real reasons people have trouble with casting, and I say that loosely because casting isn't to blame here. Cast nodes have an output of a type. That type is the linker. You can cause linkers either through the blue pointer variables or the purple class variables. When you use either of these types of a specific type in a blueprint, that type needs to be loaded before this blueprint can be.
Note that when I say loaded I mean their CDO, this is Class Default Object. Which I'll go on a tangent to explain. A CDO is an object which Unreal creates once for each class so that it can easily copy it to instantiate new instances of it, and access defaults of. There is one CDO for every single class. No more.
So if ActorA and ActorB both cast to ActorC. This means that when the game loads up, and a map uses ActorA and ActorB, it will load ActorC first, then ActorA or B. When these are fully loaded, a CDO will be created for each, and then long after that they'll be used to make instances of each of them for gameplay reasons. Even though A and B both link to C, C is not loaded or created twice. It is loaded once and has one CDO object.
The reason why this is "bad" is because people do not correctly separate their code and asset classes. You should be free to cast all you like to code classes. Because they're tiny. C++ does this. Literally every single C++ class in the engine and your game is loaded at all times with a CDO. But they're basically free because they're tiny. They link to no assets.
Trying to put this into useful info with some bad scenarios. Consider making a game where you can load into different levels to fight different things. You're on level 7. But your player character tries to cast to some boss on level 4 to do some specific function. That boss in level 4 will remain loaded and in memory in every other level you're in.
That boss likely has special materials/textures/sounds/etc. And these are all kept resident in memory because of that linker to it. There are three ways to break this linker correctly.
The first is to not break encapsulation by casting to the boss in the first place because you need a proper ability and event system... But hey we're short on time so refactors aren't going to happen. Scold the rookie and move on.
The second is an interface. Sure this works here. But interfaces are messy because you have to implement them in literally anything that needs to use them. Copy a ton of code cause usually the use cases are similar, but it can't have it's own state, so you're just copying a bunch of stuff, once per thing that uses this interface.
The last, is to simply move that code to a parent class of the boss and cast to that. The parent should have no linkers to meshes/sounds/textures/etc. The parent class of the boss will remain resident in all levels, sure. But that's okay cause we probably have a boss in most levels that inherit from it, and it's also miniscule in size, so it isn't going to affect our memory costs at all.
Wasn't part of this but I appreciate you and your thorough explanation of this. I learned a bit of new and useful info on this second comment
So the best way to handle things is to have a parent blueprint that has all the common code inside it, then have child blueprints that will all have slight differences....
Sometimes.
Composition is also a powerful tool to use in cases like this. Specially like your interaction above.
what's that?
Use of actor components to compartmentalize logic.
wow, that word really exists...
Have you never heard it before?
Interaction is one of my favorite topics for that case as well. Because there's a lot about interfaces that really limits you in regards to interaction.
Oh yes I did actually watch a video on components recently, had ideas of how to use them too, just haven't gotten that far yet XD
But yeah was totally gonna use them for instances where code was commonly repeated, but in the example I provided, that specific actor, sure there'll be a couple of them, but the differences between them would literally be the contents of a single array and nothing else would share the functionality it holds so I figured it'd be fine without components or child actors
@radiant wren For a classic use case. Consider needing a set of logic that can work for most anything in your game. You need to be able to pick up an object. You need to be able to start using a medieval gate control. You need to be able to start riding a horse.
These three things all need to have varied base classes. You're not going to make a pickup actor be a pawn like a horse, and you're not going to make the gate control a pawn either. You probably don't want to pick up the gate control or horse into your inventory like the pickup actor. You do still need to do the basic job of interacting with every one of them.
You can use an interface. But lets take the gate control and it's gate for starts. What if you have a gate which requires two gate controls to be used at the same time? And you have two gate controls that could be used by up to three people each at a single time?
That is a lot of complex state to manage but it's all identical. Managing users with output. This means that the same interaction component can be used on the gate and it's controls. The gate limits itself to being interactable only by the gate controls, the controls are usable by character pawns, etc. A character interacts with each gate control, the gate control interacts with the gate.
GateActor has the same InteractionComponent as the GateControlActor, just with some different defined settings. Similarly the PickupActor has the same component. So does the HorseActor.
Horse, and Pickup are all instant. GateControl is a hold. Gate is timed to open from fully closed for 30 seconds. More people might speed this up for instance.
Horse and Pickup are single user. GateControl is 1-3 users, Gate is 1-HowManyEverControlsyouWant users.
More importantly, this component can house the states required for all of this interaction such as percentage completed and whatnot. And house generic delegates which it's owning actor can bind to. Which keeps your actor classes a little more clean.
So is this a case for using interfaces, or for using castings? Cause this does sound similar to the purpose I have for my interface which basically is "anything that needs to be controlled via clicking and dragging"
The other interface I started to use might be a bit less necessary as an interface though, cause what the second one does (or is going to do) is, and probably important context for this, my current project is a train simulator, but it'll basically fire whenever the current track instance has ended and is notifying the train to switch to the next spline in the line basically
though still figuring out how I want it to handle doing that
@maiden wadi Would you happen to know a good way of doing that? Basically just as the train travels across the tracks make sure it will switch from one BP instance to the next instead of stopping? Cause I was following this tutorial which covers most of what I need, just with the exception they have just one spline for the whole loop but I'll need multiple for all the many diverging and merging tracks that will exist throughout thousands of miles of tracks: https://www.youtube.com/watch?v=fj66nCsloQY
UE5 - Basit Tren SimΓΌlasyonu Part 1 - Mesh hazΔ±rlama ve Hareket (AltyazΔ±lΔ±)
https://www.youtube.com/playlist?list=PL83GyhfD6TevfGkaXEymMQreI4gC7MLbI
Web Site
https://www.yepkoo.com
Forum Support
https://www.yepkoo.com/community/
Unreal Marketplace Products
https://www.unrealengine.com/marketplace/en-US/profile/Yepkoo
Twitter
https://twitter.com...
As soon as I break through that wall, all of the train movement should run smoothly
Not entirely sure if this is the right channel but redirect me if necessary. I have a normal physics object with a box collision on the mesh (have also tried with complex) it falls through my terrain 60-70% of the time when I drop it or spawn it in some manner generally, or even just when the game begins and its in the air. If I move a mesh under it, it will not fall through it at all. Just terrain. Is there a setting somewhere people are aware of to sort this kind of issue?
Technically neither. Composition largely requires simply getting the component from it's actor level pointer. Actor class tracks it's owned components. So there's rarely much casting involved except to the interaction component itself. The component notifies it's owners via delegates, the owner can use the component directly since it's within them, code accessing it usually relies on getting it from it's owner via GetComponentByClass or similar.
wait components can be used to communicate between two actors? I thought they just added a commonly used set of functionality to something
so you didn't have to copy and paste
Kind of. Like your mouse interaction will get a hit actor from the trace. You already understand that you can either cast to this actor to call a function, or run an interface event which runs a function. Both run on the actor itself.
You could instead get a component on the actor and call a function on the component, which can do things internally based on the parameters you set on it and then it'll run delegates which it's owning actor can use to do things.
Out of curiosity, how big is the thing simulating physics? Like in mm.
@maiden wadi mmm. going by the scale in the mesh view, 4x27x34. Its an armour plate so whatever size that would be relative to the player. Not big at all. if thats not the measurement you want them im not sure π
Ok so it'd be like the interface (or casting) talks to the other actor, says "hey, I'm interacting with you" and (say it's something to be picked up) the component will be like "alright, so pick me up" and so that "pick me up" function is what is contained in the component rather than having that code copied between everything that can be picked up
that is helpful for simple things, but not for more complex things that can be interacted with in many different ways via the interface
I found a random post from almost a decade ago that has recent responses. TLDR something about setting landscape collision thickness?
Yeh Im seeing the collision thickness posts but I cant find anything showing me where to find that setting. I cant find it anywhere
I should also mention for the sake of it that CCD is not an option in this case
idk if that screenshot will help... but I figured it might so I went ahead with it XD
ah :/
yeh π
expand the collision presets, see what that does
I'm going to throw a fucking party if Epic ever actually deprecates that shit class and makes a real landscape alternative.
?
nothing new in the presets, just standard ticks all set to block
ah...
nightmare
Is it possible to set the curve tangent value manually ?
such a small but huge issue.
How accurate does the collision on the object that keeps falling through need to be?
Cause if you make the collision larger than the actual object, large enough to stop falling, it might work
Right now its just a box, ive tried more complex but still the same. its not a complicated object shape so accurate enough to stop it falling through is fine but a capsule isnt ideal
cant have a rolling armour plate
Try making the box collision bigger
start ridiculously big just to see if it'll ever stop falling to begin with, then if it doesn't fall, go back down to small, then start inching up until it stops falling
the size of the collision definitely helps. Seems to hardly if at all fall. I guess Ill have to inch down cos its floating a bit π
ye, there'll probably be some compromise with that solution.... but it works XD
at least for the time being
until a better solution can be found
yeh itll have to do, hopefully I dont have this issue with more complicated things but Im satisfied for a while π
Appreciate the help!
get it together Unreal with your damn landscapes
XD
π
oooo
Maybe. I'm not convinced yet. But having to work with stuff that is procedurally generated. ALandscape is either a nightmare or useless.
You don't like procedural generation?
I love it. ALandscape doesn't.
It's the Actor which houses Landscape code, yeah.
oh so the landscape is also an actor huh XD?
In code Actors names are prefixed with A. So Landscape. ALandscape.
I kinda figured landscapes were just their own thing
Pretty much everything in unreal is an Actor and a Component of some kind.
I see...
UE is basically Shakespeare. Everything's an actor and all the world's a stage.
XD
And the stage can have multiple stages too. Just for fun. π
stage-ception
But no. Landscape is great if you want a basic level that is handcrafted. Sure. But once you leave the editor, it's basically just another static mesh. It isn't really editable at runtime. All of it's edit code is editor only and compiled out in cooked builds.
Interesting.... so you can't add a digging mechanic to landscape? Meaning all the games that have such a feature don't use landscapes?
You absolutely cannot.
I see... then that makes this a whole lot more impressive: https://www.reddit.com/r/UnrealEngine5/comments/1epvlej/rts_prototype_trench_system/
They're using the voxel plugin
ah
With how popular the voxel plugin is Epic should just pay those guys to make it an engine feature 
heh
everything should be a feature π
make Unreal the "do it all" engine XD
even more so than it already is that is...
π I've said multiple times that Epic should buy out Phy and make voxels the default.
anyone know a thread safe alternative?
Does anybody know why my print string text gets hidden until I restart the editor? Feels like this happens a few times per week and it's driving me nuts.
hey folks, short and simple - how would i disable Mouse Inputs ONLY in a blueprint?
unplug mouse
what do you mean by "in a blueprint"? as opposed to UI?
You shouldn't be listening to input across multiple blueprint, that's considered bad practice and hard to debug
Common way I find new people doing the wrong doing is like hanlding the input in the door blueprint
Ah heard, I just wanna disable right and left click while an animation plays in blueprint!
Unless you play with C++, the only way via Blueprints that I know of is to use disable input which will disable input from all devices, not just mouse.
or
Set Ignore Look Input which you get from the Player Controller which disables the mouse look input for the specified player controller.
I don't π¦
Does ignore look input also ignore the clickies?
switch input mapping contexts
It does not ignore clickies as far as I know.
I think its purely for mouse movement.
assuming Enhanced Input. for the duration of animation, remove default context and put in one without mouse movement defined
Ooooh. A node I've not seen before. I must google it.
You can add boolean on your input action, a macro that checks if input are allowed to be actioned.
Something like , bIsInInventory, bInCinematic, bAttacking, etc
Mars.
Thanks.
Well, everyone but you know what I mean
Cute Red Panda picture π
I think removing the whole mapping context is not of the best interest for not allowing input during animation states or other business
you can do what ever you want, it's your design. But I personally don't see the point.
I do think that UE is still a bit limited in input controls. Wish they would add some more extra control over it but there is such a thing as too much control.
I didn't even think about booling π€¦ββοΈ
This is why we should take breaks during dev seshes.
What's a break?
Don't fall into else if ladder, have 1 macro that cheks for all the condition
Oh wait. It's that thing where you put on a node as you step through and you want to stop on it.
I.. Yes. I think so c
Red Pandas are awesome. I don't care what anyone says.
Are there any plugins that add extra functionality for inputs with blueprints?
Cold summer do be rocking that panda
i have a building made of many modular bits, and I think that instancing the modular bits through instanced static meshes is the way to go, right? In that case, is there a way to convert hand placed meshes into an instance static mesh?
thanks a lot! and how would it work to then put that into a blueprint? Is the correct workflow to just copy and paste the newly created ism from the level into the blueprint, or is there a better way?
the buildings have interactable pieces so i would need to bring these isms into bps
Hey! Pretty new to Unreal. I'm having a hard time wrapping my head around this. It's a sprite based parallax background. Each layer needs a different speed (Layer Speed) that it ramps up to when a custom event triggers. (right now it's connected to BeginPlay for testing) How do I set specific values for the Layer Speed for each item in the array?
There are also several sets of sprites for each layer that need to change based on the value of a variable. How would I go about modifying those created Dynamic Parallax Mats individually? Do I create another array of the Dynamic Material Instances, and send them through another For Each Loop within that loop to change the sprites? Then how can I input the value of Layer Speed variable for each layer?
you might want to split static stuff from interactable stuff
the way i was hoping to set it up would be to have the static stuff as ism, and the interactable stuff as individual bits
but both residing in 1 blueprint
maybe Merge Actor Settings can help with that
but copying might work too π€
as instances are just an array inside ISMC @hallow compass
@heady lantern ignore my last message. Use a map instead of an array. It can hold 2 variables in each index.
1 variable is your instance, the other the speed.
@empty marten Can the For Each Loop accept maps? I haven't used them, so I'll have to figure that out.
thinking
I don't think they can actually now that you've said that...
Let me get UE open. I'm working off corrupt memory atm XD
Just tested, they cannot. Neither can structs, lol
Map>Get Keys>For Each
No worries!
Ah, does it keep the proper reference to the sprite objects?
^^ This
You're quicker than me XD
Shots fired
Hmmm..
I saw that message ColdSummer lol
nvm, I think iterating through keys are totally fine, I just don't get why we are iterating the values
different material instances require different speeds.
To quote FairTech " It's a sprite based parallax background. Each layer needs a different speed (Layer Speed) that it ramps up to when a custom event triggers."
how to make a component use variables of a parent, and call some functions at parent?
If I have a maximum of 10 layers, am I better off just making separate material instances for them?
I see what @versed sun is showing, but I'm not entirely sure how to implement it.
have a reference to parent or use an interface (if the parent won't always be the same thing)
there should be get owner?
ok I will try to understand how to
im not sure what you are doing , sound like changing a speed on a sprite/ texture/material?
If you have a list of Sprites, and want to change each one uniformly, i think this would be a good start
I think that last node just sets the entire map to that one key/value pair. I think ADD is what you want. Since there can only be one of each key it just overwrites the value
that seems like the worst crime ever committed to a map XD
Hey, what'd be the better way of adding a ! on top of an actor in game, Widgets or a flat plane that points to the player camera at all times?
Assuming I want it to become active within player proximity
the flat plane would be the same as showing 3D widget
Hm, so just making a widget that is just an image and assign it to the actor?
Thought that sounded so simple it was a trap
Ohh, okay. I think the added nodes helped me understand a bit better. The Layer Speed variable is hooked up to the texture coordinates for scrolling, it controls the speed of the scrolling texture. Each layer needs a different speed to appear further away. I initially set it up this way because I thought I could change it in the object settings of the sprite inside of a blueprint, but that only works if the object is a blueprint itself. So now I have to figure out Dynamic Material Instances
i think widget is overkill
It probably is, I just need something basic to prompt the player to press a button to interact.
Anything that displays the image should work
Make a material with the texture image , and put it on a plane
Make material 2 sided , or rotate it to camera
there are billboards
^ even better
like this?
and I use the interface to do the damage function?
Billboards? Never used them, seems like a good chance
don't use interface if you are using component
Thank you for the tips
you rarely need to use interface imo, most of the time component does the job
okay
ty
What about actor to actor communication?
what about it
you use interface when you want to communicate between classes that doesn't share the same base class
I used interfaces for stuff like... For example a montage notify setting variables and parameters of an actor's components for gameplay purposes.
Not really, interface is not a replacement for casting
u can just fire the interface and let each of them handle it their own way
this is myth that been prepetuated from youtube
Frankly I don't know enough to say I prefer interfaces
If you are replacing casting with interface you are shooting your self in the foot
For all I know, the mechanics I'm doing could be doable with casting and not interfaces
Interfaces just have the virtue of being cleaner, and occasionally doubling as actor tags if set up properly
wdym? I am refering to multiple casts like in the image; it's faster to do an interface call than multiple casts
people that tries to avoid cast and replace it with interface, at the end of the day they will get a ref to the other blueprint when they need to pull the data from, so they still get loaded to memory.
Not to mention that this will make debugging a nightmare
Why do you ever need to do multiple cast?
you are casting an object, you should just cast to your target type
cast is just a type check
look into inheritance for more info I suppose
Yeah I know that, I mean how to do things with casts that I do with interfaces currently
Perhaps the image was ambiguos; what I meant; is if you want 3 different things to happen for 3 different object types.
Instead of doing that image of 3 casts and all that.
You simply fire interface; and let each object handle the function in their own way.
cast and interface is apple and orange, DO NOT replace casting with interface
For example I have a bomb in my game, which uses interfaces to make any valid actors it touches run an "explode" function.
well I'm not sure what the image is about, don't see why people do nested casting
might as well just create a base class at this point
it looks like design problem to me
I would feel lke this use case of interfaces is redundant from what you said
I mean there are reasons why interfaces exist; though I get it; I personally rarely use them
They have their uses
In contrast, the Interface I made that connects Anim Notifies with Character class Actors IS indeed a valid use case for Interfaces, if I understood correctly?
It's used to communicate between classes that does not share the same base class
but personally if it gets anymore complex, I would use component instead
how so? I can have ref to other object and call its function. same it can call mine. no need for base class. what does having interface change here?
It can be used for many things; though the most preavalent imo is to be able to allow each object type to handle it differently.
You can also get that through parent classes but smtms it's not applicable.
huh that may be useful
I want the bullets to destroy themselves after overlapping walls or people to not multi-hit someone with a single bullet
if that's a projectile you want to handle that in the bullet it self
Hm, I would like to know what's the right way to communicate between classes without interfaces
just get a ref to it?
depend on the context really
how do I get owner's variables and set them?
communicating between classes is as easy as just having a reference to that object as that class.
Then directly calling stuff on them.
It only gets complicated if your game is big and you don't want every single class to be loaded at once.
An example could be enemy classes; say you have 100 enemies; you don't want all of them to be loaded at once.
I think it boils down to mapping your game so to speak and figuring out what things need to be loaded at once and which don't so to speak.
You can divide stuff into classes that must always be loaded and classes that should circumstantially be loaded.
Among those that must always be loaded; there's no reason not to have hard references to the classes themselves and have communication be ez pz.
THe rest would just be having stuff be easier for you when it comes to making stuff.
Like making -making enemies- as easy as it can be, as intuitive, etc.
Stuff like having simply variables like -damage- -range-
Or simple functions like -attack- which you can use to make developing the game easier
you have to cast, GetOwner returns a generic Actor class
I might have to clarify things
it is a damagesystem
both for calculating damage and notifying the bullet that it hit something destroyable
and when I try to get owner of the damagesystem it didn't work
as much as possible you don't want to couple the component with a specific actor, the more things you can decouple, the more flexible it can be
the variable type is the Class it's cast to.
TO access variables or anything that exists in that class you need the reference to be cast to that class.
it's what you get when you hover over an object reference
in that case -Timeline Component- is the class
If you hover over that and it says actor; means it's cast to the actor class.
That means you can only access stuff that exist in the base actor class.
Anything you have created is exclusive to your custom class.
GetOwner returns the owner of the actor component
seeing the first picture I just think you are not understanding references
Suppose I have a component inside my Character.
If I have a code inside the TargetComponent that calls for GetOwner,
If PlayerCharacter->TargetingComponent initiated the call
The owner would be my PlayerCharacter
Get owner will return instance that OWNS the compoennt
For example in the left there is my Missile reference but it's cast to the Actor Class, as it says there.
On the right I am using the cast node to cast it to my Missile class.
It's the same reference; but now I can access stuff that's exclusive to my Missile class.
the getowner function when run under an instance's component, should return the instance right?
In that example you cannot connect them because DamageSystem is not a child of Actor.
The object in the left is of class DamageSystem; the required object on the right is of class Actor.
DamageSystem is a child class of something which at its root isn't actor; all classes have a hierarchy like that.
When hovering over your custom class in the content browser you can see its hierarchy
I actually don't know how to see the full hieerarchy XD
did that hepp uwu?
this?
so should I have created a parent class from the start?
That's not the issue right now though
ActorComponent is a different class than Actor
both children of Object so to speak
parent actor then?
You can get owner of ActorComponent as well; but that node is getting the owner of an actor; so you just need a different node
YOu can drag a variable and while dragging type what you are looking for
So for example an explosion can cast to objects overlapping a sphere collider of class X (any actor most likely) and send data to them?
ye
All functions have that -target- thingy that lets you call them on any object you have a reference to;
As long as the reference is connected; and the class of the reference matches
Actor component is an entity you attach to actor
An actor is an object that can be placed to the world
Imo rather than trying to do your system right now, you better off learning the concept of inheritance and references.
Once it click you can apply that to all your other problem that would have arose from not understanding them.
Right. I'm not really an excellent programmer, I have a lot to learn...
Like the reference way is definetly ideal for this bomb thing I have
@violet bison My msg was to
Bombs are a player ability, so they will always be in the same level together
I know
Just for clarity though, would I have to create a new function that is inherited by all actors of such class?
All you need is a reference to the obj and for that reference to be the class you need
or event; or you could also manipulate variables of that class directly if not private; but generally speaking the former is better.
Yeah it could be a bit tricky since I need the bomb to interact with 2 different classes
In that case interfaces could be better; depends on what those 2 different classes are though; are they totally different
Cuz if it's a thing like enemy and ally; they could have the same parent class
for example
They are both actors: One is a static, breakable obstacle, the other is a dynamic actor that may have a movement component or basic AI, or gets constantly moved around in specific ways and patterns by default without on the fly changes to it.
They are both actors, but one may be a pawn and they other may not.
in that scenario an interface could be a good approach; but it still depends exactly how you are handling it
