#blueprint
1 messages ยท Page 361 of 1
so it's literally jsut for visual objects and cannot be used if I have something that can be clicked on etc.
each actor should register itself, display it's static mesh in ISM component, but have separate logic for something that detects the collisions for clicking on it? maybe this Instanced Actor will be what I need
Depends how you build it. I made a simple mine with HISM at one point (it is an expanded version of ISM, allowing for some individualism on the meshes) - eahc block in the mine was an instance of the HISM and I was passing to the actor holding them a reference to which one was hit, and the actor was holding all the data what was supposed to drop from it
Sort of yea. You can do a little with it but one method I've tried before is swapping out an instance for an actor when the player is looking at it.
I believe the Instance Actors does something similiar based on distance. (Not looked in to it though)
I mean, if you end up with just 1 instance per ISMC on each Actor, then you might as well not use an ISMC here. So having a central Actor with a central ISMC that allows adding/removing instances would be the better way.
Iirc UE does already convert some meshes into ISMCs when cooking/packaging, but don't have a source at hand.
that's rough since imagine top down game with a building, you want the player to see reaction exactly as you hover over it's mesh, right? not some collision that isn't exactly the building shape or is smaller or bigger?
I think you're right but only for the 'static mesh actors' you get when you just place just a mesh in the level.
What does that have to do with ISMC though?
They still have collision and Materials allow per instance data.
so the actor still can access the instance it added to the ''manager' actor that has the component?
So it's not like 1 ISMC means you always interact with a solid piece that consists of all instances.
Well yeah, you gotta code that boilerplate setup of course.
That Manager might also want more than one component and add/remove them dynamically, as one component means one mesh asset.
I believe OnHit event has a value for the index of the ISM part that was hit if you ever need that
Yeah it does. One just has to then route that back to the right actor.
oh that's interesting, i have to test that then
And for hover effects, or outlines or stuff like that, one should be able to use the per instance data in materials.
But I'm not a material person.
Just be aware adding and removing instances can change the indexes so you can't normally store them.
I've done this by having a hover actor that gets the mesh from the ISM and places it in the same place.
I also can have 1 manager ith like 3 instances component and then each thing find the component it needs to 'add' itself to?
If you have a Mapping between Mesh Asset and ISMC, sure. Again, up to you to code the boilerplate for this.
I think I have an old tutorial that does this. ๐ Granted I'd probably do it differently today but it might give you some ideas if your interested.
Ill take a lot, thanks!
Relatively sure they added something for that.
I would need to read the code once more but there is a mapping between the index and Ids.
If you get a moment to point me in the direction for that, I would be grateful.
Let me just find it.
/**
* Preliminary ID-based interface. May only be used if no other manipulations are performed that cause invalidation of IDs. For example, cannot be used on HISM.
* ISMs edited in the editor can also not reliably be used, as some editor changes cause ID tracking to be lost.
*/
/**
*/
ENGINE_API TArray<FPrimitiveInstanceId> AddInstancesById(const TArrayView<const FTransform>& InstanceTransforms, bool bWorldSpace = false, bool bUpdateNavigation = true);
ENGINE_API FPrimitiveInstanceId AddInstanceById(const FTransform& InstanceTransforms, bool bWorldSpace = false);
/**
*/
ENGINE_API void SetCustomDataById(const TArrayView<const FPrimitiveInstanceId> &InstanceIds, TArrayView<const float> CustomDataFloats);
inline void SetCustomDataById(FPrimitiveInstanceId InstanceId, TArrayView<const float> CustomDataFloats) { SetCustomDataById(MakeArrayView(&InstanceId, 1), CustomDataFloats); }
ENGINE_API void SetCustomDataValueById(FPrimitiveInstanceId InstanceId, int32 CustomDataIndex, float CustomDataValue);
/**
*/
ENGINE_API virtual void RemoveInstancesById(const TArrayView<const FPrimitiveInstanceId> &InstanceIds, bool bUpdateNavigation = true);
inline void RemoveInstanceById(FPrimitiveInstanceId InstanceId) { RemoveInstancesById(MakeArrayView(&InstanceId, 1)); }
/**
*/
ENGINE_API void UpdateInstanceTransformById(FPrimitiveInstanceId InstanceId, const FTransform& NewInstanceTransform, bool bWorldSpace=false, bool bTeleport=false);
/**
*/
ENGINE_API void SetPreviousTransformById(FPrimitiveInstanceId InstanceId, const FTransform& NewPrevInstanceTransform, bool bWorldSpace=false);
/**
*/
ENGINE_API bool IsValidId(FPrimitiveInstanceId InstanceId);
/** Fetches current instance index for a given InstanceId */
FORCEINLINE int32 GetInstanceIndexForId(FPrimitiveInstanceId InstanceId) const { return PrimitiveInstanceDataManager.IdToIndex(InstanceId); }
This one, it's for a maze generator but you should be able to ignore that part. Again it's old and I would do many things differently today. (Using soft refs for the keys for example)
I show you how to spawn is meshes for the maze walls using instances meshes.
This video is a continuation of my maze generation tutorial.
In part 1 I show you how to generate the data we will use to spawn in the meshes. If you haven't already, you can watch it at the link below.
Part 1: https://youtu.be/Q4aAGLBqnsc
Everything in this tutoria...
I guess half of this api is not avaliable in blueprints?
I managed to quickly prototype just adding instance of X static mesh at X location (each actor calls to manager), but how can I somehow return the instance reference back to the actor that requested adding it to manager?
The stuff eXi shared looks like its C++ only.
Okay, so before I dive into that. I'm gonna be able to do that when this Instance got hit by something(line trace let's say) to call to the Actor that added that instance in the first place?
You can add an output on the AddInstace function that returns it. Just be aware that it might not line up to the right one if an instance is removed.
yeah I would probably create some TMap with ActorRequesting - Static Mesh Instance so they it can be pointed toward the c orrect one, but is this even possible what I need to happen?
Possibly, you could have an array that stores the relevant actor at the same index. If you remove from the ISM, you remove the same index from the other array.
Hmm, other way would be maybe to add the mesh to render under the ISM component (in manager), but have collision of the shape of the mesh so it works 'on actor' ?
I guess my question would be if having Static Mesh but render Hidden In Game makes it not have draw calls?
Huh. I think in my mine project I was storing the data related to the instance in the Vector -> Struct map, where the vector was the location of the Instance. So I didn't even know you can't rely on the IDs when adding/removing lol
Being hidden means it won't be rendered. (no draw call from it)
I've done something similar before but as an int vector to help mitigate floating point errors. I never liked this method though. ๐
Kevin has been slacking. ๐ I love finding this type of stuff. ๐คฃ
gg then, it's gonna be exactly what I need
render in manager, leave logic in the actor
Whats the end goal? As in what are the actors and what would they be doing?
So they are resources in rts game, so you need to be able to select them or click on the to send workers etc.
and I will probably do the same with buildings but just have buildings manager
Its so much fun to create rts games
Very satisfying when the ai does what its supposed to ๐
do you have experience with that? ๐
Just with prototypes
https://www.youtube.com/watch?v=rjAjsPCga4w&t=1
A few years ago i created a prototype for every genre that interested me and rts were the most fun to make
The very first preview version of a game that im working on "Hail to the King"
It currently has this features
Basic unit interactions -
Workers can get assigned to buildings, gather resources and bring them back.
A worker can get assigned to the warehouse and detect when a building is full he will then proceed to collect the resources and ad...
omg im dying hahah, the voice lines
love it, would play 10/10 ๐
Your code is saying to not apply a radial impulse of radius 0 to nothing
the rare triple negative
it's doing nothing in 3 different ways, at least.
10 is a tiny velocity
assuming the strength = velocity change with those settings
10 is 10 cm/sec
not very fast
try 10,000
then turn it down if that's a bit much
btw draw debug point at ImpactPoint to make sure it's even hitting where you expect
i did this and the cube disappeared Xd
okay, i guess it works now.
thanks man
My goal is to trigger the fracture in fractured meshes but i think this is not the way it seems.
AFAIK strain is what does the fracturing
Never done destruction but I've done a ton of rigid body physics
I've got this physics enabled cube that can smash through fracture
and I can push it with impulse
but impulse does nothing to the fractured objects
say, is there an alternative way to maybe do this without destruction
I'm doing a stress-relief type of game where you can smash the office props
nah destruction is what you want for that
hah alright!
Back up and get the basics down, make aiming at a thing and clicking the button bust it apart
I can throw the cube and it can smash through anything. It seems i'm close to the objective :-) Thanks!
Is there a way to know why that node fail ?
In blueprints - I don't think so. From a quick look C++ PathFollowingComponent has some more stuff but I don't see a way to access it via blueprints
https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/AIModule/EPathFollowingResult__Type
i see it's aborted.. but don't know why
Also I'm not sure if it would be visible in the AI Debugger but you can try to open it during PIE and look if there is any relevant information there
but i think i know why, i have there error : NAVMESH NEEDS TO BE REBUILD..
but i don't know how, first time i have that error
Iโve been experimenting with SceneCapture2Dโs and RenderTargets recently and keep running into this same problem. Every time I try to capture a scene to a RenderTarget, the final image always ends up darker/higher in contrast than it should. For example: This is the view from the player camera This is the captured image After hours of f...
Can anyone give some advice on this problem? seems so simple but its making me crazy
Hey everyone. I have a random but important question that is related to Unreal Engine. I've been using the engine for almost a year and I freaking love it. As I learn, I've encountered one major obstacle that's been the bane of my existence. I don't know how to program and I was drawn to Unreal Engine because of Blueprints. I love that about the engine but I learned that if I use any plugins that have C++ classes, I can't package and compile a project. This has really limited me and I've tried for months to figure out how to properly install and connect Visual Studio for Unreal Engine but it's been difficult, to say the least. YouTube videos and other people on forums haven't been that helpful and I know it's a lot to ask, but it would be amazing if there is someone who is willing to guide me with the set up of Visual Studio for Unreal Engine. I want to do so much with this engine but the technical and programming stuff are not my strongest suit.
Hey guys quick question, anyone or have experienced this thing? : i added double jump to my character and its working without problems, the only problem is that if my character walk off from a ledge, the jump max count go from 0 to 2 without let me do double jump
I dont know how to fix it
happened to me once, and got fixed on its own after I restarted the unreal editor, if that doesnt work removing the navmesh and adding a new one should work
nothing, restart, delete
nothing solve the issue
So I've run into this weird thing where I can plug my component variable into destroy component but not into "play animation" are there any nodes I could use to plug my component into play animation?
you would have to change the variable type to skeletal mesh component
right now it's likely a actor component or scene component variable (which is why one node accepts it, but not the other)
Yup that fixed it got that part working ๐
Hey all !
I'm trying to call the same event with a "Delay" to Destroy Components
But each time I call the "Delay", it stops the preivous one..
Anyone knows a way to "Delay" multiple times without overriding previous ?
(I need to pass the "Component" parameter)
I mean it's like I want to "stack" some events and execute them one by one after a delay
For example : If I press "U" fast, multiple times, it should executes an event each time I pressed the "U" key but each one after its own delay without interrupting the previous ones
I don't know if I explain it well
Make an array of components to destroy. When you want to destroy a component, add it to the list.
You wanna use timer nodes for this next part. When you first add a component to the list of comps to destroy, start a looping timer with your desired delay. Each time the timer event goes off, take the first component to destroy out of the array and destroy it. Check if the array is empty, and if it is, you can cancel the timer.
To cancel the timer, save its handle to a variable. If you have the handle as a variable, you can check the timer handle when you add a component to be destroyed- when it already is valid you donโt have to set it
Try your hand at this setup, and share the implementation in this channel if anything isnโt working
guys i am new to ue can you tell how i can use motion warping to get the rotation facing my enemy
i want this for my character blocking state help me
some time it work and somtime not
ignore background music ๐
Watch 2nd pin video to learn how to use bp comms and set refs properly
bro i want that motion warping thing can you help please
does anyone know why I have this issue with replication:
If I have a character BP enemy that turns into a ragdoll when I shoot it, after I shoot it a couple times once it's already a ragdoll, it's position won't replicate when it moves around from being shot, but if I grab it and move it around it will replicate perfectly
if I have an actor BP, with the same exact logic, it will replicate perfectly
is there a specific difference between character bp and actor bp when it comes to replication?
Maybe someone on #multiplayer could answer better but I think replicating physics is a separate checkbox on the components? Maybe you don't have it set up properly.
all the checkboxes and settings are exacty the same. I posted in multiplayer, thanks, I missed that channel
try to Build -> BuildPaths or click P and see what is happening with your nav mesh
Itโs the same
And the message is also with the P
did you try to remove ravcast mesh and nav bounds? and the P is just for displaying nav mesh so if you don't see it as green over landscape it means it's not generating
did you maybe change some collisions with landscape?
will check but it's just a normal cubes
they should block pawn I believe
it block everything
it's the first time i have that error
i alsways use normal UE block
to build the map, and it the first time the nav bound give me that error
Sometimes the navmesh just dies. Delete the recastnavmesh actor that should be in the level. (Keep the nav mesh volume) Once done, rebuild your paths. This should generate a new recastnavmesh.
Just be aware that the recast nav mesh will use the default nav mesh settings.
thanks!!!
there is a plugin that links visual studio directly to UE otherwise you can directly open the project in Visual studio
That's good to know
guys pls explain me what is this bp? or how to get it
how to add a custom event?
just right click in the event graph and you'll find it
where
or how to add a custom event here
i can only add a new graph
then?
sure
you have made an event named CustomEvent and now can call it whenever you want
but its other bp?
So you need to cast to it
Or set up an blueprint interface
look, its a blue and text in bot
oh idk how to do it
Type it in again in the sesrch bar
type what?
The name of your Custom Event
You already added it?
Right there
The blue things task is to trigger red thing
yea i added but i deleted it bcs its not similar that bp in photo
"Headbob" isnt a function
You have to programm it yourself
In UE you have the ability to create these blue things and fill them with your own code
but i checked a video in yt where is guy explain how to add a camera shake, then when he opens first charachter bp it already have a 2 blueprints
Then he made them beforehand
but how i can add this by myself?
You code it
Watch tutorials
Go in the Web and Research code
Learn the language
FAB - https://www.fab.com/listings/e629276a-017c-4c12-a508-185daa029448
Gumroad: https://erementalstudios.gumroad.com/l/VHSproject
Discord - https://discord.gg/VsXzFn4BJa
!If you want any further help join my Discord!
Make a Realistic Head Bobbing Effect in UE5 (First Person)
exactly i do by this video, but when he goes to blueprint of character, here a blueprint named head bobbing, how i can add this blueprint?
or this not this video that i use as reference
wait i will send a reference
Hope you enjoyed the video!
FAB - https://www.fab.com/listings/e629276a-017c-4c12-a508-185daa029448
Discord - https://discord.gg/VsXzFn4BJa
Gumroad - https://erementalstudios.gumroad.com FAB - https://www.fab.com/portal/listings/e877e356-a20f-4dab-9a6a-92fad3b0440d/preview?from=listings_list
Discor...
im not gonna watch trough a 10 minute video to find what function he is using sorry ....
i will send a picture
this things already exist when he opens a blueprint of the character
Well then its a garbage tutorial
same opinion) but.. guys in comments dont asking โwhat is this blueprintโ, this thing make me watch this video 10 times..
Its a custom made function, he made this off screen
It is what it is. Everyone can make a tutorial, even when they are not good at it
Probably the video was recorded as part of a series
If you want a realistic head bob just attach the camera to the head bone. ๐ (There are pros and cons to this)
Alternatively, you can use camera shake objects and have different ones for idle, walk and run.
My flipbook is being set to "no looping" after un-idling - what am i missing here ? The "lay down" / go to sleep is also not being played on a second time
edit: the comment is hiding "set idle time to 0"
Hey guys, Im having an issue with Dlss and fsr. I have a settings menu that correctly switches between fsr and dlss and makes sure that one is off for the other to work. In terms of frame gen only dlss frame gen is working... checking in dev packaged build shows that all the cvars are applied correctly and therefore should be working (dlss frame gen is off and fsr frame gen is on) would anyone be able to help with this stupid issue?
I have this Widget BP where when the Intger Reaches X number it opens the next level it works for that part
but it ignores the has ticked Boolean and open over & over again
I know the Has Ticked? Boolean works because if I switch out the Open Level (by name) for a Print String it will only fire once
so is there a way for the Open level to only be fired once using the event tick
By default everything that is part of the level is destroyed when changing levels. So most likely you changing the variable doesn't transfer over to the next level, since the Widget is remade from scratch.
Also don't do critical logic in widgets.
You already have the variable on the GameInstance, why not handle level loading through the game instance?
I already had the To Text setup where it shows the intger number on screen but if the level switching part will work somewhere else i will try that
Thank You
It can work in widgets, but a good practice is to leave widgets out of logic and use them only for displaying stuff.
The problem here though is that you use a variable from the GameInstance - GameInstance is special because it doesn't reset between levels - and then use it to determine level change in the widget that is reset each time level loads.
So the Set HasTickedOnce basically doesn't do anything.
And since you use the value from the game instance, the next time this widget is created and ticks, the value in the game instance is the same but the HasTickedOnce is back to being false
little math question
I'm not sure I understand what you are asking about here
well the timer value desides projectile speed
the lower the tick the faster it goes
i just want to make it easier to use
because Speed base value is 1
i dont want to invert the upgrade process
like 1 +10% is 1.1
makes Timer go actually slower
1 - (1*10%)
or x - (x*10%) if you always want to take current that you apply 10% to
<@&213101288538374145> 
100% cooldown reduction is 100% cooldown reduction, no? ๐
you can clamp with it beeing 0.001 if you want
so it won't go to 0 but won't go even less
nah its like proj speed is 1 , and 2 isnt the max
if you take 1 (1- x % ) always and x% is 10% then it's gonna take 10 reductions to go to 0
hi, someone can look at #metahumans
Time = BaseTime / Speed
if the thing is meant to take 5 seconds and you have a speed of 2 (100% bonus) then your time will be 2.5 seconds
if you intend your stat bonuses to be as percentage, i.e. 30 bonus speed is a 1.3x on your speed stat, then do it like:
Time = BaseTime / ((1 + Bonus)*0.01)
I'd normalize everything to a 1.0 base.
A speed of 1.0 means normal speed, unmodified.
Then it can just be Time = BaseTime / Speed
I'm still not sure what he tries to do, but here is my old fire rate script, maybe it will help. The return goes into a timer as well
You can display whatever you want but at the end of the day the Speed stat should be some float from 0 to infinity
can someone tell me im an idiot and tell me what ive missed ? ^^
Anyone have any idea why Vehicle Movement Component is acting different in packaged build versus the editor?
Seeing a drop in movement by almost 60-70%, checked FPS and other typical differences but didn't see anything on that front
Does any of your code depend on frame delta seconds?
Don't believe so, It's the default unreal engine vehicle template. I've only modified some of the parameters they exposed, no custom logic or so
Hello
Is anyone knowledgable about widget and how widgets are focused? I am able to get the widget on my screen, but the widget is not focused as the key down override never executes. The "key down" is an overridable function i implemented in the widget.
<@&213101288538374145>
Nice scam
Hello ๐
I hope someone can help me out as I cannot find a solution to my issue.
I have a packaged game on Steam which has co-op elements.
I am currently running into an issue where I am not able to normally start up a round in coop with 2-3 players.
Loading into the lobby works fine for host and clients. As soon as I start the gameplay map, either all players or all except the host receive a "Fatal Error" message and the game crashes.
I think it used to work fine but does not work anymore nowadays, even though I believe I have not touched anything regard the multiplayer logic in BP.
Could someone help me out? It would be greatly appreciated!
I launch the game here when the host presses the launch button.
Image 2: Here is the Server Travel logic.
Image 3: This is the game manager in the new map which then does logic stuff.
Thanks!
Hye guys, is anyone else having problems downloading android studio? I cant open the link. Does anybody know how to fix this|
https://developer.android.com/studio
Any idea on this one?
You can make a parent ABP with the events you need.
But you can also just make the ABP itself bind to Character's movement mode and callbacks for Landing or Apex Reached, etc. Your Actor shouldn't have to tell the ABP what to do usually. The ABP should be able to bind stuff it needs to function independently.
The crash in question would also be helpful. Not immediately obvious what the crash is about. It may not even be related to the code you've shared.
Yeah, I am not able to find the crash logs. Since it is already distributed on Steam I have no idea where it is.. I thought maybe appdata but the logs folder is empty.
Is this a 3D world space widget, or a screenspace one?
Check your game's installed directory's saved folder too.
EG
steamapps\common\Atre Dominance Wars\DominanceTOE\Saved\Crashes
Do you have an example? Im not able to get anything in this blueprint / owner pathing to bind to animation apex.
Maybe this? However it is not in the steamapps folder.
I have this in a crashes folder in appdata, but this does not tell me much
Check the XML. Search for a <CallStack> and hope it has something there.
Does not make much sense, they all look similar
I misread this as being the jump apex, not an animation. what is your use case with this? I'm still leaning towards the template animbp.
I have an anntack animation that casts a spell (projecticle object) when this notify is called with a notify. It needs to know what mesh/ animation to play when the notify is called. As of right now, it only works for one type of model/ mesh.
Rough. Not sure what causes those to show. But you'll need to find a callstack somehow for the crash.
You mean like a hit montage? React to the projectile hitting them?
I have this one which says true in isCrashed, but it just says GameThread. Not even sure if that reallly is the issue.
You're looking for things more like this where you know what the last function was that caused the actual crash.
I fear I somehow don't have that. Maybe I disabled logs in the settings.
I now included a reporter but this one also does not tell me anything lol
You may need symbols installed. I'm not sure if that also helps with cooked crashes.
@zenith ocean Btw, crossposting isn't allowed. Please don't ask the same question in multiple channels next time.
Ah, sorry about that! I figured I posted in a not so fitting channel, which is why I posted in the other one. Noted!
Since you are using a Shipping build, and that over steam, there is probably a high chance that you have no pdb files (especially if this is a BP only project) available when it crashes.
I would suggest you create a development build and try that. Doesn't even need to be uploaded to steam.
Good chance that will crash as well, and then with a proper callstack.
Alright, I'll try it tomorrow again and check. Thanks for the hint. Will try a development build ๐
Iโve been experimenting with SceneCapture2Dโs and RenderTargets recently and keep running into this same problem. Every time I try to capture a scene to a RenderTarget, the final image always ends up darker/higher in contrast than it should. For example: This is the view from the player camera This is the captured image After hours of f...
Sorry to keep posting this but ive still yet to find a solution. Has anyone ran into this problem with SceneCaptures?
Hey there! Could someone please explain to me what the difference between a Curve variable (the one where you can define a curve in the blueprint) and a Runtime Float Curve is? They seem to do the exact same thing and behave the same but there surely must be a difference between them right?
Usually, Widgets are cleaned up upong travel. Not sure what the rules are around Hard vs Seamless-Travels, but you would usually want to use the MoviePlayer module to play a "Movie", which allows specifying a Widget.
That's C++, but there should be Plugins for this by now.
I'm looking at it and I question it myself.
Actually, I guess the idea is that you can use FRuntimeFloatCurve if you don't want to make a new UCurveFloat asset just for one single usage case.
But then again, the EditorCurveData isn't even exposed to BPs...

So I use the RuntimeFloatCurve when I want to reuse the same actor with a different curve for each one in the level?
Hmhmhm looking at the usage of the Editor part, I think they are using FRuntimeFloatCurve if they want to manually edit the FRichCurve EditorCurveData in C++, but allow the user to supply an override via their own UCurveFloat asset.
Na, I'm just throwing out ideas. I think for Blueprint users it doesn't make a difference tbh.
Oh I see, thank you!
I think it's solely for C++ to have a base curve and then the optional "External Curve" that a user could specify.
So if you are in BPs, just use the UCurveFloat directly.
Curve is just a wrapper to get the runtime float curve into the control rig BP's I believe. If you break the 'Curve' var type it'll say something like 'Rig VMFunction Anim Rich Curve'. This naming convention is normally related to the control rig stuff.
So In a normal blueprint they'd be basically the exact same thing?
I would imagine so. A 'Curve' has a Runtime Float Curve inside.
Okay thank you! :)
Hello, trying to make a PawnMovement Component - followed a brief tutorial on it to get some bearing.
In terms of CPP, all I did was taking code from CollidingPawnMovementComponent.CPP From Quick Start Guide to Components, made a FVector and float for max speed, and put it in TickComponent.
Basically everything other than gravity is working - which is being done in the Pawn Actor Blueprint.
I have tried instead of this custom Vector, putting it to velocity but that didnt make a noticeable change.
The link to the video i followed:
https://www.youtube.com/watch?v=W5fXxSZUIfs
Quick Start Guide to Components, for the code i put in the custom component, Part 5:
https://dev.epicgames.com/documentation/en-us/unreal-engine/quick-start-guide-to-components-and-collision-in-unreal-engine-cpp#finishedcode
My screenshot of my BP Code and a video of what happens, which is basically it just floats.
Learn how to master custom character controllers in Unreal Engine 5 with this UE5 tutorial. Perfect for game development starters wanting to learn about Unreal Engine C++!
Link to the Discord
https://www.discord.gg/3qbpwyWfMw
How is desired movement this frame used?
it is used by the Ramp Movement Component in the Header and Source file.
In the blueprint, its just trying to say "hey, if true .z Do nothing / false .z move down"
In the Source file, its literal a copy paste of what was from Quick Start Guide - aside from setting the DesiredMovementThisFrame as a variable in Header and float MaxMoveSpeed.
void URamp_MoveComp::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// Make sure that everything is still valid, and that we are allowed to move.
if (!PawnOwner || !UpdatedComponent || ShouldSkipUpdate(DeltaTime))
{
return;
}
// Get (and then clear) the movement vector that we set in ACollidingPawn::Tick
float DesiredZ = DesiredMovementThisFrame.Z;
DesiredMovementThisFrame = ConsumeInputVector().GetClampedToMaxSize(1.0f) * DeltaTime * MaxMoveSpeed;
if (!DesiredMovementThisFrame.IsNearlyZero())
{
FHitResult Hit;
SafeMoveUpdatedComponent(DesiredMovementThisFrame, UpdatedComponent->GetComponentRotation(), true, Hit);
// If we bumped into something, try to slide along it
if (Hit.IsValidBlockingHit())
{
SlideAlongSurface(DesiredMovementThisFrame, 1.f - Hit.Time, Hit.Normal, Hit);
}
}
}
From what I can see, you extract the Z into its own float var and then override the desired movement this frame with the movement input stuff.
I can't see where the Z movement is ever added back in and used.
Adding to this, it doesn't look like there's any logic to handle acceleration/deceleration, terminal velocity etc... that would normally be required.
Yeah, I see that logic. we dont use the Z movement in the Cpp.
The z Movement is being moved in the Pawn's blueprint, via the ground check.
I just followed the video. It did worked for floating pawn movement Component, IE the Blueprint stuff.
But when following the steps for Cpp it didnt work, messed around a few times trying to figure out if something else was overiding it.
Don't have much an answer for acceleration/ terminal velocity, havent changed that in any capacity.
The Z movement isn't being moved in the pawn BP. What you're doing is setting the desired movement. These changes are then disregarded in the movement component.
In the C++ class, you need to add back in the Z value after you've applied the input movement stuff.
I played around with some custom gravity stuff for physics actors where I had to apply gravity myself. Let me grab a few screenshots. It might help point you in the right direction.
Its on oldish project so go to wait for shaders to compile. ๐
Just checked and it won't help. ๐ I just use the add force function.
Right, okay.
Thats fine but no, you regardless helped me.
I did what you said, works now. It was a silly oversight of missing a line.
Thank you for helping.
Can Anyone make EQS for me in which NPC investigate the last known location of seen\heared target in a realistic way like find around hiding spots where target can hide so the npc find target on that places only. Please anyone help me
eqs?
Yes
Enviroment Query System
oh
Please help please
thats not that easy
What is considered a hiding spot?
Like behind the walls and any hiding spot around last known location
are the hiding spots actors ?
yes like walls and others
You need to be a little more specific at defining what a hiding spot is. Behind a wall is pretty much everywhere.
I don't understand please make it clear??
You will have to work with perception
Ryan Laley has a good video on Ai perception, what you have to do is get the players last location before the ai lost sight then you make it walk to all hiding spot actors in that area
https://www.youtube.com/watch?v=bx7taRBjJgM
In Part 3 we look at how the perception system works and how we can set up the sight sense and use it for our behaviour tree.
SUPPORT ME
Patreon I https://www.patreon.com/ryanlaley
Buy Me a Coffee I buymeacoffee.com/RyanLaley
Donations I paypal.me/ryanlaley
PRIVATE 1-2-1 SESSIONS
Email me at support@ryanlaley.com for more information and rate...
is hiding spots eqs available in this
All the red dots (any many unmarked) could be considered hiding spots if the only condition is behind a wall.
Consider nearest distance & handle context of eqs I don't know help plese??
How can we know if you yourself dont know ๐
I Know but i am not able to understand others
You need to be more specific about what you would define as a hiding spot. Behind a wall is too generic.
put it in chat gpt and let it explain the text to you
Ok i will try
I am trying to implement a realistic AI investigation behavior for my stealth game using Blueprints and Behavior Trees, and I would appreciate some guidance.
My goal is to create an AI that feels more intelligent and less predictable, inspired by realistic scenarios (like in Money Heist).
Current Setup: My AI can successfully see/hear the player and chase them. When it loses sight, it correctly gets the player's Last Known Location (LKL) from the Blackboard and moves to it.
The Problem / What I Need: When my AI reaches the LKL, it just stops or idles, which is very unrealistic. I want the AI to actively and intelligently investigate the area around the LKL.
Here is the detailed behavior I want to achieve:
Trigger 'Search Mode': When the AI reaches the LKL (or near it), it should switch from "Chase" to a new "Search Area" state.
Use EQS for Hiding Spots: In this "Search Area" state, I want to run an Environment Query (EQS). This query's job is to find potential hiding spots (like corners, closets, under desks, behind crates) in a 10-15 meter radius around the LKL.
Get Multiple Points: I want this EQS query to return a list of the best 5 to 6 investigation points, not just one.
Systematic Investigation (The Loop): The AI should then systematically visit each of these 5-6 points one by one.
My Questions:
What is the best way to set up the EQS Query to find these "hiding spots"? (Should I use "Actors of Class" with a special tag, or just "Points" with context tests?)
now??
If the hiding spots are actors you can just look for all hiding spots in an area around players last location then let the ai visit each one of them, if every wall is a possible hiding spot and hiding spots are not actors things get more complicated
You would then have to find all spots where line of sight is blocked and visit them like that
You could also just make it randomly search an area no matter if there are hiding spots or not
I believe there is a function to find a random navigable point in radius? Or something like that. You could make a loop to use that, then use a trace towards the found location - and check if the trace was interrupted - meaning the locaiton is behind something, so go there. If the trace is not interrupted, look for anothe random navigable location in radius
Do anyone have any ideas why setting a soft ref inside a data asset from an editor widget doesn't actually get saved? When restarting the editor, the value is cleared. If i manually set the soft ref, it persits during editor restart.
As to making it "intelligent" well it is your job as a designer, isn't it?
it returns all reachable points but I want only points where a character can hide himself.
And from those reachable points, what would define it as a place the character can hide?
Hello,
Simple question but is it not possible to make the Blueprint regular OR/AND behave like a regular || && where for example in OR if the first condition is true the others won't get evaluated?
I mean I just tested it and setting the first pin as true keeps executing the second one which sucks :/
What?
Short answer is no. Its because of the CommutativeAssociativeBinaryOperator flag the function has. This allows it to have the 'Add Pin' functionality but means that the order doesn't matter.
ah I see, bummer
in c++ for example if you do if (A || B) if A is true then B isn't considered
that's what I'm talking about
in Blueprints it doesn't respect that, it'll test all of them
And what is the benefit of that ?
if for example A is a super quick and cheap check and B is a more expensive/complex check
You could have an if statement that checks if an actor is valid, and if it is then check a value from it as well. In C++ if the actor isn't valid (assuming its the first thing checked) it will fail the check without then trying to check the value from the (invalid) actor.
ah so you could do
If(a > b || strlen(string) >b )
So the first option is cheaper
and strlen would never get called if a > b
Your example is a bit weird but yes x)
and @dark drum makes a better example with validity which is easily done in a clean way in c++
but in blueprints you have to check for validity first
I mean it's just cleaner in c++, I can still use 2 branches in BP but yeah
I can make a macro I guess
This is an example in some of my code.
yeah manually serializing the checks is the way to go in bp
this is especially important to consider with a bunch of pure nodes with calculations in them
since every path is always executed, regardless
I've been using UE for a long time and never checked these things lol like for example I know Pure nodes get executed on each pin connection but what about regular nodes
still the same?
regular nodes cache the output
so they're only calculated when executed
today you can convert pure nodes to non-pure if you want a cached value
that came in 5.Something
what do you mean? like per call?
yes
They are but there are also times you might actually need something to always be reevaluated. (like getter functions for example)
absolutely yeah
basically always consider it ๐
I just cache when I need to now tbh, if it needs it
Depends whats behind the bool. ๐ (A few get all actor of class nodes and a few distance checks)
yes but then its the thing behind the bool check, and not the check itself ๐ฅฒ
The ugliest stuff i've made is doing 6dof with directional checks
Very true, but I know there are some people who would do that and then be like 'Why is checking these 2 bools tanking my frames?!?!'
I wish the height and width on the tile view widget was treated as a minimum size. 
Like how am i supposed to know how big my entry widgets are going to be. ๐
Not that I can find. :/ Just these.
ohhhh tilevieiw
And its pretty much a hard set.
you're using that huh
I'm currently reconsidering. ๐
unless you plan on 100's you probably dont benefit to much from it
I don't want to have to handly my own widget pooling though. :/
do you have so many that you need to ?
There could be, I currently have 37 I'm testing with.
I might however just group them.
Does anyone know if Primary Data Assets created in the editor (BP) work with the asset manager?
I ask because I can't get it to work or override 'GetPrimaryAssetId'.
Should work
Do you have is a blueprint class on? In the asset manager
And they donโt appear in the audit I assume
Just overriding getprimaryid and forcing refresh should be enough to make them appear in the audit
Sometimes it was for some DAs but not all
They don't no. I've also tried adding _C at the end as well. I'll see if I can force a refresh to see if thats the issue.
Ahh, i got it. I needed to untick 'Has Blueprint Classes' and add the _C.
Thanks for the assist.
Forgot about _C
And was about to suggest turning off blueprint classes
Glad you got it though
Its always the little things. ๐
On the plus side, I now know what the budle stuff is for primary data assets. Its a shame its C++ only though. :/
DynamicEntryBox
If you want pooling, but don't care about the virtualization, DynamicEntryBox will be your go to.
https://youtu.be/J2PlXs4qE14?list=PLNBX4kIrA68lz8GSxTQKX_0B23tHP6Bl9
No, its when you want to trigger a binded event, it's ABP dependent and not agnostic.
He explains it better in this video, in the dispatcher section on what the exact issue is.
This is the series to watch if you want to create a role playing game in Unreal engine with rich, deep RPG systems and advanced functionality.
In this episode we will be creating some starting functionality for magic.
Beginner tutorial series: https://www.youtube.com/playlist?list=PLNBX4kIrA68nyGfIKgyizftebllhKc4ZX
Creating game systems: http...
Guys how you make blob shadow/drop shadow for platformer games in UE? what do you think its the best method?
If you want something that'll just kind of work, have a linetrace from your character straight down. Where it hits the ground you either
A. If you do not have a decal: Spawn a decal.
B. If you already have a decal: Move the decal to that spot.
If you want the shadow to change size depending on distance to ground you can set up a variable in your decal's material and then change that to be equal to the distance between the TraceStart and the HitLocation.
If the trace does not hit anything, hide the decal.
Hoi!
Does anyone have any cool resources on how to create a "OnActorEnteredSpline" event? I've seen some variants by creating a lot of colliders between the points, and that could work, but I want to see if there is a less clunky way out there?
I'm not afraid of using C++ if it can achieve a better result!
Hello! I'm trying to make a bluetility that edits some of the assets I select. I use the GetSelectedAssets function to get the selected assets. But when I try to run the bluetility, it gets selected, and only the tool itself is included in the list of selected assets.
How do I run the bluetility with assets selected from another tab?
Hi! Thanks for the suggestion! Wouldnt be bad for performance to do the linetrace control each tick? Just for curiosity , I'm new on this
A single linetrace on tick is negible. If you're doing 100s or 1000s every tick I would start considering other options. But especially since you're new to this, I would say stick to what's simple and deal with optimization when it becomes an issue.
Perfect thank you so much!!! This boosted my confidence not going to lie , I everytime panick too much about performance
When in doubt think about the KISS principle of programming:
K - Keep
I - It
S - Simple
S - Stupid
It's easy to start worrying about performance about things that will realistically never be an issue. Fix them when they start becoming an issue, not a second before! I know some very experienced people that also needs to hear that.
Are we talking about a flat, or relatively flat spline, like something you could place along a landscape? And you just want to know if you've entered it's X/Y area?
oui
I only care about the X/Y
I would maybe do it with mesh creation. If you sample along the spline, and make an array of points, it's fairly easy to convert that into an extruded mesh. Then you can just do overlaps maybe. Specifics might require more of the usecase.
using the dynamic mesh component or something different? Because that sounds promising
I used that at first. But I swapped out to ProdeduralMesh at some point. I don't recall specifics, but I had some runtime issues in cooked builds with DynamicMesh stuff.
hm, I'll check it out! Thanks a lot 
Hey Cal I'm not understanding why my decal isnt appearing, i set my material translucent and deferred decal but when i put the component in my character it doesnt show at all
Its not code problem, its something about the blueprint itself
With the default decal image (the one that's displayed when you create the decal in the bp) it works but when i set my decals it doesnt
Might be that the decal is rotated wrong, I've had some issues where I would need to change the rotation of the.. Y-axis (?) for it to show, alternatively set the decal material to "two-sided"
I'm trying to add an "idle animation" ive got the standard idle animation but these are random events i want to happen every once a while (IE the random integer in range -- (would be a lot higher if not testing)) How much am i overcomplicating this ?
The "sitting" animations are loops that i want to play for 2 seconds; the "standing" are one i want to play once (no loop)
Boolean checks are on tick
I used an ISM and just mashed it along the path x)
game me the colliders I needed
along with nav modifications
for unreals pathfinding
this seems very weird but i did exactly as the video show: https://www.youtube.com/watch?v=MbLXOiNIIno
but i dont get my decal to show up , it stays invisible..
๐ Learn To Make Games In Unreal Engine In Weeks : https://www.unreal-university.io/?video=MbLXOiNIIno
๐Get My Free Unreal Engine Beginner Course : https://unreal-university.io/freecourse?video=MbLXOiNIIno
๐: Wishlist my upcoming game : https://store.steampowered.com/app/3758440/Maja_Island/
Intro 0:00
Tutorial 0:22
Outro 3:02
i dont know what i'm doing wrong , is a bug of the version i'm using? im currently on 5.1
We do that with some other things. But for the spline volumes specifically I did them special because I needed them to match the spline's geometry. Plus ISMs will have issues with generating nav stuff if you do too much of it at once at runtime. Creates a fuckload of physics stuff, one for each ISM instance. Still fighting that because the SplineNavComponent is trash in cooked versions when it comes to runtime generation.
It's absolutely Un-fucking-realโข how much stuff in this engine is editor only and has to be cooked into a level to function.
you want random idle stuff to happen while your idle ?
n00b here.
Where would be the best place to house variables for managing the current phase of a game that would be refrenced/changed by different actors. Level blueprint, game state?
for reference this is for a turn based game with different phases all within 1 level.
The level BP is pretty much one way so you can't use that. I would say on the game state though.
You can do this fairly easily in the animBP itself. I believe there's a random ani sequence node.
i've found my problem, my surface where the player walk is with an emissive material
so i'm trying to understand how can i poject a decal on an emissive material
Would it maybe be better to use an empty actor to store the variables keeping track of my game phases. Any insight is appreciated.
I would use an 'actor component' placed on the game state.
This would make it a lot easier to get from most places.
+1 AGameState(Base) and optional UActorComponent on it if you want to keep the data a bit organized.
game state
a part of the state of the game is what turn phase it is
is this the right way to get GUID from actor? Because I print this string and it returns me nothing...
this is how im trying to print it..
The 'Actor GUID' is editor only. I don't believe anything spawned at runtime will have one and is only used for actors pre-placed in the level.
If you need a GUID, you'll need to create your own variable for it.
all my actors are pre-placed in the level
like this?
Yes but I would use the 'Actor GUID' one instead of the instance one.
That won't matter, as pattym said it is editor only. Actor GUID is not something that gets included in packaged builds. If you do find it, it's not safe to use. If you can't find that variable, it's exactly because of that reason
Yes - for paper2d flipbooks
but im able to generate it on Construction script for every time.. and now it works.. Will it not work on packaged build?
because im testing this on a small test project, I'll actually make a package build to test it right now, if it works on package
You can do it, I do not have experience with that issue so I cannot help you Im afraid
Oh dont worry
Tried to look up online but found nothing about or atleast anything that worked because the dbuffer option doesnt show up in my version of unreal
so i guess once i completed this project i can try to use that method on a non emissive materials project xD
you might just get away with your method as the construction script shouldn't run in a package
shouldn't run in a package?
so construction scripts will not execute during the package?
also, another question, why is it dangerous?
no, they will be baked in. Your variable will still be there and populated, but none of the code will run in the package, it runs once beforehand
if you were to directly use such a variable in an event graph (shouldn't be possible, but can't verify directly), that would be something at runtime relying on something that doesn't exist at runtime
why would this validated get be returing not valid even though it is returning a player controller in the eatched output value ?
Having a value, and being valid, are 2 different things
Connected/ similar-ish
But, not the exact same
so that means it should work, right?
Just to add clarity (as I tested it myself). You can make a copy of the Actor GUID using the construction script, however, this would only work for those that were placed in the level via the editor.
The construction won't run again on pre-placed actors, only newly spawned instances at runtime. In this case, the actor GUID will be invalid.
I've used a similar method for generating GUID for world items by checking if the actor GUID is valid, if it is, I use it. If not, I generate a random one. (Used for saved data) I've also tested in a build and would as you'd expect.
hmm the only time i set it is at begin pplay and im not doing anything to the player controller
Would need more context, but hard to directly say.
You aren't doing a valid check on the get controller
(I recently myself found out that casts don't do valid checks, simply just null value checks.)
and, begin play is a bad place for get controller, cuz its actor creation.
Doesn't mean the player is controlling it yet, or etc.
I also do it on event possessed i just noticed
Yeah, its hard to say, without much context.
Are you logging out a player, or re-connecting, or what.
Cuz, such an action would cause the "issue" your running into, possible.
no nothing like that which is why i have no idea how to figure this out
the error i get is accessed none, even though i see a value in debug view
Yeah, its like I said.
The value is marked for destruction (not replicated, destroyed, or by direct choice, or etc)
Hard to see why/ what is causing it in this exact instance.
Try to print string end play on the PC graph, see if it fires, and if theres a reason perhaps
thing is, the player controller variable is valid in other places on the same blueprint
is it because im using an interface message wrong maybe?
Oh, wait...
Its obvious now. lmao
At the exact time of running its invalid.
But, the value might become valid like a half second later.
Break point the validated get, or/ and the print string node.
Or, just print string the value. ๐
(this is why I kinda hate the BP debugger.)
Can just peer into shit at any time.
So, while your watching the validated get, your actually watching that entire variable, so if its set like 0.1 seconds later...
pc decided to restart for whatever reasn lol
but yeah it is returning empty when i print the validated get
but the same variable works in the sprint function at the same time
So, yeah.
At the time of whatever that it, it is in fact no value.
But, some half second, 0.1 seconds later it gets set
Such as.
If this is on tick.
For like 10 ticks, there is no player controller.
But, after 10 ticks or whatever amount of time.
The character gets possessed, and thus has a valid controller ref.
Hence why this is invalid, but sprint is not, cuz its after whatever amount of time.
that doesnt really make sense in my case though. It fails when the player character overlaps with an interactable object collision, which triggers an event in the character bp via interface. i cant see any reason why it would be cleared only on the exact frame that the player overlaps with a collision
Are you spawning next to an interactable object?
Thus, it would make sense.
Or, is this a constant issue, whenever trying to use one of your interacts, even if you've been loaded in for a bit?
ok maybe its not the player character reference, the error message might have been wrong. i replaced it with a cast and now its saying that it cant get something from the player character, which makes more sense
constant issue, not spawing in a collision
although it shouldnt have been printing none for the validated get anyway so idk
well this fixes it even though its a terrible way to do it
I think that indirectly fixes it, cuz the 2nd cast, acts as a valid check, cuz the error you get is it being a null/ none'
youre right, it just wasnt executing the sync node ๐คฃ
This is some setup
Why the interface at all at this point
Not like you've avoided coupling
Hello, I'm working on an FPS but I'm having a problem with my projectiles. When my character moves, the shots seem to be fired differently from the player, which makes aiming difficult. I can't seem to fix the problem. My projectiles are Actors that I spawn.
What do you mean "differently"? What would you want to happen with the bullets?
I'd like my projectiles to be "straight" when fired, like in an FPS game where bullets always fly straight. I don't know if I'm being clear, sorry, this is my first Unreal Engine project and I'm a beginner.
I wondered if I could fix the problem with a Trace Line and a particle effect for the shot, but I don't know how to set it up.
They do fire straight though. You are just moving
They appear like they are not straight due to the speed of the projectile relative to the speed of your character. In most games projectiles are almost instantaneous so there is no time for the character to move between them spawning and disappearing
Okay, very good, thank you, that's clear. I wasn't 100% sure about my projectile.
You can always test it by addind a debug draw sphere on the projectile tick for like 5 seconds. Then in PIE detach, pause and look at the trajectory from a different angle
@subtle hare ask here
usually you spawn a projectile on the pawn on input, the projectile would be a new actor you spawn
yeah i know that i just dont understand how to make the projectile travel in a straight line
constant linear velocity
manually or using the projectile component and a sphere component at the root
If you want a hitscan you dont need a projectile at all
A linetrace is enough
Hey Guys, i am fixing some bugs and i got one from flashlight in hand socket, anybody know how to fix this i am stuck here for a long and thus doing other things too but didn't get this one
You never told it to unequip whatever is already there.
Okay, i will do the unequip one and can u tell me what's the problem with the movement after equipping the flashlight or any equipment in hand socket
I'm not sure what the movement issue is? If it's stopping you from moving in a direction, then chances are it's collision. I'd probably disable collision on the spawned actor before attaching it.
Does it ever make sense for an actor to collide with an attached actor ? Perhaps something like shield surfing but other than that? Even then its probably easiest solve in another way ..
anyone know why my colours arent matching up?
Not without more info. What are the zero? Textblock?
Are they tinted? In a border that tints child widgets? Using a material that affects color?
if you're using a Text Render Component, try this method
In terms of optimization I have a question.
I have created a 'dash' function, when it is triggered the actor will have an increase in movement speed, immediately be launched, and be intangible for the moment.
it is in a border
nah its ui
its a widget
If I make a bunch of dash abilities, would it be better to copy this function into each of them, and only have them be referenced when selected
Or
Leave the base dash in the player character, have the input come from outside and the output go to outside?
Check the tints on the textblock and the border. Make sure they're both pure white.
if they choose "ice" for their dash they'll have invincibility + might freeze an enemy or smthn
for example, when you change orange to blue, what happens?
maybe it's about sRGB convertion
orange turns to red
For optimization it doesn't matter that much, it is more about ease of use and expanding.
You could make an actor compontn Dash. Then add it to your character and call the dash function from it whenever you want.
Then you can inherit from the Dash and make Dash_Ice component. So when the character has the ice dash, you remove the normal one and add Ice one.
As to designing the dashes - you can have multiple events on the Dash component. Like "OnDashStart" "OnDashEnd" "OnEnemyHit" - they don't even have to have code at first. The main function for dasahing uses them and triggers related events when needed.
But what are they for? For the children ofc. The Ice Dash could overwrite an event or several of them to include some additional behavior in the normal dash.
At least this is how I would attempt something like this
What happens if you pass back the color in that binding without the property? Like hard coded?
what
im in the slackers vc if you wanna join I could show you
In this. If you disconnect Orange, and hard code it.
that aint the issue I think its the border
because the border being white changed it to red
ahh, I still need to learn actor components better, thank you
You think that'd be better for performance too? Trying to make the game light weight if I can
Also, if doing it like that, how do I make the ice dash overwrite the event?
wait I fixed the colouring thanks
Code weight is negligible. Until you add models, audio or textures etc - everything else tends to be very small, especially a component or an actor without any meshes
damn okay lol
I was also told the main significant thing in code weight is whether or not it is referenced by player or gamemode
Anyone know how changing values in Data Asset will perform in packaged project? It need to be saved (savegame) and always read default values or everytime if i start build values will be changed like in runtime?
seems like that's the only thing that really matters
I'll tryyy to get the art team to keep it light weight then
If you want to know what is the weight of an asset, you can right click an asset in the asset browser and open the size map. There is also a reference viewer to see what is loaded with this asset
Not 100% following this question. Are you asking if you need to save a data asset's values in a savegame between game sessions?
how you fix it?
Im asking if i need to do so in packaged project, or it will reset to default values or works like in runtime (its saved in data asset)
The data asset will reset to default when it's loaded. This may happen when you start the game, or when you let it be unloaded by losing references to it and then reload it some time later.
So if you need it's changes saved, yes you'll need a savegame. Though you may also be able to make them Config properties. That may or may not work to save them to and read them from an INI file. I've never tried that with a static asset though.
anyone know why this is highlighted red?
So its not work like in runtime, i need to save all modified item data and load it on game start again?
It works like any other class. When loaded, it has it's default properties you've set in editor. If you change those in the middle of the game and want that to persist they need to be stored in a savegame or ini and reloaded later.
Of couse, its has default properties i set in editor, but if we talk about Data Asset, its can be changed and its saves itself in data asset in runtime, so i was wondering if it happens in packaged project too
I'd like to add some things to what VaraelHasta wrote.
First of all, I'd like to throw in GAS (Gameplay Ability System) which is made specifically for what you described what you want to do, the main benefit is that you don't have to work with multiple components, creating objects and destroying them when they are done or changed. You can create Effects which lets an enemy be stunned or gain invulnerability for example.
Second of all the size map likes to "lie" because some things will always be loaded in the context of the object, like the main player character for example. So if you have an objects that is referencing the player, the player and all it's references will be shown in the size map, meaning you often don't really see the actual size of the object you are looking at
So for be 100 % sure, its doesnt, yes?
If by runtime, you mean PIE, then no. The issue is that PIE is still editor. You can edit things from PIE accidentally and then save them unintentionally.
DataAssets are normally static data containers not meant to be altered at runtime. You can't save them in packaged no.
??
I should have clarified to look at the SELF in the size map, my bad.
I want to make upgrades on items, and one of the idea is to change value in data asset and then save it on savegame but i think it will not work if data cant be altered
This is usually handled by a runtime instance. Or some sort of multiplier. For example if you have items with a price, but one player gets a 25% discount, then that would be more like a BarterCostModifier related to the player set to 0.75. The static price in the data asset stays at whatever it was originall. Say 50. But when you 'buy' the item, or show it in UI, you multiply it by that player's BarterCostMultiplier. So you get OriginalCost*BarterCostMultiplier=BuyValue
Alternatively if you're trying to alter the 'original price' of one instance of the item you wouldn't do to that on a data asset but it's runtime data container which should be a UObject or a struct.
The data asset remains static and never altered.
You save the player's stats like BarterCostMultiplier and the items in the game so that the runtime state can be reloaded.
why
It will works too, but i using DataAsset as my pickup item, and upgrades works "globally", so if i updated item i want all kind of that item have altered values, of course i can copy-paste code to whatever bp i need, but its messy
so i was looking for someting better
I can also duplicate x times my item and then changes values to what i need, its also some type of solution xd
well i can also create some sort of macro/function in 1 place and then calling it whetever i need xd
ye, that will do
The issue with relying on the data assets for your data like that is that if you ever decide to need that data per person. An AI player, a second in game player, whatever. Suddenly you cannot change the data asset. Right now you're backing yourself into a design corner by altering what should be unchanging static data.
i was thinking about creating a copy(instance?) of that item and using it as my free-to-change object
but idk if it possible
Could work. But I would strongly recommend just doing a struct or uobject with the changed runtime data. Even if you store the data asset in it for lookup for static data.
You get better clarity of who owns that item because that data has to live somewhere related to the player. Like a component on their pawn or playerstate. Data Assets exist kind of globally and that causes confusion about ownership.
I'm also semi sure that you'll have replication problems if you ever went multiplayer. As the asset wouldn't have an actor as an outer like a normal UObject.
Its singleplayer, and its only inventory for main character
or not exacly, i also have it in some containers that need to be altered too
well, i need think about it more
Hey guys, is there some node like select, but for execution pins? I want a node to which I can wire multiple execution pins and select value based on which execution connection was executed
Okay I'm making my very first bluepint component, would anyone like to help me :3
I copied and pasted my dash function, but now all the references are broken ๐
I'm just reinputting the objects, making it start with a custom event with an input "Dasher" that referenced BP Combat Character
So I basically want something like this, but generic:
Arrays can be kind of tricky, but if you add/remove an element from that array, then it should work ok.
If you need to change an existing element, you still need set array element or to specifically use โget (by ref)โ
thats not what im doing
Ah so youโre wanting to use it from a different exec wire path, one that never calls that set node?
Im just asking if its needed for me to place a seperate GET node to retrieve that array, instead of using the output of the un-executed SET
ie the old value
The output of the set node is actually a Variable_Get and it always gets the current value of that variable
good to know
Unlike other nodes, that output pin isnโt stale
thanks
Chat I'm so lost lmao
I got desperate and used get all actors of a class ๐
Hello, I cannot figure out how to invert this to start thick from origin and become smaller.
Really appreciate any help with this headache ๐
okay figured it out, had to add it to the character! ^-^
wait can I chain BPCs to each other or do I need to use cast to
Hi I have an issue with this... Im trying to save & load the sun transform direction
The problem is... this event dispatcher doesn't work...
but it doesn't make sense, because im always doing event dispatchers and they all work
It doesn't need a target, it never needed a target before so I assume it's not gonna need target now, and I can prove it
this is how im doing my sleep... So this event dispatcher works
Do you have a return node inside the loop above the dispatcher call?
in which dispatcher call?
these are the 2 that aren't working
I just made them
what do you mean?
Maybe let's start with something else - by the dispatcher not working, do you mean it is not being called, or is the bound event not activating?
both
same thing
Well, no, it is not the same. One is a problem with the binding, the other with the way you call it
I see you call the SetNewSunDireciton dispatcher inside a function, and it is on completed pin. A common mistake in situations like this is using a Return Node inside the loop itself
Which causes completed pin to be ignored
so both of the binds get activated, but they never get called once they're activated
And this works?
Yes โ
I'm assuming it is a Level Blueprint. Are you sure it is binding to the correct character?
It can be tested by printing the display name of the character here and in the character itself to compare
I only have 1 Char
those redirect nodes are a smell
But I have other interfaces in that same level_blueprint that work fine, and communicate to exactly the same character
no
You can just put another getter, it's literally the same
Bro is building a racing track inside his blueprint
It's more readable with literally the exact same code
?
for what image ๐
im getting confused
okay but im using local vars
you always gotta keep the pins that shoot off out of view in mind
inside a macro
same thing
is it a local variable or a macro input?
a macro is just copy paste
a function has its own scope and can have a local
something like this wouldnt work
swap min and max scale
Sure but if you're making big code like that you're really barking up the wrong tree
ill do anything to squeeze out a few bytes of disk space
all your bytes are spent on textures and audio, BP logic is approximately zero
textures are for nerds
BPs all the way
DownloadImage for all the textures
thats the method
You may not like it, but this is what peak BP looks like lol
it does what it says on the tin
at a glance you can tell that's a special case
then you can zoom in on any executable and see all the data it eats right there
This is a tire model so it represents a lot of number crunching, most of my stuff isn't this crazy
I made a custom event and
BRO
as long as it works
I made A custom event but I have a question about the object coming out of it
Hell no, whoever made this is fired, yesterday.
hit it
When I call the custom event, I can obviously put an object in the input
But from the custom event, the red one, I have to set a specific object
promoted to lead developer*
show code
Is there any way I can make it so I don't have to set a specific objectm
and remember these are object references (pointers really but whatever)
what I'd like to do is make it so self can be any 'self'
What actor has the N input?
Better computers than at home
it works with the player
that works
but I want to make the custom event not be player only, if it's possible
What is the type of Dasher?
so when I drag in self on the enemy, The custom event can have the enemy dash
BP_Combat_Character?
k so that's the problem
If this is possible it means I don't have to make a new dash BPC for every type of thing that dashes
You probably want this sort of class heirarchy:
Actor
Pawn
Character
YourGameBaseCharacter
PlayerChar
Enemy
you should put the bulk of your code in YourGameBaseCharacter so PlayerChar and Enemy both share it
fundamentally the only difference between PlayerChar and Enemy can be as simple as material or mesh, they can otherwise literally be the exact same thing
bp_combatcharacter and Bp_combat enemy are both characters
they need to both be BP_YourGameCharacter
Is there a built in pawn or would I have to make one?
whichever one has the most work in it, make that the new base, and extend it to Player and Enemy varieties if you want
there should be one, no?
would they be child blueprint classes or something else?
Here's what you have:
Character (provided by Unreal Enginer)
BP_CombatCharacter
BP_CombatEnemy
Here's what you want:
Character (provided by Unreal Enginer)
BP_YourBaseCharacter (put most if not all of your custom code and variables here)
BP_CombatCharacter (changes can be as simple as different defaults and mesh etc)
BP_CombatEnemy (changes can be as simple as different defaults and mesh etc)
okie, what would the BP character/enemy be? Children?
yes, child classes or subclasses
are those the same thing
just like how their parent right now is Character, their parent should be BP_YourGameBaseCharacter
yes
AH In class settings
I would recommend just turning one of your classes into the parent one and reparenting the other
yeah I see where to change it
I'm assuming you haev most of your stuff in BP_CombatCharacter, just make that the base
the subclasses can basically be data changes only if you set it up right. Set up your character to not care at all if it's being driven by a PlayerController or an AIController
as a bonus, you'll be able to play as any character in the game and also have ai drive any character in the game, if your game is something where that'd be useful
that's pretty cool
The only difference between Master Chief and a Grunt is that the grunt has different stats and a different mesh and animations. Fundamentally they all have the same core
hey thanks for your help, if I do that, then this happens
Wow
Parent would have no mesh, right?
Is this all you did?
anything that both player and enemy can do should be in the parent, and player/enemy specific things should be in the children
nah it'd have one
it'd still be replaced?
could just be a T posing default mesh or whatever but it has one, Character has one so you can't not have one
yup
this is a spline + spline mesh components right?
show more of the code
CMC and mesh etc come from Character, the stuff that'd come from YourBaseClass is the stuff you added like bDashOnCooldown
also you'd put your dash component in YourBase etc
the final subclasses could have literally zero additional code if they aren't meant to have unshared functionality
Hello, can someone tell me how to deactivate the option so my character doesn't get it's speed to 0 when he looks down or up please.
thanks
show how you're adding movement input
I'm guessing you're adding it in the control rotation or camera direction
so when you look down you're telling it to move down mostly, which it obviously can't do, so the x and y components of the direction you're telling it to move in are smaller
So for example, let's say enemies only move and attack, those two would be in the parent (Base class)
Then in the player I have input, while on the enemy I have AI?
What can the players body do that the AI's can't?
you can put input in the base, AI just won't call it
Move their camera and let's just say jump for the love of the game
I'd just put everything in base for now
Player presses mouse button -> call Attack
AI just directly calls Attack
Stuff that's meant to be exclusive to them, not much tbh. I prefer it to be nothing
I really like systemic games though so all my stuff has the player's pawn be nothing special, it's just a pawn that the player is driving around
okay
if you break control rotation, then make a rotation using just its yaw, and get that rotations forward and right vector, that'll do it.
basically removing pitch from the equation. That'll work for the usual 1PP/3PP control scheme
so let's say I want to add a select spells system, player has at most 4 spells
can AI have spells?
i see now, thank you
yup its a 2m long segment on a spline component
Or rather, are spells something special or could you consider BasicAttack a shitty spell
set spells yeah
so i jsut use X and not y, but do i have to add something esle ?
I'd probably reformulate the math to cook up the scale based on total time along spline instead of the integer math stuff
yes
basic attack is a shitty spell
That's the way I like to formulate it but it all depends on how crazy and generic you're trying to go
so not use Get Number Of Spline Points? What would you suggest? Get Scale At Spline Point?
I have to take the end scale of each segment as a start scale for next one though
Scale = Lerp(MaxScale, MinScale, Distance / TotalDistance)
Alright, Ill try that, tyvm!
just make sure that alpha value goes 0-1 or 1-0 along the spline end to end
Just clamping would suffice?
Wizard of Legend is my inspiration for this project so ye, basics are spells
when you're setting the data up for one end of the spline mesh component, assuming you have a correct Distance and know TotalLengthOfSpline, just use that ratio as the input to your lerp to cook up the scale
You're cooking up a distance here, so assuming that's correct then you can use it for cooking up the scale
could you show me how I'd do a set spell system? I don't plan on making the spells or limited slots for now, just curious how it'd be in the parent but different per child
It can be as simple as just having 4 events in Parent which are overridden in children to do the thing, assuming 4 is the max anything would have
or you could have an array of MySpells which are actors
or they can be components
or use GAS
How would you do it? Actors seems to make sense
just make an actor Ability which has events StartAbility and StopAbility
maybe it has a reference MyCharacter so it knows which character owns it
begin play of Character -> spawn the spells and save refs to them in MyAbilitiesArray or MyAttack and MySpell1 etc
You'd subclass Ability per spell type so you'd have BP_Ability_Fireball and BP_Ability_BasicAttack
ability can hold stats like its damage or whatever, and hold which anim montages to play on MyCharacter
Say you made Jump an ability
BP_Ability_Jump
Event StartAbility -> call MyCharacter.Jump
Event StopAbility -> do nothing?
BP_Ability_Fireball
Event StartAbility -> play some looping montage on MyCharacter -> play timeline charging up some float Power
Event StopAbility -> Spawn a projectile at MyCharacter.WandTip in MyCharacter.ControlRotation direction, give it damage based on Power
you lost me here
I understand this
I understand this
?
I guess I don't know how to do arrays yet, much less save refs
drag off Return Value and name it MyAbility
then you can talk to it later like when you press inputs
make it a variable?
although this might be a bit much if you're brand new
Nah it's good
Oh it sets an object
That's pretty cool
Do I want this to be an array?
not now
get 1 ability to work
then worry about having an array of them
MyAbility , then worry about MyAbilities (plural)
You can even not worry about using an array at all, just have MyBasicAttack, MySpell1, MySpell2, etc
M1 pressed -> call MyBasicAttack.StartAbility
M1 released -> call MyBasicAttack.StopAbility
etc etc
it's just spawning an actor
your abilities ARE actors
they could be components, but I prefer actors since an actor can have timelines which are great for ability stuff
how does it know which one to spawn if I have the children
Class can be a variable
so you can set what class MyBasicAttack should be in subclasses of BaseCharacter
but this code would be the same
the only difference between EnemyA and EnemyB could be which class they have for their basic attack
I 100% get it
make sure the variable type of MyBasicAttackClass is BP_BaseAbility class reference (purple)
so only subclasses of BP_BaseAbility can go in it
you don't want your basic attack to be a landscape or a skybox
ye let's do the jump for now
๐
hmm
need the transform loll
just give it any old transform
where the ability is doesn't matter
make transform
hmm
now I have this error:
Blueprint Runtime Error: "Accessed None trying to read (real) property Ability1 in BP_CharacterTest_C". Node: StartAbility Graph: EventGraph Function: Execute Ubergraph BP Character Test Blueprint: BP_CharacterTest
AM I SETTING THIS IN THE WRONG PLACE
I am
The PlayerCharacter has to set the Ability 1
And the execution of ability 1 is done in Parent
you might be overrideing BeginPlay in PlayerCharacter without adding a call to the parent classes BeginPlay
just add a parent call
how?
right click the node you'll find it
Does the Uobject class have that much overhead?
or just delete the node if PlayerCharacter.BeginPlay isn't doing anything
relative to what?
I'm wanting to make something mimicking a traditional C++ class
anyone know how to have an actor (A) tilt to face another actor (B)?
i have A always facing north, but i want A to tilt itself 30 degrees towards B on a button press without A changing to not face north. essentially no matter where B is, at an input A will tilt towards it.
A "Stat" struct with functions like "set max" or "set value"
make it a struct
cast to?
I guess it'd be somewhat cleaner to just directly access the variables 
on the child or parent
AFAIK you don't get access to struct member functions in BP
in C++ you can do it
damn auto suggest ๐
Yeah which was why I was asking about UObject
show your current PlayerCharacter.BeginPlay
tyvm this definitely will change how I do things
It was this
added the make transform
I prefer structs if it's meant to just be a data container with no lifetimes etc
the child class shouldn't have to do anything rn
just do this all in parent class
I'll make it the copy in a moment, just wanted to look through enemy and player to see who has more work
I did and it wasn't working ๐
this error
right click this, add call to parent
so it sets up the ability for you then proceeds with whatever the child class begin play does
then connect it to that?
Parent:
BeginPlay -> set up ability
Child:
Begin play -> call parent begin play -> do whatever else Child has to do
now lose all the abiltiy stuff here
put it back into the parent
this is where you'd do setup stuff that's SPECIFIC to CombatCharacter, in addition to whatever BaseCharacter does
shouldn't be much
preferably nothing
error is back
show base class begin play
Blueprint Runtime Error: "Accessed None trying to read (real) property Ability1 in BP_CharacterTest_C". Node: StartAbility Graph: EventGraph Function: Execute Ubergraph BP Character Test Blueprint: BP_CharacterTest
same for StopAbility
if you do alt+printscreen you can take a picture of the current window and then paste into chat
basically 2 errors per
I know, I'm on school computers
show this again
It's still that, nothing changed
I removed the set tho
delete anything to do with abilities there
you sure you compiled?
nothing in the child class should mention abilities at all in any way shape or form
the only ability change you should make in child classes is what the default for your ability classes is
yes
that's the problem lol
not changing the class on begin play, just setting the default. You need to show inherited variables
do you have input events here that talk to abilities or are they gone too?
Gone
Everything gone, it's just those 2
The sequence is just 'set hp bar' which I'm moving into parent class after this
the default hp bar from combat
None
that there's ya problem
(no default value)
isn't it setting the ability
"Editing this value in a class default object is not allowed"
or do you mean the purple one
purple one
purple one is the class thats used to spawn the actor
So on the children I'd set purple
purple is class, blue is object
equivalent to name and action, ic
indeed works now
do I need a different purple for each child
do you want them to have different abilities?
yes
you can set the default in the parent class and just change it in children
so everyone gets BasicAttack unless changed
whatever you set in parent class is the default
children can change it
jjust like how children can change teh max run speed in their CMC
so they all can use the variable
don't need 100
that's awesome
Thank you, I really wanted to make something like this to make this much easier
Imma send one last screenshot then make everything the parent
This would be the drop down, right?
nope
oop
In details
oh?
where are inherited variables
don't see em
in the case of a player where they can select abilities, would I use a set then?
<@&213101288538374145> seems sus
okay I know now but you could've zoomed out a little XD
anyone know how to have an actor (A) tilt to face another actor (B) without losing it's current direction?
i have A always facing north, but i want A to tilt itself 30 degrees towards B on a button press without A changing to not face north.
currently I can find the correct angle needed to have a debug arrow originating at A point correctly point to B's position (represented as the red axis) but am having trouble getting RotateVectorAroundAxis to use the y axis (represented as the green axis) to rotate it 30 degrees
Hello, I need help, I am making shader by tutorial and I don't know how to make this. Can someone help ?
how does something change its rotation without changing its rotation?
show what actor A's rotation should be in these situations