#blueprint
402296 messages · Page 943 of 403
all you do with animbp is cast to character get variables then use those to create your animation graph
or drive your animation graph
It's annoying that you can set replication on animBPs but I guess it's just a BP so it be how it do I guess
so i'm just thinking about this more, i'm not sure if it will fix the problem, the issue is the scale value being used on addmovementinput node
maybe i'm thinking of it wrong, not sure how I would apply using this
would i take the output vector and get it's length?
then plug that into addmovementinput?
i'll give it a try
so i asked about the whole don't trigger an overlap until the character stops moving before and tried the velocity<0 thing or even is moving node but nothing seems to work as i can't get the velocity of the ai character, i even tried to use vector length after get velocity
anyone knows how to make a "trampoline" effect on a triggerbox?
cant seem to find anything on it on YT
idk your setup but this works for me
yeah i tried that but for some reason it doesn't trigger the overlap, and i have no idea why
Did you check the channels in the collision settings of both objects?
@dense thicket launch character
yeah the overlap works if i have nothing else but the overlap but i don't want it to trigger as soon as the character enters
i want to open a widget but i don't want it to open while the character is moving and/or walking past the tile space
You can use it to trigger a timer and check velocity while overlapping.
Then clear it on overlap end
^ that seems like a good way to do it
yes it does i shall try
You could probably run it on tick by just enabling and disabling tick on the overlap events, but not 100% if overlap events actually work on a non ticking actor
i mean unless theres an easier way to open the widget as soon as the characters stop on the space lol
and doesn't open when walking past
I would probably do it with a button, like interacting with something
It's a bit elaborate and didn't test it, but maybe it helps you @shadow field
so when you press the button you could check what the player is near or looking at
but maybe that doesn't fit your design
its a board game so dice roll and movement, i have it all working just can't seem to figure this part out
and i will give that a try electric
behind the "Do Once" would be your part obv
Oh if it's a board game and you wanna display a widget based on the space landed on, I'd do that with a linetrace inside a bt task.
Electric's suggestion will work
yes it does just have to make it so it opens based on which space which i can do already so thanks 🙂
that seems to just make it "jump"? i need it to bounce.
So if the player hits an object on the ground, he needs to be launched into the air, but the he hits something that moves, he needs to be bounced in the obeset direction..
Actually like the bounce effect in the game "Fall Guys"
It launches the character. The direction and speed are up to you to calculate. It only looks like jumping because by default when the character leaves the ground the jump animation plays
I cant set the velocity to something "global"?
like so no matter how the player its, its just gonna bounce off of it ?
I'm not sure what you mean by "global" but usually you add the velocity of the moving object (which I'm assuming you're jumping against) to the launch
Yeah idk how global would work, but you need to get the surface normal and use that to calculate your new velocity
like.. lets say i have a stick or something that moves in circles 360degrees.. if i get hit on the left side of it, i get bounced back, but if i get hit on the right side, i get bounced forward
that is what's happening or what you want?
what i need
And why would you want to get bounced back if you're hit from the left? Wouldn't you want your character to bounce to the right?
hehe let me draw it, makes it easier :p 2 sek
But if I get you correctly you'll have a new issue, the rotating stick does only have a rotational velocity, not a "moving in a direction" velocity. So you need to calculate the theoretical velocity of the stick at the hit point
then launch your character with that velocity
that's not symmetrical, one of these arrows need to either go inwards or outwards
what do you mean?
Sorry, non native to english :p
is there a node for tick every X milliseconds?
@dense thicket you can either have this
You just need the velocity of the player and the normal of the surface hit. Im blanking in the math to get your bounce vector
or this
You can change the actor's tick intervall in the class defaults
Ohh haha true
it was just a quick drawing to tell what i ment :p
wither way is fine
Its called a reflection vector tho
perfect! thank you!
okay, so that i can use the get the velocity i need ?
Yeah
I can't remember the exact formula off the top of my head but there are definitely youtube videos for it
Either way, you need to calculate the velocity of the stick at the impact point. Meaning if your stick turns at 10° per second, and you are 1 meter away from the center, your velocity will be this
thank you so much, ill look into that 🙂
Where t is the time in which the stick has rotated a degrees, with the distance d from the stick's center point
that will be your velocity
then you can get the normal of the impact and scale it by the velocity
and that's your launch vector
@dense thicket
alternatively to the normal, you can calculate your own normal (which I think works a lot nicer in many ways). By taking the location of your character and subtracting the location of the impact point.
either way, i fucking suck at math hahaha
so thats not gonna happend xD ill see if i can find something out xD
thanks a lot 😄
Can i maybe use this?
https://www.youtube.com/watch?v=mvqZ1aSuraE
Unreal Engine - How to get local variable position in the world
Tips And Tricks about Unreal Engine
Short videos teaching you how to do simple things with UE4 and UE5.
If you like the videos please like and subscribe.
Probably. It's a pretty standard formula
ah okay, ill try that ^^
Thanks 😄
It will most likely not be accurate though, but yes that works
dont have to be very accurate, just needs to bounce a little
because that just makes you bounce by the velocity you ran into it
Id watch Ryan layley's instead. Atleast he talks
but it will not incorporate the movement of the stick
oh
a reflection vector is basically a mirror
but what you can do is just add a fixed vector to it
You can calculate the force of impact and add it in but that would be a secondary step
that would be the equivalent of saying "everytime you hit the stick, you get bumped by xyz amount of force"
it depends on how accurate you want it
Yeah. This assumes one of the actors is static. Like I said once you have your direction and the bounce works, you can calculate the increase to the magnitude of the new velocity
Well the stick is "static" since it only has rotational movement right?
Static thing that moves.. hmm
no its moveable
What I'm saying is that the Actor's velocity will be 0
since the origin of it will not change place
it will only rotate
therefore the Actor's velocity will be 0
even if it appears to be moving
because the center is not moving
that's why I posted this formula
The stick rotation is what add extra force to the reflection. The reflection by itself assumes you hit a wall or something that is not applying its own force on the reflected object
which calculates the actual velocity of the thing
How do you get the stick's rotational force to reflect with though? Apart from the formula I posted
I'm sure that works just fine. It's just separate from the reflection vector. There's also a rotating movement component that I'm pretty sure would give you the Rotational velocity
Maybe, I'm not too familiar with it.
Unreal has alot of math nodes and the movement components handle alot of the common math for you
Yeah maybe I should look more into them 😄 I'm usually fine with calculating stuff myself, I think it's pretty fun 😄
It's definitely good to be able to do. Sometimes you need to do it yourself
can you add a static mesh component to a blueprint at run time?
Yes
hey @terse stream clamping the vector did not work, the total movement input is still ending up being greater than it should when going diagonal making the slow down not work. this is what I ended up with for the code
a decent way to think of it is that the length from the center of a square to a corner is longer than the length from the center to a side
i'm just not sure what kind of math I need to do for it
There's a normalize node too
yeah I thought it would maybe be that, i'm not sure how it works exactly but i'll try it
Or you could just do *.5 since forward and right vector are normalized already. So adding them together makes the length 2
As long as the vertical and horizontal values are in a 1 to -1 range
so normalizing it did keep the value in the correct range but it's also doesn't seem to be effected by the slowdown multiplier
i'll try this
this doesn't seem to do anything, i have an idea for getting the normalizing to work tho
The direction is just the direction. If you change scale to .8 or something below 1 the player will slow down
how did u make the splines look like this?
Electronic nodes plugin, on UE marketplace
thx
yeah the issu ended up being that I multiplied it before normailizing it, I normalized and then multiplied and it seems to be working thanks for the help 🙂
how do i convert a local location vector to a world location vector?
Transform location node
hey guys im pretty new to using ue4/blueprint and im using this premade horror kit and i've created a small level and placed items, i was wondering if there was a way for the pick ups to be randomized. currently there is an overarching BP_PickUp and there are different classes for all of the items (flashlight, battery, gun, ammo, key etc). i was thinking maybe i could create a class that can be selected that will randomize between the other classes? but im not too sure. can provide screenshots if needed
Yes, you could do that
Make a bp_random pickup which initializes from the data of a random sibling from an array
Or just a completely empty actor, that spawns a random item on beginplay and destroys itself
Thanks I will try these out!
Correct. You could get all rows and do it manually...
welp. Thanks for the advice
I'm hitting an actor with a line trace, how do I turn that hit location into a local location of the actor?
Of the actor thats tracing, or being hit?
converting from global to local just means taking the global part out of the equation
e.g. removing world location
i dont get why this isnt working?
it wont print anything
i am running into it with my first person character
@junior hedge blocking and overlapping aren't the same thing
Something needs to overlap your character, and your character also needs to have "generate overlap events" option checked
do I need to use event hit?
because I just want collision
but event hit runs multiple times
would I just set a variable to make it so it doesnt run the event multiple times?
You are wanting an event to fire when something overlaps/get's too close to your character? You can use a collision box or sphere for that
It would help though if I knew what you were trying to do
You don't need to but you can, but from my years of UE most people just use overlap event
I can do the overlap event but its only when I actually go through it
this is what I ended up doing
it works technically
but it feels like im dodging the bush'
The only thing bad about this in my opinion is you creating a variable for this small thing
is it suppose to be reset ever?
Because honestly you can just use a do once node and get rid of the bool
thx
any less tedious way to set arrays fast?
in the details part its very easy but here it's kind of tedious, would be very good if I could do this in 1 node
This is not how one usually does it
how do they do it?>
?
you're setting the box's arrays item to 1 and 5
why those particular numbers?
are they random?
yeah testing reasons
Yeah i figured it out, its the Inverse Transform Location node.
random numbers
so you'd usually set up a small function for randomly filling a container with items
well it wont always be random
depending on complexity and probability
well you can always add them manually, and untick "random"
ok this is how i want it to be
So you'd have some range of what random items can be added here
some list of possible items
when opening a chest for the first time it generates random items that can be in there. Then it will permanently save that data
This should be done inside the Box actor aswell
no need to use GetAllActorsOfClass
alright
https://www.youtube.com/watch?v=iLB8XbEare4 this is what is happening anyone know why i cant open them >?
restart editor
Is there an event that detects when it's no longer hitting?
i tired this but it still doesn't let me open them
Doesn't it show more than 1 window open at the bottom?
In the project settings there is a setting to dock the blueprint in the same window as the editor, try using that
ahh i don't see it ? https://gyazo.com/a5c5d73801fc1541d644e34bc50b1932
I don't remember what it's called also it's probably in preferences myb
i just tryed to resorting these to defaults but didn't work unless there is something specific https://gyazo.com/4612fcc353176913fcb60168e964470f
It's not a default option
oh i found it it was minimized at the top of the screen in a second window for some reason ahah
thank you heaps for your help
Lol that bug sucks
How i can find the cause of these FPS drops? :/ i have try with some profiler but i don't understood where is the problem
Are there any good BP-based tutorial videos/example projects for how to handle typical single-player and multi-player game modes?
Could I create and set variables with a bluetility widget on another widget?
Context: I need to set lots of variables when I create a new widget parented to a certain widget. I'd like to automate the creation and setting since It's all done at design-time anyway. Do you guys know of any blutility/blutility widget method that would allow for this? Or is this impossible since I can't grab the widget's reference anyway?
Why on tutorials player movement from input is added to character blueprint instead of to controller blueprint?
Hey there guys! I've made this crane model (skeletal mesh) and did 3 animations:
- Crane_Idle
- Crane_Breaking
- Crane_BreakIdle
Added the model as a blueprint actor and set up a custom event to play the first (crane_breaking animation) with a delay of duration as long as the anim, then it ends up on a looping crane_Breakidle animation.
Placed a physical mesh crate on the crane which needs to fall down when the ropes break.
The code works, however, I noticed, although the animations play, the collision of the mesh doesn't update. Basically, it stays where it was and the crate model remains in the air with an invisible collision beneath it.
Anyone has any ideas on how to fix this?
Practical to let pawns handle their own movement i suppose
because its not loaded look at the world partition tab left click drag a box then right click load over the area of the map yuo want loaded
Because if you have a vehicle and character it wouln't make sense to have the inputs bound in a controller
Is there a way to change skeleton size with respect to morph target in UE5,
for example, child and adult morph targets in Daz3d have different skeleton size
but in UE5 changing the morph target does not change skeleton size.
Hello, Is there a way to update the values in a Material Parameter Collection via blueprint/cpp and actually have it changed in the Material Parameter Collection asset on disk?
I'm trying to make a simple character selection screen and implement it to my main menu. Now that I start the game I'm getting spawned below the world. I tried the "make transform" and took the location from my "Player start".
Any tip?
@dim tapirYea, don't use a player start, spawn the player with blueprints
How would I go about doing that? Currently it looks like this when I start, it doesn't even load my UI
thats australia! 😄
Player start should work fine..
Is the player you're spawning being possessed by you?
It works if I force the pawn to start on a specific level instead of going through the main menu
I believe so if you check the Blueprint i posted above
Nevermind team, I solved it by moving the load map to the end instead of beginning! Thanks
hi i have been following this tutorial trying to get my enemy AI to attack i think i followed it as best i could but i still cant seem to get it to play the attack animation maybe i have done something wrong with the bp any ideas ? https://awesometuts.com/blog/unreal-engine-enemy-ai/ < guide issue > https://www.youtube.com/watch?v=u_frx6rS-uQ
Is there a way to find out if the game is running in the editor? What I really want to know is if the device supports touch input.
Forgot animation slot?
yes but ahah but it still doesn't play :/
I can't recall if there's such node in BP, but at least in C++, it's as easy as #if WITH_EDITOR
I have a Primary Data Asset, from which I've created a few Data Assets, but the Get Primary Asset ID List Node returns an array of zero length. Anyone have any idea of some "gotcha's" with Data Assets I may have missed that is messing me up?
I've done this in the past, and it's worked fine, so I'm not sure what I've missed when setting this up.
if i always have 2 elements in an array always in random indexes is there a shortcut or node to leave a certain element and pick the other one
What exactly are you trying to do here?
That doesn't make much sense. Is the array of size 2?
Any ideas as to why my save function saves the current level but not the player transform?
When I use the load function it loads up the correct level the player was on when he saved but not his location.
so baically im trying to make a teleporter which ive made but i want to make a logic so i dont tp to the same one . i have the bp 2 of them in the same map so i wana check if im near the first one i tp to the other and the other way around
@faint pasture
Here's the Load game event btw.
Get actors of class, remove self, shuffle, get index 0
Unless there's always just 2
then just get actors of class, remove self, get 0
Do you place them on the level? You can just make a variable on the bp OtherTeleporter and set it for each one to point to the OTHER one.
I cant duplicate my blueprint. Its working fine when not duplicated. When i duplicate it just becomes a mess of errors all over the place. I need to make backups, so it would be nice to be able to copy it without messing it up in 100 places. Pls help.
welcome to macros
So macros break it?
did u try opening the blueprint and seeing whats going on?
yup its that bloody mess of errors. Its so scary i immediately revert it
😆
did u ever click one of the errors and try figure out whats going on yourself?
You probably shouldn't be setting the root component's transform, rather setting the actor's transform. Should also not need to cast the player character at all to get or set it's transform.
yes. its just that its so many errors, i thought maybe there was a simple explanation for all of this. Like "dude you cant duplicate it like that". But from what im learning from you, i have to go through each error and try to fix it
yes you will have to pinpoint the issue
else nobody can help u
I think the issue you're experiencing is that your blueprint is that the "type" of the object is now different than what you were using. Perhaps instead of duplicating your blueprint, you make child classes of it?
Ah thanks, I'll try it. :)
I create a 2d game of fighting, i have do a flipbook for my punch animation but i don't know how do the blueprint for when i use my input NUMPAD1 its do the punch animation who can help me pls ?
hmm. will try that. There is a thing i remember doing though. That is i changed the ISM to an HISM. And i compiled it worked in all functions with argument as ISM.
Hm, that didn't work. I'm using Player Start, is it possible that the player isn't existing when the level is loading up and maybe that's why it's not applying the transform to it?
Ok ill try that
the actors get spawned after the gamemode loaded
Ahhh, I wonder how I would apply the transformations to it if that's the case. The tutorials don't seem to address this for some reason.
Hey all, I'm having an issue with the camera here. I'm in the middle of prototyping a lock on system, I found the midpoint between the two actors, and I'm subtracting it from the camera location of my player character. I use a normalize node, then set the camera's rotation. The issue: the character goes out of bounds of the camera all the time! It's super problematic, and I want the camera to always be behind the character
So that i can try stuff and still have the old back up? Or there's a better way?
its called github
How do I get character controller from animation blueprint so I can assign animations based on current movement direction?
Ok i will get into that.
I think i found the issue with duplicating. Its because a lot of times im using the argument with the name of the blueprint. And when you duplicate its the same name but with + "1"
Thats what happens in most cases
yeah thats what @dawn gazelle was trying to tell you
I see now. But the issue with child classes is that they inherit everything
whereas i might need to completely change it
well then dont use stupid casting everywhere
thats true. but it not only casting its also the input of functions
in general u should just use actor or character class instead of casting to random bullshit
well everyone has to start somewhere lol
you can just copy/paste you bp into a backup folder btw.
Hi I create a 2d game of fighting, i have do a flipbook for my punch animation but i don't know how do the blueprint for when i use my input NUMPAD1 its do the punch animation who can help me pls ?
Well I think the other issue is that you're doing a "load level" then trying to do more after that. Once you do a "load level" like that, basically everything is destroyed, so the code you're trying to execute won't carry over to the next level.
You'll have to code your game in such a way that the game instance knows that it's a loaded game, then on begin play of your character or any other actors, read the game instance for the save game details they are supposed to use.
THIS IS SOURCE CONTROL!! OPEN THE DOOR SIR!!
no one at home 😄
but yeah ofc source control would be even better
seemed like a good idea. i tried it and it gives the same errors though :(.
... is that a McDonald's employee?
Ah, thank you, I'll try it. :)
ah well thats strange, just check the errors then, because when you copy to another folder it doesnt add the +1
or use something like github as source control recommended
i just made an actor that handles the gameplay stuff
yup and it didn't add. It was a good idea. But has the same exact issues.
i need to make this blueprint from scratch.
Source control my dude
Your duplicate is probably bricking because you might have refs to the self type and maybe some update when duplicated and some don't.
i already have 10 tabs of tutorials ready 🙂
i dont know how to use it yet
Well you know my take on those
10 tabs huh?
you should add a bad too it imo 😄 @faint pasture
By definition, you only know if they're bad if you don't need them. That's the problem.
lol
I'd recommend Plastic but I'm probably a minority in that respect.
Plastic Cloud is smooth sailing tho and dirt cheap or free depending on your project size
but like, one must watch tutorials to learn. or at least google stuff?
obviously, like everything else in unreal lol
Hi - can I ask a question please? Just joined because i am killing myself trying to figure out how to do something I think isnt that complicated but i cant figure it out. I want to create a blueprint like a british police car siren/light, with 2 alternative flashing lights. One starts, is on for 1 sec, turns off, the second light turns on for 1 sec, then off (and repeat) I am pretty sure 2 point light actors in a blueprint and a couple of delays can do this but for whatever reason i can't figure out the order. Admittedly i am not very experienced with blueprints but could someone give me advice pleaassseeee 🙂 This is my idea, but it doesnt work at all. Thank yaaaa
Universities hate these 5 tricks for learning. #3 will shock you!
i watch tutorials in 1.5x speed xD
The trick universities dont want you to know
make a lerp with ur 2 colors
Google things, ask questions, watch the WTF is and framework videos.
But if you find yourself just copying along with some video then you're not learning.
could also throw a timeline into the mix
Are the lights at different locations or is it one light flashing 2 colors?
why doesn't this play a animation?
he can just do a lerp and give one light the inverted lerp
Thanks guys!! So its 2 lights next to each other, like either side of the top of a car (pic below). Both are blue, i think they phased out the red lights. so they need to be alternating and slightlyyyyy apart from each other
Set stuff -> delay -> set stuff -> delay loop will do it
does anyone know?
You're just turning lights on and off, not changing colors
if the setup in your BP is exactly like in the screenshot it never gets executed
oh is it bec i don't have a statement?
When do you expect that code to run?
when no other animation is playing
its a idle
you should watch some blueprint beginner tutorial
something must start it, like "begin play" or w/e event you want to trigger this
ah i see
Read up on anim bps
and then u should watch tutorial about how to set up character animations
alright
ey that worked
Idle animation isn't played per SE, it's the default state. You'd do this in the anim BP, the actor BP doesn't have to do anything
magic
pretty weird that you always need a statement
Look at how the old mannequin animation is setup
No it isn't. Something has to trigger something happening. Everything starts with an event. You don't want code to just run willy-nilly just because it exists
good eye, didnt even see it was supposed to be an idle animation
Hello guys and welcome to the Unreal Engine 5, Blueprint for Beginners complete tutorial. In this video, I will explain what is blueprint - the visual scripting system of Unreal Engine. I will show you how to create blueprints, and walk you through, step-by-step, how to create a few blueprint classes. We will create a simple door you can open an...
ty
also look into animation blueprints and state machines @rocky surge
alr
how to do somheting if the value of a int = somheting
Create an int variable and drag it onto the graph, select SET
When you change the int, you do the thing you need to do.
the graph?
inside a class
Eg.
Set Health = Health - Damage
from there connect to a branch with the boolean set to:
Health <= 0.0
TRUE on the Branch: Perform Death Stuff
ah alr
Is an empty character actor more expensive than an empty actor?
Or this doesnt really matter?
Is it worth it to make it from scratch as an empty actor?
It seems the character actor just has the movement and the collision handled
I think the better question is whether or not you actually need a character.
You trying to make something that walks and jumps?
Character is an extension of the Actor class, so it would be more expensive but difference would be too little you don't have to worry about it
It only walks
but wait. walks in a weird way
What is it
Ya i wouldn't use character for a squad
I'd use it for an individual soldier maybe, depending on your design
i used character, and it moves like a character. I click (topdown), and it moves all the soldiers to the destination
so for the initial test it was good
but now im thinking i can just make it better
Is a soldier a character or the squad? Is a soldier a thing?
soldier is an ISM
ism?
You doing like a Civ / Advance Wars type thing?
more like total war
You can use the Pawn class for top down view instead
ya idk if I'd use character as it implies certain things like a capsule collision etc
pawn is cheaper than actor?
No and don't worry about cheaper
Its cost really doesn't matter
yup. I replaced the capsule already
Object -> Actor -> Pawn -> Character is the heirarchy
So i should go with actor. And add in my movement customly with lerpy
I'd do a squad based on Pawn or Actor
Probably Actor unless you want AI to drive a Squad around
Pawn is just an actor that can be possessed
Well the AI will have their own squads
The issue then is that the character has the collision handled. And the character movement works flawlessly
whereas lerping i wasnt able yet to make the collision work
I'd say go for pawn for the player and the top-down view.
And if the "squad" walks around use Character for each member, if they're flying stuff you can use pawn or actor
What is the collision shape of a squad?
I would start with a soldier and have a squad just be an aggregation of them
A rectangle when they are in formation, and a procedural mesh made of the wrap points (convex hull) when dispersed a little
And you're getting CMC to move this as root?
Like you replaced the capsule with this procedural mesh?
i move the whole squad
then the squad collides with other squads
and the soldiers are lerped individually to contact
Show your squad in the component outliner
Thats only when they move to engage in melee
else in formation its a rectangle
it seems the big difference between Character and Actor is the Character Movement
which is very handy
it handles the Path finding, rotation of the squad
collision
Yeah that's the main thing. If it works it works.
so maybe its not worth it to change it
You had just said you replaced the capsule so I had to see it but you didn't
else i would have to lerp it
i meant i made another collision
a rectangle collision
why are u even lerping them instead of using the character movement?
it is supposed to be disabled
I'm pretty sure it's not, the CMC relys on the capsule. But if it works it works.
im not lerping them yet. im thinking about it. lerping is cheaper than character movement right?
lol
Who gives a shit about cheaper, how much ms are you using right now?
You don't need to think about the resource cost that much
70 ms
Just do the most optimal way
fuck
per frame?
wait
Damn that's a lot
sorry
You don't need to worry about the resource cost, it will do almost no difference in performance
Just do the most optimal way you see fit and it will be fine
are u trying to make total war in unreal? xD
yup. its my dream
between total war and age of empires
more total war than age of empires
you will have a bit of building
im making mix of warcraft 3 and skyrim lol
thats awesome
so you can possess to Third person?
yes
indeed, i wonder why there isnt such game already
there is mount and blade that is not the same as you are doing
Lerping is quite a bit cheaper yes ^
but its complex to set up
nothing with latest technology
?
and the collisions how do i handle them with lerp?
It involves a few extra steps yes
the character movement handles all of that, if there is a rock with collision on the path
Yeah itll step over it if possible
if i set it up it seems it will be much cheaper. because i will have many squads
This is determined by the nav system tho
Char just keeps itself on the ground, so to speak
but it will be much harder. need the A path finding. and need lerp with collision
A* pathfinding?
Lerp doesnt exclude collision directly
Just depends on which fidelity you care about
You don't need to use the character class to pathfind in a navMesh, the AI Controller has a pathfinding function built in so you can use it on Pawns as well.
so lerping a instance static mesh, from one place to another, and there is a big rock on the way
it will go through it
Solved by the nav system
Mostly..
There are cases it doesnt fix for sure
It gives far to few points ,
what if its a soldier. then nav system wont fix it
Expecting the cmc to handle the rest or smth
soldier ISM on the way of the soldier ISM moving
This is why i made by linetraced pathfixing function and put it on top of the nav system 🤣
thats what i used for melee of individual soldiers when 2 squads engage
i make a line towards the enemy squad center
so if your line finds anything then you calculate a way around it?
thats tricky
especially if you are moving and then the obstacle is no longer there when you come close to it
No, i made sure the nav system had enough space for me to walk around the object
Static pathing
Atleast, currently
but thats of obstacles that dont move
if the obstacles are other soldiers that move around, then it becomes messy
And very costly
If I were making a strategy game I'd have individual units pathfinding and have squads be aggregators of them. You'd want to NOT use character but have your own movement system.
You can easily get thousands of individually moving units with a nice data oriented design but you won't have thousands of Character actors running around.
I think thats what im doing. I have the squads moving like characters. And the soldiers are ISM that only lerp towards enemy soldiers when the squad engages another squad
With thousands of units i wouldnt care to much about unit to unit collision tbh
so its fine using character movement for the whole rectangle squad
Doesnt make much sense
thats character movement?
UnitSubsystemTick
UnitMovement:
For each Unit in UnitsArray
Unit.Velocity = SomeFunction
Unit.Position = SomeFunction(heightmap, Unit.Velocity, etc etc)
CollisionDetection:
Some code blah blah
Do Attack:
blah blah
Something like that
You'd want to assembly line that shit if you're going for high unit counts
For a big war game rts,
I wouldnt care about tracing the attacks either
This is what i slashed at, so i hit it
You could tho, easily. Just don't make a ticking actor per unit, do it all in a big fat loop on a subsystem
In a Large RTS the units would only be visual
You lose perf not by doing a lot of work, but by spreading the work out in a million little functions and jumping all over the place.
The actual attacking/defending calculations would be done in a purely mathematical way with army strengths and sizes in the background
The attacking/moving animation etc would be visual
So you wouldn't have individual units running around attacking
I mean if you wanted it to, it all depends on the design. But modern computers could easily handle a couple thousand individually attacking units with their own stats. Just gotta be smart about it and make they system cache friendly.
https://streamable.com/df0w2r
I use 1 character movement for the whole squad. And when 2 squads come close to each other like in the video above. I calculate the melee like this, using lerp, with splines and line trace. The collisions are temporary just to get the path. They are destroyed right after.
Yeah, but definetely wouldn't use the Actor class for that
A single empty object class would work fine
with just essential variables inside
so empty object is even better
never done an empty object bp
Yes, you could store a vector variable inside that represents its position, but it wouldn't really exist in the scene.
And you can have a single Actor class managing all the objects and drawing fake moving units in the world. Purely visual
When an attack needs to be done, just make a function that takes two army sizes and strengths etc, and determine a winner. Along with the remaining army size etc.
Then animate it visually, making it look like it's happening in real time.
Thats so outside of the box
So the single actor would be the one lerping all the units?
So this doesnt use squads
its unit by unit
Kind of yes, but the "units" wouldn't be real actors in the scene
But fake visual representations of the objects
In my case i think im doing what you are saying but with squads. I have a squad, with ISMS inside it. The squad is 1 actor. The units is just ISMs
They use VAT and LODs
Or thats not what you meant?
it seems its similar but your is more global
Yeah that's ideal, but in your case each of those squads are a character that contains its own code
If you were to add more squads it will eventaully slow the game down
I also found after testing that splitting them into squads rather than having them as one squad is cheaper
yup thats the issue
So i could create an object instead of an actor, right?
this is so confusing 🧠
I'd start by thinking about your game design and figuring out what you need
Is there such a thing as an individual unit or are they just graphics representing the state of a SQUAD
Do I care about doing hit tests for combat or is it effectively the same as in Civ
stuff like that
In your case you could probably get away with using an empty static mesh actor for the units, and use a single actor managing their positions
the issue is the melee. They need to be individual just because of the melee. If i was doing a musket game, then they could be just squads. but i like medieval.
Does the combat really reflect that or is it just window dressing?
Is a unit fighting a unit or a squad fighting a squad? If it's just the graphics of dudes running up and hitting each other that's not pertinent to gameplay.
when i use my input for move and its do a flipbook, the flipbook is in loop how can i do for its do only 1 time
The combat would be calculated by other things behind the scenes, such as squad morale, proportion of the front line (has a reform function already), direction of the attack (flanking or direct). So numbers count but for now individual soldier health and hits dont count.
But you see if they reform then i need them walking around as individual soldiers, not like fake block squads where individual units cant move. They are block squads but i control the movement of each ISM when the situations where its needed.
squad fighting squad but it feels like unit.
That's a decision you gotta make. If the game can work just with rectangles bumping into each other, then do it. If you need individuals, then do that. It's a big choice and you have to make it early.
its just an illusion
If it's just an illusion then carry on as you are I'd say
I think Stellaris does what you want quite well
but spynorbays idea got me intrigued
Combat is calculated behind the scenes but it feels and looks like individual units fighting
Stellaris ships have individual stats and attacks tho
the individual ship is modeled
Each ship in that game is a unit with stats that does not exist in the real scene. But it has a visual representation in the scene.
That model is not the unit itself
just a fake visual model
that is animated
You can have fleets with hundreds of units but you won't see all of them, but it affects the combat stats
With each unit having its own stats
The ships are targetting each other individually tho. The combat model is ship on ship, analogous to unit on unit
i think im doing the opposite of that. Im having the representation of all the units, and i dont calculate anything of the particular unit, only the squad
but it looks like im calculating the unit combat
Yeah you effectively have a single entity with stats, not an aggregation of many
That's exactly how you create fake fights
I mean the only difference is you use Fleet.Position not Ship.Position as a ship doesn't have a position.
The "fleet" manages the visual representations of the units inside it
when the fleet moves, it manages every unit and updates their positions
But the units do not exist in the 3D scene, just in memory
a fake ship is drawn where their positions are by the "fleet"
thats what i dont understand
how do i make a unit appear in the 3d scene
without actually being there
Just make it have a Vector variable called position
it may only exist in memory but if it has a "position" variable you can update, you can draw a representation of it in the scene
How you already are doing it
like instanced static meshes
Squad inspects self, draws ISMs where it should
Yeah you can use ism to represent that units
The one difference is on your code is your units don't have individual stats as far as I can tell
The squads do
yup and thats $$ cheaper?
who gives a fuck about cheaper lol
no difference
do what the game needs
if your game can effectively be a bunch of boxes on a strategic map, then keep doing what you're doing
this ^
if it can't, then you gotta reformulate
🙂 ok ok ill do it. im overthinking i see
You're doing the Civilization model right now, but a bit more complex. That can work fine, you just gotta keep the design in mind and have the Squad call the shots, not the units. The gameplay should be the exact same whether a squad has a bunch of little dudes running around or is just a box
If your game can work like this, you're good to go.
how do i disable a function from being used
Remove it
Don't call it, or make it do nothing.
but its being called somewhere else but when something happens i want it to not be called
Handle that at the call site or inside the function.
Something somewhere needs to make the decision not to have it do anything
https://streamable.com/7w4yx3
This the effect i have done for when they start walking. You see, i lerp the units in the relative to look as if they are lagging behind. In reality they are moving with the box.
That's like asking "How do I make my car not go"
Either don't press the gas, disconnect the gas pedal, or delete the car.
Or forget to fill the gas tank.
Specifically what are you trying to do
I have a question about an architecture design problem.
We would like the ability to add some meta-information to any WidgetBlueprint (and inherited classes) that is accessible at Editor Time to do some Editor Runtime shenanigans. Is there an elegant way to extend them with something similar to a tag system for additional metadata?
Only Option I see to create my own UWidget class in C++ and make all of them inherit from that, but that feels clunky and unecessary. Any ideas?
What does this function do and WHEN do you want it to NOT do the thing?
When im moving slower than a certain velocity my wall run function gets disabled
Show the part of the code where you decide to run on a wall
Whatever you have, you're probably doing something like
If I'm near a wall, run on wall
Change it to be like
If I'm near a wall, and my velocity length is > SomeNumber, run on wall
Then you need to be checking your velocity on tick
You can do it all in one place
Tick -> blahblahblah -> Branch on If NearWall and ButtonPressed? and Velocity > SomeNumber True -> WallRunning
False -> NotWallRunning
So if you're ever not near the wall or let go of the button or your velocity is too low, you'll not be wall running anymore.
My wall run function is on a collison event tho not tick
you use a tick event for checking the velocity anyway
I have a end wall run function
Yes
ok so
Tick -> if Velocity < SomeNumber or OtherConditions -> EndWallRunning
Thats what i did
ok so what's the problem
But then it just recnonects and wall runs straight after whoch is why i wanna disable it until my velocity goes back ip
Well then you probably want some sort of a cooldown
Yos
K so do that. On EndWallRunning, set some bool false, then reset it to true later. Check that bool when you try to StartWallRunning
Ok ill try that cheers
Or save the game time as TimeStoppedWallRunning and make sure CurrentTime - TimeStoppedWallRunning is > SomeNumber before you can wallrun
Guys i have a question,how can i make boat movement(boat should be controlled by the player)?
is the player getting into the boat
no,the game will be only 2 boats,one controlled by the player,second one ai
make the boat a character lol
make the boat the character because it requires input from someone
Boat pawn
Btw im asking for the logic,not should the boat be pawn or character class,i've tried some stuff which doesn't work.
Boat should be a pawn and you can either
- Use physics
- Use a movementcomponent
- Move the boat yourself on tick
I'd use physics but you're not gonna just click button get boat, you're gonna have to do some work.
Start with getting a cube to float.
thanks
The general algorithm for anything physics movement is
Tick -> Apply Force -> Apply Torque (if wanted)
The calculation of the forces is what makes it behave boatlike or planelike or carlike or spherical cow in a vacuum like
how would I keep a value displaying 3 digits? looks kinda ugly when I move at 0.05 increments https://gyazo.com/3172dbb5655a47b335bbf7fcd6065fe9
ToText (float)
wtf, I never saw all those options thanks
Its an awesole node for sure
Me trying to math out my construction script
I want to have a static mesh blueprint in my level that can do something when it gets clicked or tapped (mobile) on. What's the workflow here? Do I do a trace from the player pawn and then tell whatever I hit that it was selected? Or is there an easier way?
OnTouched and OnClicked is usually avaliable
Say some more. Is it an Actor BP with a static mesh or are you trying to just drag static mesh actors in and have them "do things"?
The answer to your question is in my question :p
I want to have a static mesh blueprint in my level that can do something when it gets clicked or tapped (mobile) on.
Just something I can click/tap
Just make an actor bp and go nuts
But I don't know what nuts is :p
The way you worded it made it sound like you want to be able to just have the raw basic static mesh blueprints do things. That's another option, depending on the extent of what you're trying to do
Make empty actor, add static mesh component, hook up the OnClicked or OnTouched events
I did that, so I think I then have a different question
As you can see, I went nuts
But clicking it does nothing
You don't necessarily need to bind events, just implement the event
Select the component you want to be clicked, and you'll see a bunch of buttons to add events for it
On Hit, on clicked, on X, on y, etc
How do games handle level progression? Do they use sublevels or loading different maps?
Depends
THey use any and all approaches
I want to create a leveling system but all there is on youtube is creating a map list with all the available maps. That's not modular
I want to be able to create maps and not having to add them manually to the list
Sounds like me last month lol
Should I try making an editor tool for the map list?
You'll have to either scan the database or just add the level to some list
Sounds like Asset Manager territory
You can hook up some way to watch a content folder
such that
ListOfLevels = All Levels in /Levels/
etc
Worlds with levels is just multiple levels. Or do you mean levels loaded into levels?
In my experience, sublevels are often used for optimization and compartmentalization of work so you'll have a level broken down into sections, and each section gets a sublevel so several people can work at the same time and the sublevels can be streamed out when not needed.
Different levels are used when a hard-load (not streaming) is acceptable, like between interior and exteriors in an open world game, or when a major shift in setting occurs in a more linear game.
@real notch
I did that first, and that also doesn't seem to trigger
Wait do a need a collision capsule to make an overlap event without actually having to be inside the object?
Aha, thanks for the info. I've seen this compartmentalization, like the level being divided in lighting/combat/geometry.
So when the player completes the level, you unload the geometry, add a fading screen widget to hide the transition and then stream different geometry?
Make sure click events are enabled and the mesh collision blocks visibility i think?
I think it does. I just took a default cone, I can see its collider, it's set to block all dynamic
It generates overlap events
There's also overlappall
make sure the player controller is generating click events
you have a cursor right?
I do have a cursor yes
Yep, pretty much.
How do I do that?
Oooh actually
Could it be that my ui canvas thingy is in the way?
It's set to not hit-testable
Ya I dunno, I've never used click events. But once you get it working you should be good to go
:p
like that for world01 then another map for world02 etc?
You can do it any way you want.
You can just have World1 and World 2 be streamed levels
It's honestly really up to you, whatever organization is best for your workflow and gameplay.
I'm trying to understand it before I build it, sorry 😅 Maybe it's common sense to you
If you don't have employees, just get building
Stuff like that more comes into play when 10 people are working on a level
But yes, like that haha. As long as World02 is another persistent level, that's the type of organization I have been seeing.
Yea, that's what I want to clarify
And I think World Partition throws a whole other monkey wrench into the setup
If you're in UE5 data layers is another thing to consider, they effectively replace sublevels.
I'd just make them all and load/unload them as streaming levels
We are going for a zero load screen approach for our game, but it's procgen so the actual level on disk is basically a sun/sky and that's it
If anyone has any thoughts on how to approach joining a session without a hard cut / load screen I'm all ears
For the host it's completely seamless from startup to shutdown. But a joining client has to have a hard load on their screen
So all of the sublevels get loaded initially? Then I'll just be changing the visibility?
Nah at startup you have just the persistent level (might have sky and sun in it), and you load in sublevels to "change level"
like photoshop layers
If you're going for a level based game like Mario or Bomberman or something of that sort
The no-loading screen could be just fade out/fade in widgets in between changing levels, no?
It'd be really cool if I could avoid that
multiplayer joining always happens at an identical area (like the town in Diablo)
so if you could just.... appear. That'd be incredible
i think it could lead to weird effects when you dont have a transition screen. like stuff vanishing around you because its been destroyed in the hosts world or w/e
Basically it's like the Diablo Town <-> Dungeon loop, except when you're in town, you can join your buddy's town and go dungeoning with them
we have a teleport mechanic so that could cover it. Sort of like the portals in diablo
but I want it to be 100% consistent where there's no difference between teleporting to dungeon or teleporting to another person's base, so I have to work on that transition
Basically town = spaceship, dungeon = surface, you teleport to surface and back, and can teleport to another ship (joining a MP game)
You can try having mouse over action to load a small area around the teleport the player is going to go 😛
Beam me up/down/sideways scotty
Or add a teleport animation to give it time to load
The "dungeon" is always there, it's procedurally generated and teleporter is not enabled when generating (ship travelling to new location)
so you quite literally do teleport to the surface, the ship still exists way up above you
so the act of loading/generating a new map is the ship flying around. Then once the map is ready (it's like 2km beneath you), you can TP to it
Very old video but this is the first draft of the mechanic
https://www.youtube.com/watch?v=2Xuh1p-m3P8
And you want to be able to teleport from the surface to the underground without fading? Like a hard cut that shows the camera travelling to the ground and you appearing there?
aah
well, no idea 😛
Maybe we'll have some fullscreen effect sort of simulating the disorientation of teleporting
It'd be easier to sell if it was a 1st person game
Why not just use particles as a VFX to split the player and reassemble them down?
and motion blur or something
I need around 100 entries which consist of a name and a texture 2d, what is better performance wise, using a map variable or creating a data table?
So i have a event that detects on collision how would i detect if i was colliding with two different things at once
Do you need to change it at runtime?
Do you need to index into it all the time?
Does it need to be replicated?
I've been trying to implement Tom Loomen/Fortnite Save the World style hitmasks for skeletal meshes and have the material logic mostly done, however I've been struggling to transform the world space hit location into reference bone space. (Image is the closest I've gotten to it working)
Check if something is overlapping
How do o do dat
@faint pasture 3x no
It's just for input remapping and depending which key the player presses the texture is gonna get chosen from either a map or a data table
Yeah I'd use a map
you can get acceleration from character > movement component but not from pawn > get movement component? Seems it should be in the base pawn
Pawn doesn't necessarily have a movement component
and there are many movementcomponents of which CharacterMovementComponent is just a subclass
Hey, anybody know how I can disable Ctrl+mouseclick to move objects in the viewport? I can't find it in the project or engine settings
Why does my level spawn another character on play?
@cursive grove Do you have the character set to auto possess?
Ah nevermind, forgot the game mode
anyone know how to change the pose of a mesh, the base skeletal mesh is set as an A-pose but the skeletal mesh is set to the T-Pose
How hard would it be to like fake the joining player, by simulating him with some mirrored ai on the client pc ? Vice versa
I guess at the end of the day its always simulation but. ...
So the joining player wouldnt actually join the server
That would probably entail some custom backend stuff as they're not actually joining
That'd be overkill
I guess so
Does anybody know why a blueprint wouldn't read a component's relative rotation correctly? I'm trying to set it via a timeline and for some reason it'll set the rotation correctly but won't read the new rotation correctly when I try to play the same timeline in reverse.
Blueprint for context.
If I call the OpenDoor event it correctly rotates the door to 0,0,127 over the length of the track, but when I call the CloseDoor event, the door instantly snaps back to 0,0,0 as it's reading the relative rotation as having not changed, despite the fact I can see the new rotation in the details panel of the co,mponent in the scene.
hey man was out so i never got to get back to you on this one. i was able to create the new class blueprint (Class_Random) and change the parent actor to be the BP_Pickup so I could select it just like all the others. i wasn't sure as to how to randomize it from the other classes with an array. this is just what i tried doing after looking up some tutorials and got an error with spawn transform, i wanted to at least try something before asking again. there are two blanks and an extra pin to the battery cause that's the simplest way i could think of adding probability of one spawning over the other.
You can have a class array, and just use the "Random" node to pull one. Requires less maintenance and you just add classes to the array as needed.
can you use damage types classes to affect character movement components i.e hitting a enemy causes them to move slower?
thank you i will try this!
Sure
Yes and probably. You're getting into buff/effect frameworks but it depends on what you're trying to do.
So you'll want the concept of a resettable buff with duration
Is this multiplayer?
correct
no
Good answer
So your first thought might be something like
Damage - update speed - delay - update speed
That won't work because that happens when you get hit again before duration is done.
So your second draft might look like BuffActors
that attach to the hit actor?
Which are just actors with a TargetCharacter variable and other stuff, which have Apply and UnApply events, and destroy themselves when their duration is up
i see
Buffs can get really complex really fast. I'd start with BuffActors tho
ok
The endgame would look something like GAS but that might be overkill for single player.
Thanks for your input
Make a BuffActor base class then you'd subclass it for slow, stun, dot, etc
I'd do it like
Buffactor:
Actor/Character/YourCharacter TargetCharacter
float Duration
float Tickrate?
Event OnApply
Event OnRemove
Event Tick/BuffTick
So a slow might look like
OnApply -> Target.Speed -= 100
OnRemove -> Target.Speed +=100
i'll try to implement it, i'll let you know if im stuck, thanks a lot
Hey, I have a problem with all widgets in my project
Text on them Won't update (The same BP works in other projects)
Someone Help?
You're using its rotation as part of a lerp calculation that also sets the rotation. So on every frame the A or B value going into the lerp is changing, and therefore the timeline lerp doesn't work the way you expect.
A lerp works best when you give it two unchanging values. One way to approach that is to store the initial rotation into a variable before running the timeline so that the alpha value can sensibly interpolate between two rock solid rotations. Otherwise you've accidentally made an "RInterpTo" ticking event with a timeline.
oops
You'll probably get an answer if you ask over there
ty
why are widgets so painful
As of now, every time a new icon widget is created it should be added to this array, and print the length and index number.
every time you call and spawn an item this is ran, it should remove the most recent index correct? But it does not.
Something else I noticed is that it runs and returns hello as many times as there are items/icons
if I have one item, and I spawn that item then collect it again, it adds another icon widget which tells me when I spawn the initial item its not deleting that icon from the index
It's like adding ghost icons
I don't think Found Widgets is an array you can actually modify b/c it doesn't exist on a class per se. One of the things I hate about widgets is how you can't "destroy" them, but you can only "remove from parent" and I'm not sure if that removes them from queries like Get All Widgets Of Class. Also when you use Get All XYZ, the array order isn't controllable AFAIK
so what you might want to do is manage your own array
How do I change variables inside a struct thats inside an array of structs without removing the whole struct
mayyybeee.... Array --> Get (as ref) --> Set Elements in Struct
not sure if that works
if not, maybe make some function that does the work on a local copy of that struct in the array, then sets that array element (as ref) with the local copy.
Is it possible to get the name of the pressed modifier key? I have no problem of getting a display name of standard keys like "W", "S" etc but modifier keys just show blank.
I tried that at first, doesn't seem to change anything.
Thanks!
@trim matrix It seems like there are multiple issues. First of all you're seeing very many Hello-s so your execution isn't working the way you think it is. (Couldn't tell you what's wrong but it seems like removeIcon is being called many times).
Second of all I'm not sure what you're trying to do. Is there only one Inventory widget on the screen? I see you're trying to remove index 0 of the Found Widgets array. You're trying to destroy the first-found Inventory widget?
Or did you mean to remove something from the Inventory widget's Icons array?
Is there a node for setting hierarchy in the outliner?
Apparently setting owner is meant to do this but all my characters being spawned are still not being listed under the object I'm setting as their parent.
Not for any gameplay purpose but it makes testing a bit more difficult when I have to scroll through countless character instances that I don't need to see.
what is that small purple line between the nodes mean?
if no one here knows, then try #animation . The blueprint channel is mainly for gameplay logic
every time you collect an item the inventory widget adds a new icon for that specific item and creates an index for it.
makes sense so far...
So when the player spawns the last item, it should get the last index, and remove that widget icon.
I don't know/trust UE's widgets in terms of how they're destroyed and removed from arrays, so here's how I would tackle this in a catch-all manner...
Make a new function cuz we're going to use a "local variable"; this'll basically replace the removeIcon event. In the function, get a ref to your inventory widget; if Get All Widgets of Class works then may as well keep doing what you're doing.
Get the icons array from your inventory widget. Get the last index element and then save the output of that getter into a new local variable. (Right click on pin and "save as new local...")
Remove the last index from the Icons array, NOT the Found Widgets array.
Get your local variable and remove from parent. That's the whole function
Okay I will try that, but this is basically what I want. The same order the items are picked up, then cycled out of the player, I want the icons to be removed accordingly. That's literally all Im trying to achieve
Hello, I have a question about Game User Settings.
While setting the scalability settings of the game via direct console command functions as expected, calling ChangeScalability, GetGameUserSettings, and ApplySettings on a button click seems to permanently freeze the editor.
Does anyone know what might cause a crash like this will using ApplySettings? Any advice would be appreciated.
Cheers.
@tight schooner is this what you mean?
Almost. After setting local variable, remove the last index of the Icons array. And then remove local var from parent.
In C++ there's a function inherited from UObject called PostEditChangeProperty that is called when a property on the object is modified externally. Is there anyway to write a BP function with the same behavior?
Wouldn't that just be your construction script?
Or, more explicitly, I want to set a variable on the Details panel on a BP and have other variables to update their value when this happens.
I had my suspicions I was using the wrong method of interpolation there. For what it's worth, I managed to get it working by changing the way the timeline is used, as such:
that just deletes all icons simultaneously.
That looks correct.
You could even do Lambo doors like that
Im making a script that when an npc goes to a certain place in the overland map, it logs the NPC's data and sets the location map name to the GoTo var name inside the NPC data, and checks the NPC data's Arrived? boolean as well. so when I enter the scene I have an actor that looks for all NPCs stored inside the game instance that have the same GoTo name as the current map named and that have Arrived? ticked to true. It spawns the an npc but i get this error
........ what error
inside the spawn point actor bp
I have a debug so when I click my actor it displays his info. the spawned NPC in the scene has the same info as the npc that travelled to the location in the world map so that works i think..
^
can you stop and then restart a projectile simulation movement? I want to be able to freeze the movement and then start it back up after
it only spawns one npc too not as many NPCs that have the arrived? set to true and the same GoTo name
or better yet if I could turn off the stop simulating after one hit for this particular projectile
The spawn point actor grabs the game instance and checks how many actors have a matching GoTo var as the level name, AND the arrived checked to true. its supposed to spawn as many NPCs as that but its only spawning one
Show all of your logic for spawning the NCPs
Does the construction script allow me to know which variable has been changed without checking all of them?
'Recieved' event at the end is useless so just ignore it. forgot to uncheck that
i'm having a problem getting the hit actor reference, any tips on how to do it?
Spawn Collision Settings?
The hit result has it
how would i convert an actor's local location into world location?
i have the damage type actor add the "frozen effect" (enum that attaches "effect actor" to the hit enemy) this is done via interface so i dont really know how to implement it
get actor location(self)
an actor's local location is always 0,0,0
by definition
or do you mean a components local location
uh what
enum that attaches an actor to a character?
that doesn't make sense
a switch on enum that attaches a actor depending on the enum state (fire, ice, lightning,etc.)
I meant I need the world location of an actor's local location. So if the actor is a plane in this case with dimensions 100x100, the center would Locally be 50,50. I want to know what that 50,50 is in world space, not in the actor's local space. Does that make sense
Why doesnt this work?
hey so I was able to create the class array and added the random node as so, but i still spawn this gray ball. i tried doing this so as to maybe destroy the actor and then spawn a new one in its place, but im not sure how to go about it. i'm not sure if im approaching this correctly. i have placed the battery and flashlight on the table and wanted to add another random item (between another battery, ammo, or nothing) for reference, the third screenshot shows how im selecting them and was trying to see if it was possible for this random class to just pick another of the other classes i specified in the class array in the previous screenshot.
Didn't you say you also had an issue with the event function being called multiple times
when you saw your Hello print node on the screen several times mysteriously? No part of the function itself removed all icons. I still suspect you have another issue happening elsewhere
Why not just set it up such that the center is the center? Are your actors of different sizes but the oritin is at the back/left corner of it?
Either way, the general way to convert from local to world is TransformLocation
using the actor transform
Either that or InverseTransformLocation, one of them
Why doesn't your spell just attach the buff actor?
Or rather, spawn the buff actor, telling it who its target is, and it does the attachment etc
Like say you had a fireball.
Event Hit -> Cast to Character (or do interface call) -> Spawn OnFireBuff(BuffTarget = HitTarget)
thanks
Yeah, I'll keep digging.
Anyone know how I am suppose to use Get Game world? The top one is deprecated in UE5 and I am not familiar with Unreal Editor Subsystem. I am trying to reference the level I am in from an Editor Utility Widget
thanks!
If that worked then you'd InverseTransformLocation to go from world to local (projection etc)
World loc of component is local of comp + world of actor is it not
And world to local is just the reverse
Remove the actors world loc from the transform, and you're at the local..
Why am i getting this error
this only happens when more than one NPC is viable for the for each loop
nvm fixed it
You lose the actor's rotation and scale
10,0,0 local in an actor at 10,0,0 world with rotation 0,0,90 is 10,10,0 world, not 20,0,0
Yo! So I'm making a top-down 2d game, and would like to nix any velocity not associated w/ current movement directions. Anyone know of a clean method to do this?
I.E., Player holds right against a wall, colliding against it. They can tap up or down, and now will slide the length of the wall because some amount of that velocity isn't nixed
tl;dr wanna kill that "slidey" vibe
I'm not fully sure what you're trying to do but if you just need the bit of the velocity in a certain direction you can use the dot product. Dot(Velocity, NormalizedMovementDirection) will give you only the velocity in the direction you're moving. Just remember to make sure your movement direction is normalized
What do you want to have happen if I'm pressing up/right while next to a wall?
Can the character otherwise move diagonally?
so, here's the missing piece-- I'm only tapping up or down
briefly, very briefly, as you can see by how quickly the velocity changes
but it will maintain some amount in that direction despite having no input saying to
I have no issue w/ them "sliding" if the player is inputting for that, but this is an instance where they aren't
@gilded ventureI'd try tune it with friction etc
Yeah, already been through all of the settings unfortunately
Dig around in the CMC settings, assuming you're using the CMC
Turn your acceleration up
or braking acceleration rather
You using analog stick or WASD/Gamepad?
this is WASD
The root of the issue is that the character class comes w/ a capsule that cannot be changed
Why would that have anything to do with it?
This is a capsule vs a perfectly flat wall right?
Correct. But 3d engines have collision that works via repulsion.
When you have a circular object collide with a flat object and some impulse is added on a non-restricted axis, this occurs
Are you saying it slides FURTHER than you would move if you were just standing out in the open and tapped up or down?
yes lmao
That's pretty weird
this is literally tapping the W or S key for a fraction of a second
the only thing I can think of is manually overriding the physics but it seems hacky
Prolly make your own pawn with custom movement at this point
Given that you're going for SNES levels of physics it can't be that complicated...
lol you'd think
ideally I'd just add a second collider to the CMC but UE4 does not like that
@gilded ventureI can't reproduce, what are your walk speed and acceleration settings and capsule size
I just tried walking into a wall and tapping and no sliding here
capsule is a radius of 6, but I'm using flying movement
That's probably it, flying movement is dumpster tier
flying movement component or cmc in flying mode?
cmc in flying
any particular reason why flying?
When I started the project, I was told that for top-down projects flying was the standard due to issues w/ walking on the Z axis
Ya i can reproduce it with flying movement mode
looks like flying tries to coast with any input
Why not just walk in XY and have camera view from above?
Anyway, it's the flying mode's momentum conservation that's doing this. I'd either
- Walk and have game field be in XY like a normal person
- Override Flying math
- Make a custom movement mode
- Do your own movement, it's not that complicated for what you're doing
I'd do either 1 or 4
I have a quick question, I was following this tutorial about a side scroller and wanted to branch off and add a crouch mechanic
But I can’t seem to figure it out, does anyone know how to do it? I’m still messing around in the blue print tying to make it work
CMC has a crouch state I'm pretty sure
It shrinks the capsule, you just need to hook your animation into the crouch boolean or whatever and you're off to the races.
Correct me if I’m wrong, I think your referring to the “is crouching” node, I found it but I don’t know how to associate the animation to the crouching
AnimBP
read IsCrouching, change state machine with it.
Look at the 3rd person template. At least the old mannequin had a good simple AnimBP
I got it to work, but after releasing the crouch button the character remains crouched
What do you do when you release the crouch button?
I put the node “un crouch”
ok, so how are you doing your crouch animation?
Before continuing, the is 2D. The crouch animation is set through a “select node” that is if “is crouched” is true it plays the flip book animation, if it’s false then it connects to set flip book to be run on tick
does anyone know of a really simple way to make Ai attack and deal damage ?
On hit-> apply damage
Or on overlap-> apply damage
On hit you'll want a delay or something
On overlap you'll want to trigger a timer to cause damage periodically while overlapped
do you have a screen shot example by chance ?
Not atm. Im not at my pc
On hit and on overlap are overrideable events for every Collison/mesh component
You can find them in details
i am not really sure how to do that i am still very new to unreal engine :/
anyone know why my imported fbx is having these weird spots in the preview?
I think #graphics might be more qualified?
hey guys so im having a weird issue where i cant add to an array in another object. basically, i created a barebones object class (not actor), that just has one variable which is an array of vectors. now in an actor im creating that object and trying to add things to that array but when i check it later its always empty, no matter if i used add or set to put things in there. whats going on here?
the variable is public and instance editable