#blueprint
402296 messages Β· Page 865 of 403
Just do some sphere traces
you'll hit landscape like 50% of the time, that's plenty
or use Try to Adjust Location in the spawning
depends on how close to a tree you consider "too close"
all up to you bb
I'll give it a try
Another way I can think of with very complicated landscape and various landscape objects is to run a simulation of a large number of capsules falling from the sky, and record their final location, store them in a data file and loads it when the game really begins.
That's exactly what a sphere trace is
yeah you can prebake it if you want
A capsule is just a swept sphere
Ye i'd prebake and curate to rule out the gimped spawns like a dude on the peak of a mountain etc
yeah
the simple sphere or capsule trace can place players on slopes where they'll start falling immediately
You can filter all that out with normals etc but yeah.
oh sure that's another way
It's sorta like a query
select from landscape where normal.z > 0.8 and z < 2500 and etc and etc and etc
Hi, I am asking for help. Created a simple activator based on on hit event. This is the arcade racing I am working on. I want to make UE4 change "on the fly" the default vehicle pawn Car_Player_Cop to somewhat of crushed vehicle variant Car_Player_Cop_Crushed - for 5 seconds and then back to the default one.
on even hit > set static mesh
I have created secondary BP for crushed vehicle version
nah
yeah, it is meant to look as it looks π
hello, can anyone boast of how much MS the plot of the game takes?
just scale the mesh when crushed
this will be a game with some humorous vibe
You can do it with a timeline.
Event -> Play timeline
Timeline scales the mesh down then back up
I don't know if this result is okay: /
the scale is not the effect I look for
I have rigged the variant, so it looks and works exactly how it's meant to work
OK then just swap the mesh out
do not spawn a whole new actor
I'd use scale or animation though, so it can happen over a short time and have bounce etc
I know it is hardware dependent too
hmmm
I don't think this is the way to go in this case
This should work for static, unmovable mesh
literally lol'd
but this is the skeletal mesh
@dreamy yachtWhy are you casting other actor to cop? Which actor is the pawn and which one should be getting flattened?
Should it be "When the player's pawn hits a cop, the player's pawn gets flattened"?
i am casting from the test object ( some activator in form of actor, placed in world )
look
maybe, this should be more straightforward
I activate group of rocks, which fall down on the road
ok got it. The player's pawn is the cop car. You should check if the other actor is the ROCK, and then flatten itself.
or the rock can check if it hits the COP then flattens the COP
what you showed last is checking if the other actor is the COP, then flattening itself.
If any of the rocks is hit by player car ( or any other car, but let's keep it simple and limit it to player_cop_car for this moment ), then the code is fired and the car mesh gets swapped to flattened one
I would make an Event Flatten that handles all the flattening stuff
Then just call it when it makes sense.
had to move away for the kid, The valid doesn't register, it seems the Character don't want to read the variable
You can 100% accomplish this with scaling though. - the effect using scalling will be similar, but wheels will stay on their position, so there will be no real difference seen from the top down camera
I have to swap the skeletal mesh tho
https://gyazo.com/2ac826dd00fe6ac313bf48a3c8d31aef?token=e76740868bad6dc09e2c7a2f723e8333
how would i set has seen to false if the ai loses sight?
successfully sensed will be false when sight is lost
How can I plug spherical coordinates into the procedural mesh generator? π€
yeah how ?
It... just is?
the perception updated event gets the value as a parameter from the perception system
the value is false if the update was caused by loss of line of sight
just connect the value to the set value as bool thing
to the bool value pin
So I have a Boolean that indicates whether the player is jumping or not. I set it when the jump action is pressed. I've linked it in my animation event graph in order to play the jump animation. I'm running into an issue where if you hold it, the character jumps correctly initially and then it loops the animation. Turning off looping causes the character to freeze in pose when holding jump down. I've tried using the Can Jump function but that did not work either.
hey!
works like a charm when I test it out manually by pressing 1
I need to find out what to cast in order to make rock fire the flattening code
Rock casts other actor to car and calls the flatten event
2 nd question: at the end of the chain I want to add some vertical force to the car, which will make car hop up a bit ( 2-3 meters )
thanks I'll try
2 nd question: at the end of the chain I want to add some vertical force to the car, which will make car hop up a bit ( 2-3 meters ), how to?
How is it moving?
If you're using physics, just add an impulse
damn
i never know if it's physics or chaos
4.27.2
LOLed so hard !!!
LMAO π
Holy moly! Everything works! Thanks guys π
activator ( rock ) falls down on car and flattens it, then after 3 seconds the skeletal mesh comes back to normal one and the pop sound is played, next the little hop works aswell
okay
is there like a "set multiple booleans" node?

this is probably not healthy.
i'm not feeling happy
there is node that will uniformly do that for you unless you put them all into a boolean array
Hi i asked this in animation and i guess its related to blueprints too
I want my animation to play a portion of it when i press a button then pause and continue from wheres its paused when i press that button again , and print string if its done
i guess an array could work but damn would i need some documentation 
because sadly all of those booleans are actually needed
you could try and abstract them into states
using enums
one more question regarding the flattened and normal cars
I want to temporarily change the controlls and vehicle parametres ( torque, mass, steer angle etc. ) when the flattened mesh is active
can I cast somehow to normal vehicle MovementComp
?
use states
Make a Boolean or enum that represents the state of the car (bIsFlattened, ECarState, whatever) and then make an update event that handles that
So flattening the car would look like
UpdateCarState(ECarState=Flat)
Then the UpdateCarState event would change the mesh, swap stuff around, change the movement component properties etc.
hey guys, would someone be able to point me in the right direction with playerstart? i created this space level, and put a player start on the plattform but it keeps bringing me to 0,0,0 and doesnt spawn in the character
Is it outside of the level bounds? What's the position
i have it targeted there on the picture
those look like some big numbers
they are lol is that too big?
yeah
so
it's UE5
I'm not sure what the deal is with world partition
but ordinarily
you could rebase the origin
you'd have to do that in the game mode
ah, so if i can do that ill be good? im trying to get to the point where i can add a ship into it and fly it around but i need to get it to spawn correctly first
it really depends on your setup
you could also fake the earth if you never use it for anything but a backdrop
you could also try world partition and see if that actually works
but other than that, yes you can rebase it, if the option exists in UE5
maybe you already checked it, but have you set it up in the world settings?
Does it quit breaking if you move the spawn point closer? I'm pretty certain there's a level bounds setting somewhere.
not sure what you mean?
We have a system somewhat similar where the player travels from orbit to the surface. We just put the surface toward the bottom of the level bounds and the orbit toward the top and it worked out for us. But we're not doing anything fancy with really big levels.
level bounds are bound by the bit limit of floats/doubles
Let me open unreal, but you must set up starting point in the lvl settings
I've never heard of this before
game mode is responsible for spawning, not level/world settings
do you have more than one starting point?
Lmao
I was meaning world settings lol
I mean I'd still like to know what you mean just out of mere curiosity
yeah it worked once i put him in at 0,0,0 on a new platform lol ill probably just move the earth/moon to a new location and spawn the player in here
thats the inside of the earth there lol
I was thinking about simple stuff becouse it's usually the problem, like having 2 starting points, not the right game mode in the world settings, or a player character somewhere in the lvl that forces you to possess it
Yeah if the Earth and Moon are just backdrops and not used for gameplay, then do that.
ah the game mode in the world settings. fair enough. that's an override btw, it's only if the game mode needs to be different than it is in your project settings
try to put the character on the coordinates and possess them at game started on the bp lvl
yeah im making a space game thats going to be pretty simple but some complex things in it. Think galaga but in first person
Duh, but I meant maybe they changed it for some reason or has a different character
thanks for the help guys π
put this in the lvl bp and add the character at the location you want to start
im def saving that screenshot for later but i already moved the earth and moon, looks decent now
I am pretty sure you may have a third person character at 0 0 0, that prioritize the possessions, so they do not spawn a new one
i was able to start spawning in once i moved the platform to 0,0,0 and placed the playerstart there
hard to tell you since I don't have access to the project, but trying to possess the pawn maybe will help, maybe is something that happens because UE cant load that far and can't find the starting point, have you tried what happens in standalone mode? because this may be just an editor error
is there anything that I can use for names to check if anything is inside/its empty/default value?
this?
you can try right clicking on your Name variable and Convert to Validated Get
maybe that will work
(maybe)
I only get a ,,promote to variable,, option 
then what you have is the next best thing. you can use the != version to branch on true instead of false
thats a relief, thanks for the help
How do I add a variable to a call?
You have to modify the event dispatcher. When you have it selected you can add inputs:
Where do I find that? Sorry
Actually I think I found it π
Why is it giving this note?
@dawn gazelle
Guys, why doesn't the E button work at all in the crouch? I changed the button in Action to another one and everything works, but it doesnβt want to work with E
The value passed through it will be a copy, not a reference to the original object - so it's ok to read the values from the structure from anything that is bound to the event dispatcher, but you can't expect to write back to it.
Should be fine
anyone know why i cant select this??
Not sure what you mean by can't select? You should be able to drag and drop the Enum you want to use into the highlighted box, or select it in the drop down list.
May be a #ue5-general issue then.
How can I attach a player to a character without moving the playerβs camera?
can you elaborate? you mean possess a character without changing the camera?
is this better?
So it spawns actors on the spawn points for 10 times?
It is worse 
it is perfect on my screen when i click on it
I'm just kidding
yes. it seems to spawn different types of actors across different positions up to spawn amount
from what I can read
Second for loop is spawning the actors on spawn point actors' location
the first for loop seems to be based on whatever is in the SpawnerActor array. I would assume they would be different types of actors
but the logic is very error prone
the first array is set to be 0..9 always but the amount of actors could be less than that, causing errors
or more than that, and not be counted
It's weird that the first For Loop is not For Each from the Spawner Actor array.
Seems like sloppy translation from C++ code
its a spawner for the same eneimes to spawn in a circle around me
in 9 different locations
in each of the 9 locations i spawn 5 actors which is spawn amount
why not use a foreach loop on the array?
this is old code, i coverted it to c++
I KNEW IT
okay so what are you asking?
what the first for loops are essentially doing
Use For Each macro instead
because i forgot why i did this
it's running over the array of SpawnedActors from slot 0 to slot 9 and taking their locations as spawn points
but again, you'd be better off with a foreach loop in this case
I suspected it was a sloppy translation from C++ code, I was right lol
or if you need to spawn exactly 9 locations, have that done mathematically instead of using actor locations
wasnt from c++
i coverted the bp code to c++
so the second for loop is spawning the actors on the spawn point right?
yes
but again, the code is very error prone so I wouldn't consider porting it over
i was wondering if someone can help me with something
i'm making a 3d platformer and i'm practically brand new to blueprints but i was wondering if there was a way that i can implement a double jump that carries momentum on the second jump instead of just jumping twice and trying to drift the other way
kinda like banjo kazooie
Guys, can I normalize a vector to make it have a magnitude of 1? I found the "Normalize In Place" node but I'm not sure if it does that.
Normalize
There's a few double jump tutorials on YouTube, have you tried any of those? Goodluck
how to get simple variables stored in the level blueprint?
I tried interface calls ,doesn't work
I'm sorry, my english is not very good, what the tolerance does? Should I modify?
You should save them to your save game blueprint and then load them when you need tbem
You should be using event dispatchers
Thanks I'll try this.
It's the tolerance that tells if the vector is too small to have a non-zero magnitude or not
So a vector that has a length smaller than the tolerance will have a magnitude of 0
You can leave it as it is
what is VolumetricFog in gpu profiling
Thank you so much Wizard :D
i dont think i could find what i was looking for
literally all it is is carrying momentum in a second double jump
I'm doing this vector with two axis of movement, vertical or horizontal if held alone equals to 1, which can be a problem if I'm walking diagonally with my character, as it gets faster. That is why I asked about the Normalize, so it would normalize both axis if held together, even if walking diagonally. Somehow it is returning this amount, which is smaller than 2 for sure, but still faster than going only on one direction. Shouldn't it return X=0.500 Y=0.500?
Walking horizontally adds 1 to Y and vertically adds 1 to X on the vector
This is the blueprint that I'm testing this situation. π€
0.707 is what it should return.
Math time: length of vector = sqrt(1^2 + 1^2 + 0^2) = sqrt(2). To normalize you take the vector and divide it by it's length, so: normalized vector = (1,1,0) / sqrt(2) = (0.707, 0.707, 0)
No not possess, only attaching the player to a character. When I attach the camera snaps to the new attached location.
Thank you so much for showing the math formula, I had understand completely wrong before, I appreciate it!!!
When the player is running in the 3rd person template, if I move the mouse left and right the player moves left and right. How can I prevent that?
While pressing the W key?
What do you mean by attaching a player to a character? This is not an understandable statement
yes
You attach the player to a character using AttachActorToComp to a socket.
Ok this is the intended behavior there and in all games
There is no such actor called player. What do you mean by player?
You might wanna show code
is there something like random integer in range that instead gets all integers in range?
You want to return a new random integer each time?
i want to change all element index with one set material
Ah so you want to iterate
Check For Loop
If you want the number of the materials to use it as Last Index, then use this: https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Rendering/Material/GetNumMaterials/
Get Num Materials
Well note that: Last Index = Get Num Materials - 1
it worked thanks! π
drawable/icon_round exists in that folder destination.
but gives this error.
I enabled ads plugin
How to solve this?
i keep getting accessed none error when trying to use this new player controller reference for multiplayer, anyone know why (this is on event begin play in character bp)
Beginplay runs on every client. Every client only has one single controller and that is their own. So if another player's pawn runs this, controller is null.
Normally for client side information you send game wide things through PlayerState, and pawn related things through the pawn.
so if i made this reference in the player state it should work?
When you start a multiplayer game with three people. Lets assume a dedicated server. There are four machines running the software. Server, Player1, Player2, Player3. On the server, there are three player controllers, and three pawns. As you would expect. One for each player. On each client though. Player 1 has three pawns, but only one controller and that is Player1's controller. Player2 has three pawns but only Player2's controller.
So when you run code in the pawn for Player1, on the machine for Player2. GetController is null.
That's why he should use IsValid node
I think if you use GetPlayerController(0) it would work
when i had that it was only working for client 1
You shouldn't use that node in anything related to networking.
Do a Switch Has Authority and use Remote pin on begin play before you use it
this is for spectating, so its asking which player controller wants to possess the camera, and when i had get player controller (0) it was only working for client 1
Why though
Well yeah, it's a dirty fix
Because of exactly what I said above. GetPlayerController0 gets the local controller. And sometimes on listenservers it can fail and get a client's controller. But even assuming it works correctly, you will not get a controller associated with a pawn. You'll get the local controller. Stuff that requires the local controller already has access to it. UserWidgets have their own call. AHUD has it's. It's all client side only stuff and there's no use for it.
Wait, so when you do this, are there pawns that are not possessed by player controllers?
In networking, trying to use the local controller just confuses the code structure.
i destroy the pawn when i possess the new one
Are you trying to make a death cam where the camera follows another team member after death?
yes
Well I have a similar system already implemented in our game, but it can't be done in BP.
everything works perfectly for client 1, but not the others, im assuming because it's controller id 0, but if i try other things for my controller object reference it does access none
All you have to do is get a list of pawns you can focus. Get the index of the current target. If none use zero, Add one with a wrap around check for max index. SetViewTargetWithBlend
It's probable that you could filter the list of pawns through their playerstates, all contained in the GameState's PlayerArray
^ Also you shouldn't be caring about saving a reference to the PlayerController in your Character BP as you should be using the PlayerState as Authaer noted and you can get the PlayerController from the PlayerState using GetOwner()
Random fun fact. I have no idea why it is not accessible to BP. But Epic already has this entire system in PlayerController.
Haha yeah I had no idea when I first created the system either
Look like they wanna force people to use C++
Would probably be as simple as putting a BlueprintCallable tag on ServerViewNextPlayer, and converting GetNextViewablePlayer to a BlueprintNativeEvent I think.
Yep
making the reference in the playerstate got it working, you guys are heroes
A new pull request in the horizon?
To be honest, I'd be shocked if it went through. They're really pushing hard for the new GameplayAbility stuff. I'd be amazed if it wasn't moved to that.
Yeah probably. I think the system was mads since the early days of ue4 and they barely touched it since then.
The system got some flaws, but overall it's nice how it works out of the box
I haven't used it much yet. It did inspire me to make a small system of my own to make some better organizable code though. They're blueprint async nodes that can pick a blueprint subclass. Basically each node spawns a tiny UObject and runs it. Has tickability and latent access. They're more or less AI Behavior tree tasks, but usable in normal blueprint.
Personal project is all singleplayer though. π GAS is very heavily intended for multiplayer stuff.
I see. It's cool to use the async stuff if you really know what to do with them. I haven't touched them much, neither did I touch GAS. Though π GAS
How do I get a boolean of (is the certain button pressed)? Or do I need to make it myself?
By button you mean Button in a widget or a key in the keyboard?
a key, sorry
Then there is an event just for that
But that's not what you asked
Is Input Key Down
This is what you want though
maybe I'm just doing it wrong, but I want to do a function every tick the key is down
thanks, exactly what I need
Hey folks
What is the best way to manage game UMG widgets? should I manage it in character or controller, or should I do it in HUD class? Which one is more standard and does it make any difference in performance?
Performance, no. At least not directly. Generally I advocate for people using AHUD. Gameplay classes should never be aware of UI.
It doesn't make any difference in performance, it's more of a best/bad practices
PlayerController would still have to talk to HUD, so it will have some UI-specific functionality
PlayerController is a networking class. It's already going to have a ton of stuff in it. Cluttering it with UI stuff isn't a good idea. Not to mention it can cause bad practices with UI where networking is concerned.
PlayerPawn/Character is never a good place for UI. For the same reason any other gameplay class is. Gameplay classes should just exist and do their own thing. The framework that uses them and they themselves can use delegates. UI can use these delegates to handle itself.
HUD is local only. There is no networking here and there is one per machine per player. It is also very easily globally accessible from anything that can get world because you can get the local player controller and GetHUD on it. You can make a library function out of that for easy HUD access.
UI should generally always be an abstract layer above your gameplay core and entirely separate for a few differing reasons. One is ease of use. If you've ever modded a game, you'll know what an API is and why that is important. The other reason is asset references. If some gameplay class has a reference to a widget class, it also references all of that widget's assets even if that widget is never used. Which means those assets always stay loaded as a CDO. Bad memory management, and UI can take a decent amount of memory depending on game scale.
In case I wanna show some widget, or change some state in an enum that I have in my AHUD derived class, and I'm the server PC then I would still need to use Client RPCs that are defined in the PC. It's not that the PC doesn't have any UI-functionality at all?
I think that it depends on the state. If it's an authoritive state, you'd usually just have the networked class(PlayerController, Pawn, etc, no matter) replicate, or RPC the state and set it and then call a delegate. It's up to your UI/HUD to set itself and bind those delegates on beginplay/construct and then set up the state of the current game that it knows about.
For network related UI. You'll be doing a ton of GetSomeActor->BindDelegateToMyFunction->CallMyFunctionWithCurrentState
Yes exactly, it only changes a state/calls a delegate in the HUD, and the HUD does the rest
Which is bad?
No, not bad. Just common.
There's usually nothing wrong with gameplay classes calling HUD even to do specific calls. But me personally I'd still have them do that for a code only base class with zero widget references. I hate having references tied to other things that don't need it. C++ base classes with BlueprintImplementableEvents are great for that. Just as long as the actor itself doesn't spawn a widget and use it.
Above point is also the reason I have zero issues with casting to whatever I need and why I advocate regularly for people to NOT avoid casting, but just use it correctly.
Exactly, that's it, storing references to widgets in gameplay classes is bad. I just wanted to make sure they aren't 100% UI agnostic
Agreed. I literally love casting. It makes more sense to me than using interfaces intensively
I have a problem, I created a player pawn for a FPS project but forward/backward movement speed depends on where you look. How do I disable that? FP character in FPS template doesn't have that but I still can't find the setting
That's not a UE default I don't believe. I'd check Tick or the InputEvents for it
UE default as in I don't think the CMC can do that. At least not that I'm aware of. Usually it's the character handling it based on control rotation versus velocity in a tick function.
I think I found the problem
yeah lmao I was getting a forward vector of camera instead of capsule component
You'll still need to do some maths on it if you want it to work on slopes
unless you plan on rotating the capsule to match the slope I guess :)
Hi, I got some data for the mannequin it is in JSON format what i want to know is how to send those values to my skeleton via gamemode and make it move accordingly
dot product absolute up vector would be 1 to -1 , allowing you to have some constant factor to multiply it by
So Speed = Speed + (RateOfChange * (DotProduct * -1))
You can also use map range clamped or such
Eg. you can map angle range -90 to 90 into -1 to 1 with one node :)
i'm trying to implement a camera that makes it so it zooms in on the player's head when the camera is pushing against the wall to prevent it from clipping through, how would i make that blueprint? i can't find a video or anything
Lazy way is a spring arm. If you want something less linear, you need your own system that traces and ticks your camera location.
i know about spring arms but i can't find an option so it does that, it zooms in but it's over the character's head. i think it has something to do with the rotation of the camera but i tried it and it doesn't work
can someone explain or send me a link where i can find explanation on what "Consume input" is? I can't find any videos on youtube nor explanation about this in the documentation
All a spring arm does is a trace that lowers it's endpoint based on trace length. If you want it to zoom to the player's head, the start point of the spring arm has to be at the player's head with the camera facing it.
consume input does take the input and nothing else can react to the input
but it's kinda pointless as you can't really tell what gets the input first
unless it's UMG where there's a hierarchy
There's a gameplay class hierarchy as well.
there is?
well ok, the player controller ticks before the actor, so it could consume an input which the actor then wont get
ah in inheritance there's also a pre defined order, yea
if that's what you meant by gameplay class hierarchy
so once that input action is taken inside an actor its consumed and can only be used inside that context..but how do i unconsume it?
well, you can't puke it out, so don't consume it in the first place
Nah. Only tick that matters is the PlayerController. Player controller houses an array of UInputComponents. Called the InputStack. PlayerController ticks and builds an array of components to tick through. It organizes these in a particular order. Starting with anything that has had input explicitly enabled like a trigger actor. Then the Level blueprint, Then the Controller's own input component, and last is the controlled Pawn. Input will always be processed in that order. InputEnabledActors->LevelBP->Controller->Pawn. And InputEnabledActors go in order of the latest one to have enabled input.
wouldn't the pawn be in the group of inputEnabledActors?
Nah. It's explicitly put last. One sec.
Er, I was backwards on the controller and level. Goes Controller->Level->Pawn
until now i wasn't even aware that the levelbp can take input actions
Note that these are functions pushing their components to the top of the stack. So Pawn. Then Level pushes itself above Pawn, Then Controller pushes itself above Level, then starting from the latest to newest enabled actors, they push themselves to the top of the stack.
The third one there is controller's own.
when the actor is destroyed...does it unconsume the input?
It's Input component is destroyed, along with all other components.
Non monospace fonts always look so weird in code samples lol
InputComponent on Actors is Transient, so not all of them actually have one. It only gets populated at EnableInput call.
im not entirely sure what that means
that means that it wont consume input if it doesnt exist
as it wont be pushed on the stack
They have a pointer property for the InputComponent, but it's null until used. It's not used until you call EnableInput on an actor, where it will create an input component on that actor and send it's reference to the controller for storing on the InputStack.
however your questions are pretty vague, maybe it's better to explain what you try to archive or what isn't working as expected
im just looking at some systems i got from the store
and some of them have consume input on some actors
and i was wondering
like theres a gun
who consumes "fire" action input
because i was confused i didnt find it in the player character itself
yea see, if your actor can interact with items on left mouse button, but not while holding a gun (because the player would assume it to fire) then the gun consumes the input
so that the actor won't get the input to interact with something
yeah, which is why i was trying to understand when it is "unconsumed" π
when you unequip the gun it's pretty likely that the gun actor gets destroyed and put to your player inventory
at this point it wont listen for input anymore and the player character can receive the button click again
gotcha
thanks for the explanation! much appreciated
now it makes a lot more sense
Consumed is also an equivalent to "handled" in widgets
If you leave a mouse button override unhandled, widgets in the lower layers get a chance to pick it up :)
Today I discovered a feature introduced in 4.9 and I'm very surprised: (https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/MathNode/)
I've been working with UE for 3 years and never heard of it before
i should use that more often^
Feels like it has a similar implementation of Anim Graph's Fast Path implementation, because you also able to use boolean operators?
Weird tbh
okay-
Is there any solution to this?
This is because the root motion of my animation drives my character forward - and apparently forces it forward no matter what.
So incase there's a collision - it doesn't care and just forces it forward creating collision bugs.
https://cdn.discordapp.com/attachments/847253861403197471/957302078915620894/UE4Editor_fcNNRbg9WN.mp4
is there anything i can do that's not... Creating my entirely custom self made character controller? 
(they're both already set to "no" on the "can character step up on")
where have you been for almost 20 versions? π
excuses π
I think you'll have to resolve that on the animation side
how do you mean? Stop the animation once it comes in contact with something?
you can ignore collisions but it's just going to be a mess
Because i still want the animation to go on, i just don't want the collision to be buggy
yes make the root motion stop
I want the collision to act as if you just pushed 2 spheres against each other
not into each other
just against
I'd ask in #animation to see if there's anything you can do to improve the root motion
also try testing it with e.g. walls etc.
i already googled up and down the internet...
seems like it bugs out only when 2 root motions meet
that makes sense
sadly that's exactly happening when 2 characters try hitting each other
i guess i'll just have to delete root motion then and replace it with some scuffed "add force" node setup that just has the animation lengths hardcoded...
are you using animBP?
well maybe now is the time
and montages
because maybe it's something to do with how montages work
i got told tho that for stuff like hitting you're supposed to use montages...
by whom?
you can
you have more options with animBP than you have with montages
plus it's faster since you're not running animations on the game thread
oh you don't mean the anim graph, you mean the blueprint editor in the animation thingy
yes both sides of the animBP are essential
well in the anim graph i did do it, but i couldn't really use it for much
like for instance - at some point in my animation i set my sword to "activated" so it does damage on overlap - and deactivate it 3 frames later so it doesn't always do damage but only on my swing
that's why anim notifies exist
I would never handle that outside of animations
but for everything else, the anim notify can bind itself to events in the character BP
so that when a specific player action is invoked the animation automatically follows
so i don't have to use montages at all? 
you dont
montages are a cheap option but if you're making something like a combat system you really want to build a solid foundation
and montages don't allow for that
correct
but you want that
you don't want any animation to be played outside of the animgraph ideally
hmm 
that sounds reasonable
i did try to do that, but i remember there was some limitation in the anim graph that kept me
the way that state machines are build there are going to be some limitations, but if you know what you're doing they're not a problem
so you're saying i can still use anim notifies while playing animations in the anim graph?
I've on a few occassions seen anim programmers do masterful animBP state machines and I hold that as the gold standard for how you should setup animations generally
i see
whether the animation is played from animgraph or eventgraph doesn't matter - the animation is still played, so the anim notify still triggers
are there any ressources to get like... yknow, to the next level in terms of blueprints?
So many tutorials on youtube are for beginners...
there's hardly any ressources where people talk about actually indepth stuff
not really. what I can recommend is that you setup an enum for anim states, and use blend pose by enum
let me show you my current animgraph
or do you think it would be best to just get a budget and hire a mentor?
or idk... give favors
or something 
it's not going to be easy to find someone who has this kind of knowledge
dangit 
even among people who work in the industry I've seen it done wrong more times than I've seen it done right
i guess there really is a divide between professionals and hobbyists...
this is my current state machine
exactly
it handles everything by blendposes
so the way to think about it is to understand where poses can come together
e.g. running mostly requires the lower part of the body
so you can blend that with anything that requires the upper part of the body
sure, i started doing that too
Is the Interface for GameplayTags built in or is there an interface i need to add to my BP's? Things like "Get Owned Gameplay Tags" Show a message but i can't see an actual interface for them
and basically this also ensures you get the best performance, as this is 100% on the anim thread instead of running on the game thread
okay so in principle - when i hit someone, i change the enum to "is hitting"
And you take that and set your anim graph enum to the same value-
And then you just blend between a bunch of animations
note the lightning bolt
yep
but think about it more from the pose
yea till now the most i've done was use the animgraph to rotate my characters body in order to look at stuff while still doing animations
christ
I have some extra stuff outside of the state machine itself, but that's just to do with IK and nothing else
ey- it wΓΆrks ok? 
i'm taking every spine bone and rotate it a lil bit around the z axis
since i only need a z axis rotation
lightning bolts = animation thread right?
yes
so the best way to do this is to understand what basic stances you have, and then do poses based on. any time the stance changes. e.g. if you're having something like climbing, flying etc. (no longer just standing), you'll want to add another animation state
in the end, you'll have a starburst pattern
which then may have nested starbursts inside of it
i see
so like the basic one is "idle / walk / run"
And from those i get
"hitting"
or
"dodge rolling"
or
"interacting with a thing"
And in the character blueprint i do shit like "if blocking is true - disable damage"
or "if dodge rolling is true- enum can't change into hitting or interacting"
idle walk run is all the same pose right
you're still standing on the ground
yea
it's just a blendspace of how you're standing at most
exactly
okay so
When i leftclick - i wanna hit with my sword.
Or when i press R - i wanna draw my sword.
How do i do it so when an animation is finished, my anim graph send a signal to my character BP saying "Yo, the animation is done, you can change the enum now"
animnotifies
yes
oof
i hadn't thought of that...
that's the main reason why i moved to montages
because i started doing some dumb shit like delays...
well consider it like this
no matter where you put it
it's always the animation controlling when it's finished
so it should be the animation telling when it's finished
ooooh i get it
you mean i have 1 animation notify that just says "animation done"
and sends it to the owner
and then i can do stuff with that in the owner
no?
to whomever listens
with an event dispatcher?
the idea is indirection

the animation doesn't care about who is listening
exactly
that's smart
god damnit who the hell came up with the term "code monkey" and why does anyone ever think it's "not a big deal" to learn this stuff

I mean this is kind of like the tip of the iceberg
but to be fair this is more code architecture than anything else
setting up solid architecture before you start doing anything is key to making good systems
so having this kinda stuff inside an animation notify is big poop and it should be an event dispatcher
I have no idea what you're doing there tbh
activating and deactivating my weapon 
basically in order to do damage, i do an overlay event.
But if i do that overlay event all the time, and i just walk by an NPC - i would do damage.
I only wanna do damage in the 3 frames where i'm actually hitting
so i thought to myself "alright, gonna make an anim notify in my montage - and cast it to my weapon, neato"
yeah so you have a window you can do
you start the window with a notify
and end the window with a notify
exactly
beginning activates it, end deactivates it
But i didn't know that anim notifies can be used outside of montages
which is very neat 
there's also other things that you can do to minimize that code
for instance if you set it up correctly you can assert that the animation can only trigger if you have a weapon
and save the weapon variable early on
they're based on the animation. the montage is just a wrapper for an animation
well i kinda did that in my character blueprint, which i started guessing already was probably a dumb thing to do in general...
Because after a while i ended up having to do this kinda shit every time i wanted to add a feature
yknow, like make sure it's not doing this... or this... or this... or this... before running something
all of that could probably be handled by delegates in some form
and automated that way
oh
Thats one way of reseting bools.. π
it's not pretty π
i feel like i'm at the stage of unreal engine - where people are when they learn blender and they have a bunch of vertices layering above each other and they don't know why the shading is scuffed
but there's no tutorials really anymore, and the only way forward is to be lucky and find awesome big brains who have some free time and are willing to help 
So for that- thank you so much! @odd ember
If you have the time, look into OOP architecture
if you learn that well you'll have a much easier time programming
i wish i didn't have adhd that i have to fight every single time i see these kinds of graphs
adhd just goes NOOOO 
oh yeah UML is hell
but think of it more like "who is responsible for what"
most of the time you'll want classes to be responsible for themselves
with some exceptions, when a class is being managed by another class
but even that management is more directive based than implementation based
for instance I have an AI director that gives my AIs high level directions (e.g. this is your task now). but it doesn't care about how that AI implements the task
yeah... so like the perfect example of how not to do OOP is if someone puts literally all their code into the level blueprint or the character blueprint?
correct
welp
yeah god classes are frowned upon
it's too much responsibility for a single class
think of it like this: if you built a car, you wouldn't put the steering of the car directly on the engine
that is... a very nice way of visualizing it
once you understand the mindset of "everything is a system" you'll have an easier time too
because you can always break the system down into components
and understand how they need to interact
another question - So every time i show my spaghettio - people say i should use functions and i'm a big noob.
Problem is - a ton of my shit is stuff like this, where i'm slowly changing something over time (like this is for example my character transitioning from walking speed to running speed smoothly once i've drawn my weapon)
but i can't put time stuff into functions
when you're steering a car, you don't need intimate knowledge of how the engine works for instance. you just know that rotating the wheel left or right is going to turn the car, and pressing the brake is going to brake for you
I mean as long as it's pertaining to the character it's fine. you could handle it inside a component on the character if you plan to use that logic elsewhere, but otherwise that's fine. I see that in this case you use bools, but really what you would want to use here is states
states as in enum?
then you could also make those states be events that are delegated
for instance enums
a state is an abstraction
it could be anything, but the concept of a state machine is that you switch between different states
wait i'm confused.
So i delegate the state of my character speed? To what?
you mean stuff like my sword has the state of "i'm drawn" and shoots an event dispatcher into space
And my character picks it up?
your character could say "entering state X now" and have everyone listening to that adjust based on that
I didn't think event dispatchers were this often used, i always thought they were kinda expensive 
they're fairly cheap and cost isn't something you should be concerned about at this stage anyway
fair
if you would use enums for states (which BP is kind of skewed towards), you can use switch on enum for functionality and select nodes for data
i see... Well maybe the character speed is a bad example.
For instance, when looting something, i do it via an Interface
like i shoot a line trace towards my chest and send an interface to it as in "i'm looting you now"
And the chest opens and gives me a UI for it
interfaces are sadly also overabused in BP due to misinformation
should i instead send an event and the chest should listen in?
in the case of interaction, who is interacting?
my character or well- me is looking at the chest, and i'm clicking to interact with it.
your character is
sure
so who should have the interaction logic?
i guess my character should have the interaction logic?
correct
with looting and everything? Like pulling whatevers in the chest into my character inventory?
well the chest has the data of what's inside the chest
it also has the data of what kind of interaction it is
all of which can be used by the character to propagate the correct response
Well right now i'm sending an "i'm looting you" signal to the chest
The chest contains an inventory component, and that component has code that say "i'm getting looted, here's my stuff, i'm putting it into your inventory"
who is doing the looting?
again keep asking yourself questions like these
because the location of the logic matters
i see... So the character should have the "i'm taking items and putting it in" - because the character is acting
Hey! Learning Blueprints and have the following question: Currently looking around in third person is controlled by X and Y mouse input. What i'm trying to achieve is something like Runescape, if Middle mouse button is being hold, execute x/y mouse tracking to rotate camera accordingly. In my mind it should look like this but don't know how to make it work exactly. Had a look around on YouTube but not much luck. any pointers would be great π
correct
for every class you have
interacting with another class
find out what the relationship is
the only thing the chest has to do is "exist"
or maybe, at worst tell the player "I'm here" within a certain radius
i personally would add a boolean saying "camera rotation active" - but idk if CE would agree, all my knowledge is getting crumbled right now 
i used to think i had stuff figured out-
big mistake

Right, so it's not necessarily a bad thing to have A TON OF CODE inside a class like the character class-
It's just bad if it's code that's not supposed to be in there
just copy the events and hook them into your axis?
sorry not events, the functions
as long as it is relevant for that calss, technically no. the character movement component has 12k lines of code for instance
because it has to account for every single case that it can be used in
alright then. Welp, time to rewrite a whole bunch of stuff 
Wow 12k, damn didnt know it was that complex lol
but this is really nice, thank you so much for taking the time and teaching me
@odd ember
but generally if a class gets too full of stuff, it's worth considering putting stuff into smaller components. e.g. interaction could be handled by a component
inventory can be handled by a component
have a look in the code. I can't vouch for how well it's written, but it does what it says on the tin
say, would you be super mega annoyed when in the future i ping you incase i have questions? 
only if it's high level stuff
or if you're prepared to rewrite a bunch of code
i'm doing this project to learn, i'll rewrite it 10 times if it means i'll get better at it 
perhaps it's worth starting over in a new project, and slowly copy code over tbh
but first, figure out how to lay down the foundation
i literally decided to not use any new ideas and just "make a skyrim prototype" because that way i know what i'm trying to do is possible and i know it has been done in the past.
And then i can just do it a bunch of times until it's at a level where it's clean and works and is nice
atleast that was my idea of how i could learn ue4 efficiently 
keep in mind this goes beyond UE4
these are general programming principles
it doesn't matter which engine you use
or even what language
you'll always be able to use this in some capacity
Did so. But sadly that doesn't seem to work (camera locks in place) currently heading out but will fool around with it + try @onyx token suggestion, thanks :)
there should be a default mouse event for camera movement if you're using the third person template, perhaps try and copy that logic?
i accidentally deleted a level and i was wondering if i could get it back using the built data?
unless it's in your recycle bin
no
the built data isn't the level, it's just some lighting data
Yes, use version control and roll back. You ARE using version control, right?
not using it as its not a big deal
and i thought you could only use like 1gb with github? and ik about git lfs but i didnt think that it would be enough
Idk, I use plastic and you can go to 5gb for free
Its important to use if you're part of a team. A solo dev could maybe get away without it.
That said; my PC fried itself when I was at University and I lost a lot of files because I didn't have any good backups.
If you aren't routinely backing your stuff up manually to another storage device then using Source Control works amazingly just for that purpose.
Also kinda amused at the "help I lost important data" followed by "I do nothing to prevent this loss from being reversible".
Use source control, if only to correct your own mistakes.
sour grapes
yeah thats my bad, i just assumed that ue projects were too big even with git lfs
I don't know about larger games but I've never had an issue with LFS.
there are other types of VC than git
^
ik thats just the one that im familar with
I think its everyone's go to thought when they hear about VC to be fair.
perhaps
thankfully the map was just a whitebox testing map for different features but this was probably the sign to start using version control
but it's certainly not the best tradeoff for something like gamedev IMO
ik that we should bein the source control channel but which VCs would you recommend?
i saw plastic earlier
depends on what you have available
anything that has decent hosting, does checksums, and allows large file commits without timeouts is good
do you think that git would do the job for now?
mk
Okay quick question, the linetrace for objects can have objects specified. Is this an expensive operation because to me that sounds like its basically just casting for each hit?
casting isn't expensive per se
but line traces are generally expensive because of the computations
not because of what they look for
For context; constant linetracing in front of player camera to determine if what they're looking at can be interacted.
Aah right.
I personally wouldn't do it like that
I'd gate that off behind interaction availability first
What do you mean?
only trace like that when you know there's an interaction nearby
Aah
Okay I think I got an idea there
Trigger volume around the interactable object that will tell an overlapped player they have something nearby they can use.
Righto.
Still worth using the Linetrace for Objects, or should I go with something else in that case?
Right
you could even gate all of that behind a dot check
and on interaction input only
optimization isn't always about finding the cheapest solution, it's about making the expensive solutions only when necessary
That makes sense.
Wouldn't a linetrace on visibility fail if an interactable was invisible?
correct
Hypothetically. I'm trying to make an abstract here so I can make a variety of different objects that could be interacted with this.
i went to connect git to my project but for some reason i cant find my git install folder, only git lfs
Any way to get around that?
I'd generally use visibility because it's preconfigured
but if you have special needs you'll have to make bespoke solutions
Naturally
yes it's under collisions I believe in project settings
Oh, there's an "InvisibleWall" trace that is described as "WorldStatic object that is invisible"
That could work instead
Or InvisibleWallDynamic
I'll try a few see what works
just out of interest, what are you trying to do in terms of gameplay?
because generally you'd want interactions to be visible
Third Person Shooter, though the interactables isn't necessarily unique to that genre. I just thought at some point an invisible interactable might be of use.
I'd personally never use invisible interactions
Keep the option open so I don't have to go back and adjust stuff later down the line ya know
But yeah, probably wouldn't get used
Mhh i got a Trouble my Game Crashes, And my Crash,Text file have not Important Information in it, is there an other way to find the Problem?
I need help
im the Unreal Engine 5 Blueprints - First Person Shooter (FPS) tutorial
I cant find a certain section
mine doesnt have that
what do you think a general chat is?
talking about random things
I give you the privilege to do so
maybe take a look
well ok thanks
You are on the sky atmosphere, not the sky sphere bp
its the same thing
No it isnt
oh
You literally have sky sphere above it
B R U H
well thanks
There's nothing like that. When it crashes? The crash log/dump should pretty much tell what happened. Send it here so we can take a look
Yes u mean the last thing Or?, Well i tried soo much, to avoid everything, it Just shows any Event what Happens now, but the Last event isnt The Crash, because, When i add New, they show them as "the Last " One, but no Error or Warning.
Again this doesn't help, send files/pics so we can take a look
I just had it runs, ALl 10 Secs its Capping the FPS to 25, just because If u Press F11, its Like its Uncapp everything again, so thats my Easy Way for it
good luck bro
Its just the Same Thing, and not an Error or Warning, its just, Runs a amount of Time and doo nothing just, be outfocused Window, and coming back like in some Mins, it Crashes.
And if i would remove that Cap Function, it Crashes again, and just show the Other Same Stuff, but nothing what is like pointing to an Crash, or Error.
how i can Open it?
Visual Studio
ok, i didnt see anything helpfull there..
hi I'm new to unreal engine so can anybody tell me what I type to get this
Thats a 3 vector it seems
Also a material question not bp
Just hold 3 nand click and you get one
Np
ive looked again and a gain theres no Information for what, made it to Crash. and doesnt matter if PIE,Standalone or Packaged.
Aside from just getting the rotation of the sequencer camera and setting the controller's rotation to match it?
I'm not well-versed in how the sequencer works, but I'm sure that's possible
Set view target with blend
So the camera goes from End of playback -> Beginning of playback -> pawn?
IDK much about sequencer, maybe it treats cameras differently. We just directly control the viewpoint in PlayerCameraManager and don't even use camera components.
Aaack, need some smart people help. I am soft referencing a data table of widget animations that are inside the same widget as this bp graph. When I run in editor everything works fine. When I run in a Launch or Packaged build the soft reference fails to load the object.
The black circle below returns valid on every pin, the blue circle successfully casts in editor and fails cast in package, the red circle always completes load, but produces a null object in packaged build (it returns the correct object in-editor). There are no errors in the log or build logs for this asset.
What causes Async Load Asset to not load the soft reference?
Assuming you can get the sequencer camera's transform at the end of playback, you need to move the player's camera to that then do the target swap
or close to that, at least match the orientation or whatever
Might be as simple as get sequencer camera rotation -> set control rotation on pawn, whatever. IDK how you're driving your pawn camera.
That looks super fucky. Why are you binding events etc? But anyways if it works it works lol
Maybe that's a sequencer thing, I'd think it'd already have an on finished delegate
Question: I got a couple of colisiΓ³n boxes/spheres components that stops the player on their tracks, the player has to release the key/thumbstick and press it again to continue, it seems to happen only once per actor through the Level.
Any idea of why this happens? And how to Solve it?
*Colissions are set to Overlap only with pawn too, can't Remember about "can affect navMesh" wich i don't use at all for player (no enemies either un gameplay...)
Show the bp and we can probably help
Wich part? Colissions settings?
If it works once I would assume you have a do once or a set collision off somewhere in your overlap
so the actual execution pins for overlap
At no point the actors takes the player control, only when interacting: sets the input to UI only, but you have to see it and interct with it to happen.
Overlap only sets a boolean on the player π€
Show the collision execution pin for one of your overlap boxes, if you set it to ui you might not be setting it back to something useable
There are 3 collisions:
1 on the area fot a notification to show
2 a reachable Γ‘rea that sets a boolean only, this Is the One the stops the player.
3 a collision for the camera to ease the interacciΓ³n.
All collisions are set to Overlap only...
On my phone at the moment, Let me turn on the PC....
Here we go, just a sec
I'm creating a widget from class, and then adding it to the viewport and having its position follow the mouse in viewport. It works, but as soon as I click in the viewport the widget disappears. I should be able to figure this out, but apparently, I took my stupid pills today. Any ideas?
Z Order is set to 1000 too lol
Here is how the 3 spheres are set, all children of a static Mesh (Dynamic in nature)
If you don't have an on-click event anywhere that destroys the widget or removes it from the screen, does it have something to do with the mouse disappearing when you click? Like does it set the widget as vis false? Shot in the dark, I use world widgets cuz vr
This is the second circle, only sets a boolean...
Collision presets, custom with overlap only..
You know what that makes sense. I was thinking about it like it was working when in reality its not. the fact I'm seeing it at all is actually an error. Okay i'm doing everythign wrong. I can work with that. Thanks.
So which overlap only happens once per actor?
Second: if you run and the player happens to collide with it, player stops running and begins to walk, and if you are walking you stops.
Is a minor bug, since you can continue walking if you release the directional keys and start again, but it could be frustrating if you have several NPC you can talk to arround...
@thorn trellis I had forgotten to attach it to my player controller.Thanks for the duck. lol.
you should add a print statement and see if those two are firing exactly once like you're thinking @orchid geode
quaaack
Oddly enough, it doesn't create Error/warning either... just stops the player for a moment for no reason π€·πΌββοΈ
you added a print statement to your overlap and it didnt fire?
it fires all right
just once?
Yup, I removed it since the systems it uses are working just fine except for that minor bug π
I readd it again, and it doesn't seem to fire, but sstitll works somehow? π³
UE4 is weird hahaha
It really is lol
bumping this again, need help with soft references failing
Could it be something about being a collission insde a coslission?
You could try moving them apart and seeing if they function like you think they should
I just play tested it and the Print string doesn't fire, but the dialogue system still works fine, if you collide by walking it doesn't stops you but if you run it can either stop you i your tracks completely or put you to walk (depending if you use a controller or a keyboard)
For example, running with W, it completely disables W until you release it and press it again
Hello. Have you tried the "Resolve Soft Reference" function?
try turning off character can step up on
Putting actors side to side breaks the interaction system, witch makes sense since you can only set 1 interactible item on the player π€
nope! googling now
Step on, on it...
I lied
That's how I was originally using it, it retunrs None "when not loaded into memory"
So I've tried loading it into memory too but that doesnt return a useable object
And that's the weirdness of this problem: It should already be in memory because the animations are part of the widget that this bp code is in
I've never tried to use UMG animations this way, so perhaps it's a very specific problem with this particular use case.
I'll think about it. : )
tyty, just dumping all the info to show how it's been all linked up
yeah, I've imagined it more or less that way
π
data table has path to widget animation, all the bp stuff is inside the TextAnimation widget along with the animations.
Same, it still stops the player on its tracks, once but it stops it...
I think you need to track down what is stopping it. If it's not the overlaps you thought it was then you're setting your bool somewhere on accident
I think I will re-write the notification and interacting system... it works per item if they are separated but if they collide with each other it breaks.... The bug that stops the player on Overlaping might be because the input is on the player instead of in the object....
I will try to enable the input on the object by approach and compare actors the player looks at to set the notification and enable the interaction... if done correctly, it should not distrrupt player movement and clean the Player Blueprint in the process
I bought an weapon pack and how it is held does not conform to the current socket I have set up for my skeleton. Can I change their rotation and how they are situated so they can conform to the current socket I have?
yes
how is it setup?
when you attach to actor/component socket you can change the keep world to keep relative and whatever initial transform you set will attach in relative space to your socket.
Hello, does anyone know how I may manually feed certain controller inputs to a non-player character in an FPS game? (the overall goal is to record and replay the player's actions on a different character) Right now, I can spawn a new AI character with a blank decision tree, and call onMoveForward and that function works well, but trying to use the "aiming" functions, like turn and aim up/down, throw an error on trying to call "Add Controller Yaw Input" or "Add Controller Pitch input". For Yaw, I can sort of work around it using SetActorRotation instead, but for pitch this literally flips the whole character upward.
you can possess that character
I am trying to get that first pistol to conform like this second pistol
are the weapons actors or meshes?
skeletal meshes
then I'd advise that you make them into actors anyway
in which case you can just rotate the skeletal mesh within the actor anyway
but if you're hellbent on not doing this for some reason
If I would like to manually move a character in the game (from a blueprint program instead of actual player input), should it be possessed by AI controller or player controller?
you can spawn a scene component rotated 180 and attach it to that socket, then attach your guns to that components
right okay so what you're asking is how another character can be moved in general?
i just realized that they are spawning in as actors how would I fix this then
I have right now a completely working player character that responds correctly to button presses from a real player. What I would like to do is spawn a separate character in the scene, and provide it with "button presses" from the blueprint tick, instead of an actual second player.
you can rotate them inside of their actor instead then
is this other character going to copy the moves from the first character?
would I be able to use a static mesh rather than a skeletal mesh?
yes. I have written a thing which will record inputs from the real player. And then at some later time I spawn in the copy into the map where the real player spawned, and would like them to copy the actions.
you can but guns are skeletal meshes because it's easier to deal with e.g. reloading and animations
you don't need to do it on tick, just have the first character spawn the second character, and the second character setup delegates to the first
okay thank you
It's not a real-time copy. It's recorded and replayed.
you still have to code it in
I mean it won't magically appear
The recording is not actually per-frame, it's per delta time since spawn, so some frames will naturally have more than one input
delta time is frame time
so it is per frame
in either case you don't need to concern yourself with per frame input in this csae
At the moment I am able to call onMoveForward and onMoveRight, with my replay program, on an AI character, and these work successfully.
I'm just trying to fix the aiming and turning
But I'm not sure if I should even be using an 'ai' character or not
like I said
if you, during a replay, ensure that the other character is spawned by the first character and creates event dispatchers to the first character for its input, that's all you need to do
or if it's in the player controller that you have the inputs, that the player controller spawns it
@odd ember Let me try to explain again the actual sequence of events: for 10 seconds, player 1 moved forward, spins around, jumps, then goes off to continue playing the game for 10 more minutes doing whatever. At 5 minutes of game time, I'd like to spawn in a second character, not at all controlled by player 1, which will repeat the actions that they did for those first 10 seconds. Maybe the real player 1 will even be standing there looking at them replay all of the prior actions, while not touching their inputs at all.
So I don't want to copy actions to two characters in real time, which is what it sounds like you are suggesting.
in that case you'll need to create an input buffer
yes, I've done that part, I'm just having trouble getting it to replay certain actions.
because there is no "controller" assigned to the spawned character
which actions? and how does your input buffer work?
jump, moveforward, move left/right, crouch work
and what class is the second character?
Aim and turn so not, because they give an error trying to call the function "Add controller yaw input"
It's the same class
as you can probably understand this all goes through controllers. I'm just checking if the AI controller has that function
so no, the AI controller does not have a direct equivalent. how have you setup your input buffer? how are you buffering mouse movement?
@odd ember I'm sort of new at unreal tbh, but it seems like if I use an AI controller instead it doesn't have a "real" controller behind it. So it feels like what I need is some kind of "fake player controller" instead, because really I don't want any actual AI either.
well you said you had setup an input buffer
which is a fairly advanced thing to setup
so I'm asking how you've set it up
So I have events for all inputs, onMoveForward, inputAxisTurn, etc. And if these are called, then the inputs are sent to the player character as well as pushed to an array with their timestamp.
are you storing them in a struct?
And then on the replay characters, if the timestamp is above, it calls the "onMoveForward" that would have been called like the player character.
yes, I've actually written a c++ function for that part which I verified worked well already with debug strings and tests with basic movement etc.
can you show the code for what exactly you're adding to the buffer? just so I'm clear with what you have to work with
that's fine you can copy the cpp code here if you want
@odd ember https://bpa.st/BHWQ
This only works with one action per frame atm I still need to fix that
but it's not related to this current issue
I think you'll have a hard time getting more than one action per frame btw
input controls only execute once per frame afaik
okay first things first, it's probably wiser to use the built in UE4 functionality for this. try with TArray instead of making your own
This is the replay tick function
so all that's being added to the actual buffer is an "action ID" like 0, 1,2 ,3 whatever for jump, moveforward, whatever, and the axis value as a float.
your actionIDs are all ints, it'd be a bit easier to understand what they are if you used enums, as well
none of that matters for the current error the problem is that I can't tell a spawned character to turn, say, 10 degrees to the left , manually
that's true but it makes your code more readable
right now it's not
which doesn't help me trying to debug it
indeed. This is for a class so maintainability wasn't yet top priority >.>
but I might try to take it beyond that (if it's fun) so I understand the suggestion.
I mean it'd be minor changes just to make it readable
anyway yeah I can see where you are coming from
what I'd try to do is probably make a new type of controller
derived from a player controller
that has those inputs, but does not automatically assign a player
the other option you have is trying to translate your input values via the controller functions to an AI controller
void APlayerController::AddYawInput(float Val)
{
RotationInput.Yaw += !IsLookInputIgnored() ? Val * InputYawScale : 0.f;
}```
e.g. rewriting these functions for the AI controller
which of these two options would you recommend? It sounds like the former is a little less work for the time being?
It seems like in most documented things I only have the options to possess as AI or Player
the former is potentially less work but more risk, the latter is definitely more work but you run less of a risk of unreal not accepting the approach. I haven't looked into how player input would work if no player is assigned, and we may be in crash territory if it doesn't work out
correct, because third party possession isn't a thing
to be clear, neither approach is impossible
Is there a way in BP to determine if we are in a shipped build or not? (I know I can go into C++ and do a custom function. Just want to know if there is an option out of the box)
nope
even IsPIE has to be made custom
Womp womp. Thanks.
Hello everyone
Hello




