#blueprint
402296 messages ยท Page 945 of 403
I thought about overriding the root component in the parent's construction script, but i couldn't find the right functions for it.
Or you can have the parent/host actor class "interface" with it as a generic primitive component if it knows which one to get. (Get components of class / with tag?)
Or if you want to do sort-of timelines in a component, you can do something timeline-ish with curve assets and some tick logic.
By all means the logic i am doing makes more sense as a component. I guess i could look into messing with enabling tick when needed, and doing things in tick.
Yeah, Set Actor/Component Tick Enabled is in my top 10 BP nodes lol
It's fairly simple what i'm doing. I'm essentially just giving random rubble on the level the ability to teleport (long story why), and i just need a timeline to write a material scalar on the meshes so it fades in and out when teleporting. It makes a lot of sense to me that this logic should be in a component.
If it's a simple ramp then FInterpToConstant should be enough...
Id probably make a manager for this and not a component
Gives you way better control in a random scenario
How can I use a timeline to select a value? Let's say at speed 1000 i want the timeline to return me .5 and at sped 200 return should be 1, etc. The reason behind timeline is that It will go from .5 to 1, etc.
Not sure what you mean by speed but you could use a regular old Select node
to pick a value based on some condition
For example, speed goes from 0 to 1000.
Seems like you just want a curve where when X is 1000, Y is .5. And when X is 200, Y is 1. And whatever more values you have.
I want the output to be 1 to 0.5. It will smoothly go from 1 to 0.5. That's why I can't use select.
Map range clamped
What goes in val? My in-rA is 0 and in-rB is 1000. OutrA is 1 and outrB is .5.
Both. Like, NPCs for instance, some of them will be on the level from the get-go, others will be spawned due to gameplay events. Same for items. While items don't really have anything complex and I'll need to just delete everything and respawn them from saved data, NPCs with AI are more complex.
Val is your speed
InA is 1000, inB is 200, outA is 0.5, outB is 1.0
What even is this supposed to mean 
Or inA is 200, inB is 1000, outA is 1.0, outB is 0.5
Or just make a new float track in the timeline 
This is a way smoother approach ๐
Map range is underestimated!
Id ditch the timeline entirely really
It doesnt seem to serve a purpose for this
But currently my main issue that I'm using a plugin for making my dialogue system, and the dialogue in that plugin is stored in an asset that's being loaded into an actor. So I need a way to differentiate these assets in order to code a system that will remember which dialogue options the player had already seen in which dialogue, in order to skip them. Before I used soft reference to the asset as a key in a map array, but now when it came to saving this message history, I need an ID string to differentiate them.
What do you mean by manager?
A manager class, responsible for managing a bunch of actors
Like these rocks or whatever as an example
Is that a thing? Do you mean a bp to control the rocks? or is there a manager actor?
Or all the ai controlled workers in some settlers game
A bp to control the rocks yes
I get it, thanks
Instead of slapping components on a random number of rocks
You let a manager control all the rocks (or a random amount)
What's n_snowfall?
probably it's not ready try a it's valid branch with it first and see if it goes through
is it valid when you cast to it's parent?
you mean like this ?
its valid yes
hmm but
this isnt
@fallen glade
i dont understand why its not valid
That works thanks.
@woven ermine basically impossible for us to say. Does the particle system compile? Does that component even have a particle system asset set for it? Does the BP script destroy that component somewhere?
Idk I'm straining to think of scenarios where your particle system component is invalidated
yes it works fine
whats worse, in 5.0.2 it worked
I mean what i was doing so far worked in 5.0.2
Maybe it's cursed. Try deleting component and remaking it
I really don't know, sry
๐ฆ
Can fixed particle system components (added to the BP class; not at runtime) auto-destroy?
Like does the particle system play out and self destruct?
Just brainstorming situations
no
its just a snowfall
it plays continuously
the thing is :
IF i do it like this it prints VALID
and this is invalid
but its the same thing
am I missing something
What is weather 1? A function somewhere?
Is that function called at beginplay?
no
Yeah I really don't know. I've been using Niagara since beta and I've seen all manner of bugs and crashes over the past year or two lol
One of the paranoid habits I've picked up from those days is spawning Niagara systems at runtime rather than adding them to the BP class as fixed components
So that's a random ass thing you can try; maybe the issue will magically go away but no guarantees
yeah somtimes UE bugs are super stupid, like i just spent a ton of time trying to figure out why the viewport controls in one of my projects were not working anymore (couldnt move in viewport).
After hitting play once it worked again ๐คฆโโ๏ธ
But.
im not sure its a bug (this time) i think its something im doing wrong
The good ol' safe approach is a getter function
GetSnow
Which checks if snow is valid, and if not, creates the system, assigns it. And returns the new system
Failsafe method
FIXED IT
sec
ill post ss
@tight schooner @gentle urchin @dry condor so on begin play i cast to the player pawn, get the particle, set it as a variable
then I can call it
Id still say its good practice with the get'er function
etc
And not allowing external access yo variables directly :p
But if it works it works
you would create a new function, like you do with i.e. a variable. and then you make it do the stuff you need it to do, i.e. check if the particle system exists and if not create it etc.
A pure function, returning the system in question
ah
i know those
ok
but for now ill leave it as it is
but
i have to do it in the pawn bp right?
not the level one
Depends on the accessibility you need i guess
Does it make sense to have the weather system in the player pawn?
no
I would think so since its a relatively local system ..
i just need to have the particle there
But im not sure where people do weather systems in general tbh
Some of it would be global
But thats probably just a global material parameter
game mode i would guess
I have a particle system in front of the camera (snowfall), and it gets changed in the level, like after the player enters a cave it stops, when he exists the cave it starts again but with different parameters (more/less snow, gravity, speed etc)
I'm no expert but if I had to make a similar system, I'd probably make snowfall an actor that tracks or attaches to the player rather than resides directly inside of the player pawn class. In my current project I have an atmospherics actor that contains/controls a lot of stuff... Directional lighting, volumetric fog settings, volumetric clouds...
It would make sense to keep it external aswell.. like
.. usually theres enough crap going on in the player bp :p
Yeah
why not make it a niagara system?
The snowfall already is, but then you wrap it in an actor that can set its location and drive its parameters
just add it as a component
and then u can expose variables and modify them in whatever its attached to
If you read the whole convo above that was the starting place; the particle system being a fixed part of the player pawn
my player bp isnt that complex, so it hold that particle without issues, its all pretty basic
Yeah you could do it that way, but if you eventually make a big, complex game, you want everything to reside in the right place
So that you're not editing the player pawn just to change how snow works
god i hope i wont make a complex game, im overwhelmed as it is
remaking a 1.2mb game into a 1.2gb behemoth
Looking forward to your photorealistic UE5 remake of Final Fantasy 6
yes but its actually skiFree
Sick
only now its called Ski3 haha
SkiNotFree
well i would not like to charge money for this, its more like a project to test what i know and to learn new things, etc etc, its my first project from ground up
so Ski3 it is
hope bill gates wont mind
Theres a lot of old golden games
how do i set a max speed
Character > Get Character Movement Component > Set Walk Speed (not 100% about last node's name)
ok what about in the air
It's tricky because it needs to be the tiny pill thing, from my experience. There's two other movement components that don't have that same param
Well you don't walk in the air unless you're Jesus
Any pointers for where i should go if i were to make a inventory system?
youtube
Is a place to start , if nothing else
(hope Adriel isn't around to arrest me)
How do I make Blueprint Interface functions pure?
Dont think you can
so how do i set a max speed in the air
Is there a way to check if a level exists? I'm trying to implement the "continue" main menu button aka "load the last visited level", but if Open Level (by Name) receives an invalid name [from a save file], the game stops.
both
@drowsy veldt you can make an array of level names and if the level name you try to load isn't in the array then handle it
@tawdry surge Is there something more automatic? Or a way to make the list automatically?
You might find some utility searching for assets by type or something..
The Victory plugin has such utility function
Yeah like squize said I'm sure you can generate it. I've never tried tho. I generally just have a default level set in a variable, so if they don't have a previous save game then it just starts a new one
It is a bit weird that no such list is avaliable since they all exist in some project config file...
Thanks.
The concern isn't a null, but incorrect data. Specifically, somebody could have a save saying they're on a level that doesn't exist.
Yeah I assumed it wasn't returning anything
Also this one
"Does asset exist"
Build a string, test it, and if not then no level is named such name
This relies on all level being in the same folder.
Which is acceptable, but a better option would be welcome.
Can you catch all folders automatically tho?
What are you building where you don't know for sure if the name of the level you saved exists?
I'd just rather have Does Level Exist than trying to solve a bugreport why the game crashes on a particular user to find out that his save was made on a level that doesn't exist anymore.
sounds like a silly solve for a weird problem
but all levels are world type objects. I'm sure you can find them all in the project
asset manager would be my first stop
Placing levels all over the place is also not common
Not sure id delete olf levels directly
Id probably redirect them instead
Thanks
You neeed a fallback fir when it doesnt exist anyways
you can query the asset registry
It seems that I can't update a value in my subsystem.. if I print the value after patching it like so it's empty
Wouldnt you make a function for the subsystem , updating a variable ?
You sure the value you're reading from contains something ?
yep the breakpoint
Print it ?
it does print my loaded value for testing purposes it's "Where's your mom?"
Hmm alright. And surely the subsystem exists at that point
Guess its more or a cpp question kinda
Hi! does anyone know if there's a way to make a interface method "Pure"?
Cant
So i recently tried to make a function inside an interface pure, and i was informed about the fact that interface cannot contain pure functions and i am wondering if anyone from epic could find a second to elaborate as to why its impossible. Also i was going to make an interface with getters mostly and pures seemed to be a natural option. Now i...
i got a workaround with a local method, but only makes sense when using within the same actor
: (
Why pure anyways
You can make interface functions pure if you declare the interface in cpp as BlueprintCallable and const. AFAIK there isn't a way if you define them in blueprint. Probably this is because you generally call interface functions as messages in BP, rather than as a function call on the interface itself
Im not really seeing much purpose for it anyways, but I guess i dont know much about the context here.. Pure just look nicer in some situations
What's the difference? I never did know why there's a message or interface call
Is it effectively no difference in BP?
The interface is just a carrier of the eventcall, and doesnt contain the actual implementation
hi guys how would i make it so my pistol dosnt continue firing? https://gyazo.com/e9e9aba9d743e4dbd558f3f04bcdbde3 I tried the do once but that dosnt seem to help me unless i put it in the wrong spot
I'm not seeing anything here that would make it fire more than once
if by fire you mean play a sound and do a line trace
The message fails silently if the object does not implement the interface so you can call it on anything, like an AActor variable without caring what type of actor it is. If you have a variable where it is known to have the interface (eg MyFancyActorWithInterface or an Interface variable) then you can call the function and know it will reach the target
@faint pasture holding down the mouse button continues to fire the muzzleflash particle effect
OK so message is the "fire and forget" approach
That's all up to your particle effect. Make it not loop
the MF is looping until you release.
@faint pasture gotcha
Hey folks, never seen this before UE5... My construction script appears to be causing a strange blurred actor. Even though construction on drag is disabled, and I have a stop in which doesn't construct unless a variable changes from it's last set state, it still seems to build and then create this fuzzy mess. Anyone seen this before?
Hey guys. I'm working on a random spawn location function that gets a random location from an array of locations. I don't want there to be any repeats so I'm getting a location from the array and then removing that item from the array. I'm still getting repeats. When you remove the way I am, do the other values shift?
hey guys, im trying to play an animation that has vfx notifies in it, but i dont want the vfx notify to play, does any 1 know how to do that or if the engine has any support for that?
I'm not sure but I think you will get another random value, try connecting the LocalSpawnLocation on remove
Bro... that fixed it. Many thanks
Guess that simplifies things then doesn't it?
Appreciate it.
It for sure does ๐
hello, I implemented something like that
https://forums.unrealengine.com/t/scene-actors-bounding-square-screen-space/459787
but that box is not nearly thigh enough ๐ฆ
Do you guys have some ideas how to improve that?
I tried to use smaller object inside bigger one, using static mesh bound instead of actor, and rotating bounds with object.
Right now I'm trying to use blueprints only, cause I'm new to Unreal but if someone is willing to provide me with some exact instructions, then I can try switch to Cpp as well.
hello guys, i want to load a .pak file in realtime on Unreal... Does anyone have a tutorial or doc about this?
I have no knowledge about programming, except going as far as loops and functions to search and sort an array. How is BP? I want to make some SP game prototype, not the whole game, a single mission. I think that using games from 20 years ago wouln't do much good for a portofolio
I have an actor component just for the functions.
Im trying to create ann Add Spline Component but the node doesnt show up.
I have the reference of the Character, that is a little army.
In the Character i can create Add the Spline. Why cant i add here?
Pretty good, easy to grasp imo. The right old game could make a great portfolio asset but each to their own :)
Spline is a component. You can if you create the spline component and parent it to the same parent iirc
Should if the tab key does something different on every UMG, should I be putting that tab functionality in my UMG widgets or the player controller?
But its not working. Its not allowing me to do with there. As well as it doesnt allow me to create box collision.
I think this is because this is an Actor Component too. So is there a way around this?
Let the umg handle it @cedar sparrow
I can add box collision from my component
What's the best practice to have an Actor Component require an abstract function?
- Currently, I have the AC and a separate interface, both attached to the owning Actor. Problem here is we can't 'require' an interface, so the AC and Interface are tightly coupled and will likely cause issues.
- Without inheritance, there doesn't seem to be a way to override a function from an Actor Component
- I cannot find a way to make specific functions in an Actor Component abstract, to be implemented by the owner
can you put key press events in the UMGs?
Same as mine
this is where its coming from
i think it was you who taught me this trick some weeks ago
using this to organize things better
Daym
but if i cant create box collisions and splines. then i will have to duplicate a bunch of functions ๐ฆ
Did i actually teach someone something ๐
Yeah i agree
Ill have to check i guess
If you try "GetParent" then add component ?
Nothing there either?
so if you create an Actor Component in your Character. Named Army_Functions.
Then go in Army_Functions. You can create a spline or box collision?
Ill try it, just gotta get to my pc in a few min
ok thank you. Ill wait. I tried your last tip didnt work either:
i tried also getting owner
Opening...
Construct
is what we're after
Construct object from class
No its not
lies...
there we go
this is what im doing
hmm
doesnt seem to work in my other project...
So it worked in one project and in the other it didnt? Are you using character or actor?
Yeah, im not sure whats different.. the parent actor is not relevant..
In the project it didnt work in, was with some random actor
But the component doesnt know that
You did exactly the same in both projects? This is mysterious
Whatever you want
except not everything will work
You need to get at the thing you want to cast to that class
this works, in both projects
Of course. Only MRMeshComponents will succeed at that cast
It worked here too. So strange ๐
thanks a lot
its like we tricked the engine ๐
Explain more about what you're trying to do. We know nothing about your setup and what you're trying to have happen here.
Im trying to get navmesh to be rebuilt on runtime
i cannot find it in project settings
ah shit didnt think of that lol
There's settings somewhere to have it be dynamic. Don't try to force it like that.
I posted my question from earlier to the Unreal forums. Would appreciate an eyeball or two on it ๐
https://forums.unrealengine.com/t/best-practices-for-actor-components-with-abstract-functionality/604156
hi guys, i need to make the same rectangle as in the video. The forum was painted exactly how to do it. I did everything as they said, but nothing happens. Can you suggest what is the reason? https://forums.unrealengine.com/t/scene-actors-bounding-square-screen-space/459787 https://www.youtube.com/watch?v=zaPAlBaMZE4
Before I start trying to reinvent this wheel, is there an existing combination of nodes that can be used with the (2d) DrawLines UMG node to draw a 2d bounding square around a scene actor? An example of the desired end result, is shown in screenshot. I attempted to convert thetriponatorโs C++ code as shown here: but ran into problems wher...
Partial answer to the question on UE4 Hub here:
how do I set the visibility of these with blueprints?
Hi, I know that this isn't the right channel to put this in, but I'm having an issue where my packaged build doesn't use my custom game instance blueprint
Is there any ideas on why that may be the case?
How do you set up a keybind options menu in game
Look into Lyra demo
Main menu widget or smth like that, the follow the path until you find the settings widget, then keybind widget
I've been trying to google the topic but it just comes up with resources on keybindings for the editor. Is there a better way to word this/are there better keywords?
See where the normal input bindings are stored. It should be an .ini file. See if you can access and edit any of those files in runtime.
hey so i've got a problem porting ue4 mannequin arms to my project, for some reason the textures become broken. any fixes?
try another channel, this one is not for asset importing
ah gotcha
Hello everyone, I am new to blueprint, teaching myself here, I found this issue that sometimes I write some function that work while testing but when deploy it doesn't works. I am talking about 'simple' stuff nothing that need write or write to the pc permissions, things like a UI to click a button to do something. Is there a different way to write some functions for developed games?
You didn't give any details for anyone to give you any help
the thing is happens randomly
for instance now I am doing this interactive presentation for architect, they click buttons things happens, like rotate the camera, change properties to the post processing volume
sorry no good English here
no, forget about C++
I am not a programmer or developer just an Viz guy trying to survive :p
I am working on a presentation for a building, they want to present a new building, the typical you see around
they click a button the walls change colors and stuff,
I have this button that will show up arrows and then you click again and the arrows disappear, when I test it it works fine, but when I deploy or test with stand alone game it doesn't works
I can share screen shots if you like but my question is why it work on regular testing and not when I do a stand alone test
So I have variables saved in my game instance blueprint, but when I try to load them into the thirdpersoncharacter upon entering a new level, those values are gone/reset. I have this loading variables back in the level blueprint. Any ideas on why this is the case?
can someone please explain this setup in words, kind of confusing as output result is always same when pressing Q at beginning
Order matters. When you press Q you ask it if Boolean 1 is true or not*
But you set it after you ask. So the initial value is always persistent
has anyone messed with the paragon minion death animations? they aren't full animations, they only fall halfway to the ground
am i supposedto ragdoll them halfway through?
On Q pressed set boolean1 to true, on Q release set boolean1 to false
If you want to change the value every time you press it, use the flip flop node
and remove the branch
I did use that, however I wanted to understand why this happens regardless of Boolean 1 being true or false?
the setup remains the same, always
Yes, your initial value of Boolean1 remains
it has a default value, which i assume is "false"
so the first time it will allways go to the false part of the branch
Oh he sets it to true then
Boolean 1 Set to False on Tick and printing False
what is your initial value?
with Q pressed and Boolean 1 being False by default, what's the output result on side of True/False side of the branch?
be it Ticked or not, doesn't matter
Set to False in the output of True side of branch and True in False branch
Press Q -> Sets Bool to true -> event tick (excuted every frame) changes from false branch to true branch (you should see the print string change from false to true)
@dry condor so set True in True output, in case Tick output is false?
you never set anything on event tick, at least not in the screenshots
You need to change your input mode if pressing Q is not working
a branch is basically an "IF" and its asking "Boolean1" for its value (true/ticked or false/unticked)
so if you start and dont press q it should spam false
and when you press q it should switch to true
Is it possible to create a calibration screen so people can use wheel/pedal controllers? I imagine it's definitely possible, but I'm curious how difficult an undertaking this would be and how much it would cost to hire someone to do it
It would be nice to account for different wheel ranges (degrees of rotation) and short calibrating the brake/gas pedals to ensure 100% throttle or 0% brake
Do this instead, just set Boolean 1 = NOT Boolean 1
Wouldn't be that hard to get a custom input from said controller since it still relies on the xyz input no matter what.
Same with the pedal input.
Shouldn't make a logical difference but it'll be more clear
My game instance blueprint isn't saving the values stored between levels
I'm not sure why at this point
Sure, just have them pump the pedals and steer lock to lock at some calibration screen, record the data, and determine the limits from it
ThrottleMax = MAX(ThrottleValues), etc
I see, and that would require the rawinput plugin I assume
No you could do that all in off the shelf Unreal
Really... wow
Something has to be overwriting it. GameInstance values will not reset until the application is closed and reopened.
I'm not talking about modifying the mapping between hardware and AxisValues
I'm talking about remapping AxisValues to whatever range you want
Hrmmm the only time they are set is when the level has been cleared
here is my setup, I already created a variant set with the arrows set to visible or not then on the UI I load the variant set
then I switch the state with a button
this workflow works with other elements in the same scene, but when I test a standalone game it doesn't works
@faint pasture it works, thanks
WTF is a variant, did you make that or is it some engine functionality?
The names are a bit smelly to me
I didn't realize Unreal accepted inputs from wheels/joysticks without the rawinput plugin. I guess modern controllers all use XInput?
I'm not sure. But you could easily have calibration factors gameside to let you do all sorts of remapping without the engine even knowing or caring
You get an axis value in engine. You can do math to it.
I'm not sure where to ask this question, but whenever I go to import an asset from my files via drag and drop a no sign pops up and it will not allow me to drag them in. If I go to import them manually from the files the downloads do not show up. How would I fix this?
are you asking me or someone else? this is so confusing
Asking you. What is a variant, is it an actor class you made or something else?
I have a hunch that the problem is from using names but I'm not sure without seeing the internals of that function
@faint pasture took me some time to understand, the output in last branch is asking if the boolean 1 Get is true/false, so the SET output is always the same
You can print a bool and also set a bool to be the result of a bool function. You can do this with no branches
it is Level Varian Set it is a new blueprint type from of Unreal, that let you create sets of instructions for a single or many objects or groups
Tick -> Print Bool
Input -> Bool = NOT Bool
maybe ask in #ue5-general
actually I am in Unreal 4.27.2
also the Get value of boolean if global in the BP, it can't be set to true in on Get and False in another, I had wrong assumptions about it
thanks for the help guys, appreciate it
yeah the variable always has only one state
No it's not global. That variable is local to the object it lives in. You can have many instances of the object with their own booleans
I apologize for messaging often but I'm stumped on this issue:
I have a custom game instance that saves variables that I want to persist to other levels. I save them once the player has cleared the room of enemies and only then (there's an conditional branch that checks every tick) From there, I load into the next level and have the thirdpersoncharacter construction script set all the variables to what they were via the game instance blueprint.
This system works in editor, but upon packaging it, it doesn't work
small tipp, get used to naming your variables in a way that makes sense, for example if Boolean1 in your example was to check if the character is jumping, then rename the boolean to something like "isJumping?" so it makes sense when you look into the code weeks later @trim matrix
First I'd figure out if it's actually persisting and not being used correctly, or not persisting
The construction script is what smells to me
Hmmm how so? I'm relatively new to unreal so I don't know the ins and out of it quite yet
I'm not 100% sure but there may be forms of travel that don't reconstruct the pawn. IDK how you're traveling to the new map. Try just printing the gameinstance variables value in your pawn on tick or beginplay or a timer and see if it updates correctly
Should I do this on the event graph or in the construction script?
I'm traveling to the new map via level loading and unloading
Event graph is the only place that has tick or beginplay or timers so there
Just check each part of the chain of things that could be the problem
okay! I'll give it a shot
@faint pasture It updates correctly with the construction script
The print outs are the same between maps as well
What I find odd is that the construction script seems to fail upon me packaging the project and running the executable
What type of variable is it?
Most of them are integers, I use one Name Array
Things such as Player health, score, currency, etc aren't being saved, and the name array is empty upon loading a new map
What happens if you use begin play instead of construction script?
would begin play be in the third person character or could it be in the level blueprint?
are split struct pin and break hit result basically the same?
Whichever thing cares about the data.
Hit result is a struck so you are breaking the struct
when u break it, what changes?
if u dont break it, can u still use it similarily?
break vs split is the same,
nothing changes, you just "open" it to see whats inside if you dont need it as a whole
or only want to manipulate specific values
kay thanks for info
whenever i simulate physics, the skeleton gets a force applied in the z axis and it just pops it up for no reason
anyone know how to prevent that?
I've been trying to get all the levels from a path and add them to an array for the past 2 days, only to find out that the items are not being picked in order.
At least it's not consistent. Anyone knows why?
Hi, it's pretty easy to get a "Get Right Vector". How do I change that to a Left Vector?
@faint pasture That fixed the issue! Thank you, I'm still curious on why the construction script failed
negate vector
Negate Vector
Multiply by -1
How do i get an argument into my Create Event?
I googled and it seems this is not possible. So what should i do instead?
For context. Im in a function that calculates splines for soldiers to walk on.
Then i need to lerp them. And because functions dont allow timeline. I need to do it outside somehow.
Timers in BPs can't have inputs on their events
Why don't you just call the event directly and put a timeline there?
Are your soldiers always lerping continuously?
Or is it a discrete "move"?
What do you mean discrete move? They are walking on a path slowly overtime
I mean are they always doing that?
They need to do it until they reach the destination
ok so you want to be on tick or a timer
Sounds like Tick
Prolly tick unless you're ok with them stutterstepping
ticks ? but isnt it bad? i rather do event or timeline, right?
A timeline is like a temporary tick. You'd use a timeline to open or close a door. You would use tick to drive a chase cam or continuoutly lerp towards a target
no
ticks are not bad
they are bad if used for seomthing that doesn't need a tick. But you're having to have something update every frame, that's tick territory.
Just think.
"Do my dudes need to be in a slightly different location every frame?"
"Yes"
"Tick it is"
make sure to actually utilize DeltaSeconds if you use Tick
"Do I need to rebuild the landscape every frame?"
"No"
"Tick it isn't"
i never use tick, i always use timeline or event. i understand its basically the same thing. but my problem currently, is how do i tell from the function im in for them to move
since the function im in cant use timelines
Tick is an event. It's an event that fires every frame.
that triggers my ocd ๐
Tick -> For each dude in Dudes -> Vinterp to constant
Everything that you try to use to avoid tick is just a tick with extra steps
okay but how do i do that from the function im in
I know they have splines and you'd have a different setup but yeah
What function are you in and why are you in it
What does this function do
Its function i call to calculate the destinations of my soldiers and how the splines are placed. Its all working good.
But i cant lerp them inside the function
Well yeah
that's seperate
OK what's your data model for your dudes
Do they have individual target points?
First off, do you have an array of SoldierStructures to represent the state of all your soldiers?
You're doing
Squad = Actor
Soldier = ISM inside the Actor
Right?
yes
no. i just have my current position
and the destination
and splines
1 spline per soldier might be pushing it but that's an optimization for later
ok so you have multiple parallel arrays of the same size then right?
its just in rare situations
its not for all the movement
just a specific attack
OK so inside the squad, you have it like
Vector Array SoldierPositions
VectorArray SoldierTargetPositions
Stuff like that?
exactly
and Spline Paths
and from that function that calculated everything, i need to lerp them
maybe this shouldnt have been a function, but an event, but then i would have a bunch of variables in the global
OK so
Tick -> Move soldiers along splines -> update ISM? (not sure how ISM works), etc
Event GaveAnOrder -> Recalculate Splines
What global variables would you have?
You have parallel arrays.
In the loop, pull the spline data from that soldier from your splines array etc
what, how am i supposed to change the map key if I can't create new map items? this keeps popping up whenever I try adding a key
It's because the default value for that key is already used by a different element
Forgetting splines, imagine you had TargetPoints and just lerped towards them.
For Each on SoldierPositionArray:
SoldierPositionArray(i) = VInterpToConstant(SoldierPositionArray(i), TargetPositionArray(i), Speed)
Instead of TargetPosition you'll have some spline function but it's the same idea
The issue is your structure
you're doing some goofy dispatcher timeline timer stuff when you can just parallel chug through the arrays and update everything
I'm a bit confused, my goal is to create a new map item so I can change the default value to a non-default value
Being which function?
Is this the function to calculate their paths or to move them along the path?
Jesus fuck
ohboy.jpg
i have everything. now i only need to lerp them :p
ok in plain english, how do you envision your system working? The soldiers move.....how
they will move slowly into the target
following a spline right?
yup
no the splines are fixed and calculated. now i only need each soldier to follow its spline
the issue is i cant do that in the function
i cant use timeline and time event there
well yeah, that has to happen on tick.
I laid it out earlier.
OK do this
First off, do you have 1 spline right now or many many of them?
many many
its an array
so i need to output them to the event graph i think
if thats the only way
then i create an event in the event graph
Does the array of splines exist in the actor as a variable?
no. it exists only in the function
but im thinking
OK so just return it and save it to a variable.
maybe the only way this works i really my old way. that felt really noob
You have now made a CalculateSplines function, that's fine.
OK so
Tick -> UpdateSoldierPositions
SomeEvent -> CalculateSplines
ok here I go again, I have this blueprint pawn, it is just an arrow geometry, I created this quick animation so the arrow bounces, when I test it shows fine, but when I test as stand alone game it doesn't show. I am guessing it has something to do with the location or world location but I am not sure, your help is appreciate,
UpdateSoldierPositions
{
For each index i in SoldierPositions
SoldierPositions[i] = GetPositionAtTimeOnSpline((GetTimeAtPositionOnSpline(Splines[i], SoldierPositions[i])+DeltaSeconds*Speed), Splines[i])
}
i see. can you tell me if there is anything wrong with using this similar technique:
Attack -> Calculate Splines to Attack -> Output splines to Event (event graph), like lerping units that has a set timer -> Use set time event to lerp units.
Something like that
Attack -> UpdateSplines.
Tick -> MoveAlongSplines
That is, if splines are always what you move along
if they aren't
then you'll have to do some more stuff to convert splines to TargetPositions or whatever
The moral of the story is, on tick, loop through the bigass arrays and update all the positions. However you want to do that.
yeah i see the issue here is, any deviation from the actual functionality of the event, means another event
You need to decide if your dudes always follow splines or not.
They can follow just 1 spline btw
you can store their offset to it
and use scale to drive width of the column
However you end up doing it, it'll still look like this at the end of the day.
Tick -> Move dudes
so yeah, this would be to be able to reuse the event. but it wont hurt to also create another event function to just move straight ahead
right?
Keep the movement logic the same.
Just change how you feed it the data, whatever that is. Whether it's MoveDirection, TargetLocation, SplineToFollow, whatever
I'd use TargetLocation myself, and generate that from the spline. Singular spline, you can have one spline drive the whole thing, depending on how you want things to behave
this is a model i made
its not exactly the same anymore
but thats what its happening more or less
but that was all in the event graph
in a project i did just to test it
now i made it in a function, dummy me ๐
Any quick way to do "something every X time" on key press and stop on key released?
i can't find the "Is key down" node for some reason
Gate and delay feedback
Press -> Open Gate -> Enter Gate -> DoThing -> Delay -> Enter Gate
Release -> Close Gate
I tried using gate but couldn't figurate out how to, thanks!
So you're trying to support pincer etc, not just column width?
yup thats the word. pincer
column width? how is that one?
you mean frontal attack
it works in both
but was a mess to come up with
I would do it with 4 splines, and every soldier knows their desired left-right position in the column.
so a soldier has a left/right offset and front/back offset
This is what i ended up doing
now i call lerp spline paths
is there a way to activate this in blueprints?
Nope
In Lyra can you Add/Remove/Change teams in Blueprint?
c++?
okie thank you!
No worries! It's called bNotifyRigidBodyCollision in case you ask
AttachTo: 'path' is not static (in blueprint "ArmyPlanesAdjustable"), cannot attach 'path...NODE_AddSplineMeshComponent-0' which is static to it. Aborting.
Im trying to attach a spline mesh component to a Character. But i get the above error.
@jaunty summit Wait, is that why the hit events are so spotty.. they need activated in C++?
I swear they catch like 1 in 5 blocking hits at best
Nope, that's some other property you are referring to. It's called bGenerateOverlapEvents
Has nothing to do with this
this works
Hmm, shouldn't be the case
whats the difference between a function and an event (aside from events cant return values)?
and also whats the difference between message and non-message interface nodes
Oh forgot checking if there are some setters around ^^
Good find!
At least the cpp name helped ^^
apparently this isnt a thing in ue5?
definitely! thats how i was able to find ๐
Ok this seems like a good read, as it has been referenced a few times here: #blueprint message
Made me wanna read it
I'm trying to spawn an attack on my cursor location but it seems to be very off/random. Is there a better way than "Get Mouse Position"?
It is. Event Dispatchers and Interfaces are still a thing for sure
Using Interfaces, you can use the Interface Message and the Interface Call node (I always use Message). However it would be good to know the difference between these two nodes. For somebody who knows the answer, this is probably a pretty dumb Question, but I donโt and I canโt find any info on it (most likely because the difference is obvious). ...
See Shadowriver's answer
can anyone explain why this doesnt work? the linetrace works
I am able to do it with string === but it doesnt work with multiple actors
pls tag if you have any ideas
@jaunty summitOverlap events are for collision set to overlap. Hit events should be firing off blocking collisions afaik, but they are touchy on a good day
@junior hedgeBecause the hit is returning an actor type reference. Not a reference to the turret class type
right, how can I get the reference?
cast
Oh my bad, yeah then could be the issue really ^^
You only know you have a Thing.
You don't know the specifics.
You cast Thing to TheClassYouThinkItMightBe to see if it is.
I don't understand?
I did this but only works for one actor
would I make a for loop and get ALL actors?
i mean the (Message) nodes, us5 seems to be missing them and only shows 1 node for an interface call
Back up, what exactly are you trying to do?
So why is that hooked up to BeginPlay?
What actor is all that blueprint inside of?
isn't casting performance intensive? why wouldn't i run on beginplay?
Because then you'd have
"When play begins, it'll do XXXX" instead of "When I shoot my gun, it does XXXX"
none of that is linked to beginplay
it's a simple linetrace
only thing hooked up to beginplay is the cast
the linetrace isnt the problem though so I didn't include it
OK so why are you getting a turret at begin play?
Are you trying to do this?
Line trace -> did we hit a turret? -> damage it
because casting is performance intensive I've heard so it wouldnt make sense to run the node everytime my gun shoots (30 times every like 5 seconds)
no it's not. It's an actor anyway, you can call damage on whatever you hit without casting
Event Any Damage is on Actor
a 6 casts a second is literally nothing
I have a variable called "HP" That gets deducted depending on the weapon you are using
I don't think you realize my problem though
Ah I see what you mean. Why would they not be in ue5 though? 
I need to use add component by class, instead of add spline mesh component.
But its not working. Nothing shows up. It only works if its Add Spline Mesh Component.
Prolly #ue5-general might know better
Your options are to cast the hit actor to Turret and call Turret-specific stuff on it, or use an interface, or just hook into the Event Any Damage that you get from Actor
What is the output type of that Add Spline Mesh Component node?
I tried ConvertMouseLocationToWorldSpace instead of GetMousePosition and now it seems to spawn on my camera and not where my mouse location is
is there a way I can stop a for each loop early?
that would solve my problem completely
Are you for eaching over every actor in the world?
it's 1 actor but multiple spawnedf
It printed this:
ArmyPlanesAdjustable2_2.SplineMeshComponent_0
Are you trying to damage the turret you hit with the trace?
yes
ok so you have 3 options as said before:
Cast Hit Actor to Turret -> Do your custom event
Call Add Damage on Hit Actor, you'd implement Event Any Damage on the turret to respond to it.
Call YourDamageInterface on Hit Actor, you'd implement YourDamageInterface on the turret to respond to it.
The 2nd or 3rd approach would be best if you ever want other things to be damaged as well. You'd just implement Event Any Damage or YourDamageInterface on them and they'd work.
No, what is the TYPE?
Is it just ActorComponent, or is it a SplineMeshComponent?
the output type
If it's ActorComponent, just cast it to SplineMeshComponent and carry on
BP should know the type though if it's static like that.
sorry i dont understand. Its a spline mesh component, i think, put in the Add Component by Class.
Mouse over the output pin, what does it say
You're mousing over the output pin of Add Component by Class, right?
Anyway, just cast that output to SplineMeshComponent and carry on
Sometimes Add Component by Class might not catch that you're not gonna be changing the class at runtime so it doesn't know it can return the concrete type
Just cast it, does it work?
no
Show the error
it doesnt make error
it just not rendering anything
it says its not necessary to cast
the issue is because its Add Component By Class
the Add Spline Mesh Component works
But i need the Add component by class
You might need to re init something on it since you're changing the mesh from nothing to your pipe
Why?
Because im doing it in an Actor Component, where i have specific functions
And in an Actor Component, you cant use Add Spline Mesh Component
You must use Add Component By Class
Thats what we found out today
Unfortunately its not working ๐ฆ
So i cant see my splines
That sounds really spaghet
What's the usage, what is all of this supposed to be doing?
I mean you are saying to cast a hit actor to turret but I cant actually get which exact actor was hit
this is what I was asking
Now, its supposed to just do the Spline Meshes so that i can see my splines
For the Spline paths
Yes you can, it's in the hit result
there should be a draw debug spline ๐
@faint pasture
What actor is doing this line trace, and what actor is it trying to hit?
Do you know what casting is?
the rifle is doing the line trace and it is hitting a random actor
And you want to know if the random actor is a turret, right?
not only that I also need to open the event in that actor
that's EXACTLY what casting is
"Is this random actor a turret, and if it is, let me do turret things on it" = "Cast RandomActor to Turret"
hey so im having this issue if i rename something in my file directory it seems to break everything
Did you rename it in the unreal editor or just rename the file in Windows?
windows file editor seems to break
ya fucked up
rename it back, then if it works, try rename it in the actual unreal editor
so unreal doesn't lose track of it
because it breaks you recon i could split the file into chunks it will work?
or move it in the editor
Changing anything outside of the editor pretty much breaks the project
is there any way I can delete the mesh that's attached to the character BP?
Except like debug settings maybe but that's about it
thank you !!
thank you!!
i got it to work
np
K now start using source control
B-but multi user editing master race 
I can't seem to figure out why the speed doesn't get changed as soon as I start attacking, it always seems to do it only if I rapid double click, It works fine if I don't have the launch character so unsure if that cancels the max speed function out
(Current value is a test one)
Show the whole chain
Since UE4.
It's from the built in Character class.
ACharacter to be precise
Character and CharacterMovementComponent are tightly linked
i dont see it anywhere
the defintion
i right click and click it but nothing happens
Because it's engine code.
Vanilla launcher builds don't open engine C++ codes.
thanks for info
IDK but that's a kinda fucky way to do a combo lol
ok one more thing
It's meant to be like a simple ish combo where it cycles between different animations based on button press/time didn't know any other way to do it since I didn't wanna make a complex system for it
how can I temporarily disable "gravity" for my character
I tried disabling it via the details panel but my character still drags to the ground even then
404
i have to make my mom verify after clicking that LOL
lmao so pretty sure my cousin changed my age on my account to 10 cus I was letting him use it for fortnite
rip
still asking for this btw
manipulate gravity scale in character movement
thx i didnt see this but thats what i did
Hey, i've found a value that i'd like to use in a blueprint.
but as far as i know, there's no function for it
can i make one myself? is it even possible?
you can make a ufunction to retrieve the value, you probably dont want to modify it though
i just want to retrieve the value and use it
is the property public?
then you have to create a childclass of the movement component
and have your character to use the child movement component than the original one
ok, then put that value in a public space i guess
to do this you basically have to make your own character class
you need to make a public ufunction to return the value
tried to do it under other public ufunction
so now i have to compile it / make the character movement use this child class?
Was hoping someone could help me out: Is there a way to add an interface to an animation blueprint (event graph)? I have an character controller taking axis input I want to send info to/from the animation BP to correctly fire animations
I see where to add it, under class settings, in my first BP but not the animation. If it helps, they're on the same player. Just need these two graphs talking to one another
under Class Settings
you can cast the bp_anim in the character blueprint and then call an event to send the info
yeah BPI work too
I'm not seeing a class settings button in the animation blueprint
Checking again but that's what I was looking for. I'm in UE5
yeah, basically you have to override Character.h to use your character movement instead
๐ should have, still in ue4 so cant check for you
Thanks IAsaka
dont work on master pose
i'm an ue4 prisoners' too, can't switch to ue5 since my project use plugin that haven't been updated yet
This is what I have:
look inside here
I'm on like a 48" monitor but my vision sucks so I have everything blown up
bpi and direct cast both are fine
since your character bp will definitely have reference to the abp
Is there a way to pass values through bpi or is it just firing events/flags?
I know you can cast to for direct stuff I think
bpi can have inputs and outputs
just like any variable
but no delegates though
I need to figure out how to add that
Since my "logic" is in my animation event graph and not my input collector
I'm coming from Unity so I appreciate the hand holding. Things are scary here. XD
So I have a float value I promoted to variables on my inputs. If I do "cast to BP_Anim" how do I catch that cast properly?
Might've already answered (lemme look at that image @next oyster sent a second ago)
to get your abp from your chara bp
I needed my abp to get from my chara bp (so opposite direction)
ah
Effectively I have an isMoving bool in ABP event graph. It's supposed to flag "true" if I'm inputing Axis movement
Character BP collects the axis movement.
hm, your character BP should know isMoving bool before your abp though
I can make a new bool for isMoving in my chara BP but I can't access it in ABP unless I cast it I think
I have two floats in my chara BP I can't access natively in ABP unless I BPI or cast I believe
you have 2 choices here
you can either let your character bp update the ABP whenever a flag is updated
or you can let ABP to retrieve the value by itself every tick
I was planning on the latter
Since my logic is currently in the ABP event graph
I don't know what's good practice for Unreal though. I just had animation logic with the animator
And character holding all the basic stuff
there are pros and cons
but for most part if performance is not priority
you can always just do this
in your abp
Okay. Lemme look here.
So "casting" is actually an attempt to retrieve and not a broadcast?
Like if you cast a youtube video to your smart TV you're broadcasting but here it's the inverse?
Yeah I hear that. Like if you try to cast an int as a float
yeah
so the TryGetPawnOwner() functions returns a Pawn
your character BP most likely is a Pawn too since Character is a Pawn if you created from the subclass
you now have the reference, but it was read as Pawn
Pawn class doesnt have your boolean variable
your CharacterBP has it
Ahhhh
So cast is just talking about the attempted conversion after retrieval, not broadcasting and such
Interesting. In unity that's like
float axis = GetComponent<Trasform>() as float;
Or something
Still trying to put it all together/rewire my brain XD
AMyCharacter* Character = Cast<AMyCharacter>(TryGetPawnOwner());
<AMyCharacter> being the Target in the node?
the data type you are casting to
target is within the () which is TryGetPawnOwner()
How does one delegate what value you're actually attempting to get if, say, there's multiple floats on the pawn? I might be looking too much into it
you are getting the reference to the pawn
not the variable inside the pawn
to do that you can just do
if(AMyCharacter) // Just a simple pointer valid check
{
bool bIsMovingVar = AMyCharacter->bIsMoving;
}
Gotcha. That makes way more sense to me.
I've been coding for like 9+ years and so jumping to visual stuff like BP is so foreign to me. Difficult to tell what's going on
lol
In unity that'd be like:
bool isMoving;
if(playerZero){
isMoving = playerZero.isMoving;
};```
Right on. I want to learn the C++ stuff also but I'm doing this first to get the feel for both.
C++ was my second language but I haven't used it in like a decade lol
My guess is the cast to node is just mixing that functionality we programmed.
Yeah I hear that.
technically you can just like in primitive days
do a direct cast like
AMyCharacter* Character = (AMyCharacter)TryGetPawnOwner();
but that crashes if it doesnt match
so yeah Cast is to replace that for all UObject types
It's the same as C++ really
hi guys , i have an npc character class that im trying to enable input on but whatever i try its not working ive had it work properly in an actor class though
I've heard that
There is some noticable syntax differentials but that's still reassuring to hear
Why are you handling input inside an NPC?
isn't that the whole point of the NP part?
so its not really input, i just want to check if the player is overlapping it and if it is and E is pressed then bring up the dialog screen
you want to have your interact input from your character
character check for interactables
Am I able to access BPs are C++ any time or do I need to make a new project for that?
if there is, call their interact interface
you can use both at the same time
because you are not controlling it ๐
then how does it work on actors? i don`t control those either?
but it does allow to have keyinputs
NPC are not supposed to be controlled i think
key inputs always comes from the player character/controller
it goes wherever it needs later
ok thanks for the help! i`ll try to approach everything with that in mind
That's awesome lol
thats also usually best if you have a team of different capabilities and role
I can dig that.
but the relationship is quite one sided
you can access cpp stuff from bp if you exposed them
but you can never access bp created stuff from cpp
say you have a Character BP class created in BP
you have no way to reference it in CPP
but say you have a character CPP, if its marked blueprintable and blueprinttype, you can access it in BP
this is essentially how BP works in general
they are wrapped CPP classes, its a CPP base afterall
Right right
So is there stuff you can only do in CPP?
Or can you do everything in BP and/or have custom nodes?
if you can make the custom nodes, then yeah you can do most stuff in bp
there are some limitation, not everything is doable
as you do along, you will find them out ๐
That's what I'm hoping XD
Probably better to just learn BP overall since you can't access BP from CPP
XD
is there any reason why when i apply damage to my AI with the base damage at 1.0 and set the health of my enemy to 100 that it kills it in 2 shots....?
double check your receiving damage functions?
it seems right to me?
Sounds like Unity to me. XD
So I have this. Whenever these aren't zero it's supposed to update if the players has movement boolean
I have an interface with a function attached to this + the ABP
the function has a boolean to use for this
What do
oh you dont really need to have the tick
You don't? I assumed you needed that for it to update.
if all you need is to check whether the player is moving
you can check with GetVelocity()
could someone help me if i post the code?