#blueprint
402296 messages ยท Page 615 of 403
Yep. You change your variable type to map and set the secondary item to an integer...
Then you can do fun stuff like this:
wow thats usefu
To get the value out of it:
I'd also recommend initializing the map with the defaults all set to 0, just so you have them there ready to access, even if there is no ammo available.
ohh so if i have ammo ak i can change it with this new
current ammo - current ammo = 0, spare ammo - 0 = current ammo
order of execution
set spare ammo, then current ammo
keep in mind that getters (and pure functions) always get the most current value every time a node uses them
Every executed node also re-executes the getters & functions attached to them, effectively re-doing the math from scratch
Would it make sense to create a temporary array wildcard in a macro that runs several times every tick or would it be a better idea to create an array in the blueprint holding the macro to avoid memory allocating and being freed constantly. Or does this probably like not matter?
Please ping on reply ๐
Really you just need to remove one of those subtract nodes, the first one
doesn't need to do either, just needs to reverse his set order.
@spark robin idk but you can try benchmarking it by making it run 10K times in one frame and then manually calling Garbage Collection slightly afterward and see what those two frametime spikes look like ("stat raw" in the console helps)
So you think it would affect frame time? @tight schooner
ticks are linked to framerate
I assume you're asking about performance and doing tests is kind of the only way to answer esoteric BP performance questions
So my projectile needs to slow down the AI character it is hitting. I use the GamestateBP to process the slowing effect. The characters are slowed like expected, but after the delay it does not apply the backward operation : Slowed down to normal speed. Though it does exec after the delay.
Yeah Idk I were thinking maybe it puts some unnecessary stress on the memory buzz. But Idk anything about how different pc components communicate so ๐คทโโ๏ธ
Might do a test
I will just finish my program first and see if it can be optimized later if necessary
@spark robin generally speaking reusing stuff (e.g. pooling actors) rather than spawning and destroying things is lighter on performance and the way that UE4 manages memory via "garbage collection" but I can't say with any certainty that, if you do this test, what results you'll get
Set it back to initial speed, you save it in a variable. Don't do the math after the delay.
Okay ๐
But also... generally speaking... one should aim to get it working first and then optimize later if performance profiling indicates a problem
If you want a true slow motion effect, you can also look into using CustomTimeDilation instead too.
@proud hull Tried it, forgot I had this. Still not working
Maybe use a timer instead then.
Look, the execution until the end is working
Is this logic inside the projectile? Maybe make the projectile call an event on the actor to have it manage it's own speed.
I'm guessing your projectile destroys itself and that might be causing the issue.
That's why I'm actually managing the slowing effect from an external BP, to avoid the issue of the projectile being destroyed.
But, it actually works, when only 1 projectile hit the ennemy, after 1 sec he find back his initial speed
It's the delay that causes that.
but when 2 or more projectiles hits the ennemy while under slow effect, it will only trigger the last max speed
That a retriggerable delay?
I think I got it, while or after a second slow effect, it will Set Max Walk Speed -1 from the first slow effect
Ah, I see why you did the math after the delay. You want a stacking effect?
yeah ! ๐
Gotcha, that makes sense
MaxWalkSpeed=400 Original, on hit -40%=240, after 1 sec, come back to 400. But if -40% while MaxWalkSpeed=240 then it just sets the MaxWalkSpeed to 240
If i'm clear enough
Base all your math on initial speed and only set it once in construct.
If you re-set it each time movement changes, it will never know what was the actual original speed
Then you can use it in the formula without any numbers changing between hits
So having another variable from the character BP himself, something like 'Initial Max Walk Speed', that won't get edited
Oh wait, so not stacking?
You just want each hit to reset the timer?
That would be retriggerable delay
Well, I think the more smooth way would be each hit will add a -X set value of slow effect, and Y time after each one of this hits, it add +X on the walk speed.
Ok so stacking, hehe
Your original code was closest
You just need to save initial speed in construct or begin play.
You're right, i'mma try this right now !
Are you planning on having different slowing amounts for the character at any point?
40% reduction each hit it seems, right?
For 1 sec
So actually get rid of initial altogether
Your 2nd math is off since it is based on the new max speed value
@maiden wadi Yeah*
Was just going to make the point that if you're planning on having different slowing effects, like one effect does 40%, another does 20%, etc. It'd be best to use an array. Have each index be a slow multiplier and a duration. On effect, update the array, then apply the largest slow effect to the player until it wears off, then check for lesser effects.
Max speed * 0.4 for first part. After delay, Max speed / 0.4, make sure to round/clamp.
No need for array, this will work multiple stacks in
For instance, speed of 100 would be 40 after one stack, then 16 with 2 stacks, then return to 40 when one stack is done and then 100 when both are done.
your using the current ammo after the set, not current ammo before the set.
@maiden wadi Yeah when I'll need it's a good idea to implement it that way. But i'm already struggling for a basic stacking effect, so i'll keep it clear and simple for now, and when i'll move on different slows, i'll do by arrays.
CurrentSpareAmmo - CurrentAmmo is all you need for setting CurrentSpareAmmo at the end.
@proud hull Wait i'm trying to understand what you said !
Just don't add an subtract. Only multiply and divide.
Set max speed = max speed * 0.4 >>> delay node >>> set max speed = max speed / 0.4
Easy as pie, well easier, let's see you calculate pi
https://gyazo.com/f1dd3ad9addb9f1129a16bebffbd6ce4 hello, i am trying to save this variable (save game), so when i close the game and reopen it it is still true, thanks you
Wait, If MaxSpeed=100 then 100*0.4=40, meaning I would set the max speed to 40% , and not 60%
Then multiply by 0.6
@sonic cipher look into the save game system if you want to save variables to disk
https://gyazo.com/8820fcaf58c8ba92dd952e6e7a01efa1 so you speak about this node ?
The logic remains the same no matter how much speed is reduced, hehe
@sonic cipher yeah. See: https://youtu.be/_4usRrTiqak
thanks i'm going to look ๐
@proud hull so it works def easier that way, you are right, thing is the main problem is still here, the stacking set the MaxWalkSpeed to the precedent one.
I might miss something easy here
Can you show what you have now?
Using math should do it, no matter how many stacks are on.
@proud hull
Pls tell me
Are you only applying this to one character or will multiple trigger this?
@prime moss just in case, are you tiping the good inputs ? Check in ProjectSettings
@proud hull This comes directly from the ProjectileBP
StatusIce is the the event from the slow effect BP.
It apply that effect to any character overlapping the projectile
Once on this case
Your references in RoundState will keep switching to whatever last called the event.
You are better off making an event in the character/pawn itself and have that event simply change the max speed and do the delay.
Then have RoundState call that event for the actor
For instance, I hit NPC1, they slow down, but then I hit NPC2, they slow down, but now the delay uses character movement variable for NPC1's delay, but character movement variable has NPC2's character movement saved in it.
Just move your logic into the character. And all is good.
Just the max speed stuff.
You got all your references already, the hard part is taken care of.
before thinking about multiple targets, the max speed doesn't come to the inital one with that code, on a single target
It should... 100 * 0.6 = 60, then 60 / 0.6 = 100
I wanted to centralize these effects on one BP, simply because I have different types of 'ennemis characters' that are all parents
Seems to me like you made yourself a middleman that isn't really necessary, hehe
Honestly, you could have projectile hit directly trigger the slow movement event inside the pawn/character if the logic was moved there.
Otherwise, if you want to use a "manager" actor, you cannot save references like that. Would have to be its own function and set local variables.
Which is another option really, turn that into a function within RoundState, and you can use local variables.
thing is that i have to make it in gameinstance because i want to show it in menu
Look this is what is happening. I'm using 0.6 as reference of slowing effect. MaxSpeed=400. Character gets hit once, MaxSpeed=240, Then delay 1.0 sec, then MaxSpeed=400.
Isn't that supposed to happen?
When Character gets hit 2 times before the delay is passed, it MaxSpeed=240 on first hit, then =144 on second hit, then delay, then MaxSpeed=240
The second text isn't supposed to happen, the first part, first hit yeah
Initial speed = 400
Hit 1 = 240 (0.25 seconds passed)
Hit 2 = 144 (0.75 seconds passed)
1 second passed = 240
1.75 seconds passed = 400
That is the current setup
yeah, and it does not happen that way fully. The '1.75 seconds passed = 400' part doesn't happen
I dunno then. I suspect it is the delay messing everything up which is why I avoid them like Corona.
Delay node = worst node ever created
And everyone uses it way too much
Any hit after the delay is starting to be executed until the end of it's execution, will only apply the negative formula, and once the delay is executed, the positive formula will be applied once.
it is definitively the delay that fucks this up
I'm fairly certain this would solve itself if that logic was inside the pawn/character and your RoundState simply called that event for the pawn/character.
That way each pawn can manage their own speed, but have the RoundState manage their event calls.
I'll go for this way anyways, seems like the most safe one. Thanks for your time, a lot !
No problem. If it still isn't working after making the switch, let me know. I can actually open a project and try to create it real quick.
I'll make a try of copying everything on the AIcharBP after my cig and I tell you ๐
Smoke break, good idea.
incase anyone else wants this... simple reload function:
and coffee!
Now do it with only 1 return node and no branch node. ๐
How can i open this?
Can't
I need it for an auto landscape material
what do you mean by open it?
right click and convert to parameter? is that what you mean?
still not understanding what you want... you need to be a little more clear.... maybe....
i got the vertexnormalWS which i have to multiply with a vector that has 1 on all the three axis
points to previous pic
High benefit of watching a beginner tutorial for materials
Bam! So simple, hehe.
So I'm having a play about with adding force to objects. You can't add a force to an actor itself, you have to add it to a mesh component. This is fine and I'm getting the desired effect but one thing I noticed is that doing a getactorlocation on event tick (just to see) does not update the coordinates of the actor's location. It seems like the mesh is moving around but the actor is still in the starting location it was placed. Is this anything to be concerned about or is this behaving as expected?
@proud hull So i've didn't made the copy still, but I was thinking that I would have the same problem anyways, concerning the delay. Simply because once a delay starts it dosn't get any more input until finished, except retriggerable delays, but that isn't what I want !
Is there a way to make a timer or delay to be executed multiple times ?
Timelines have a 'play from start' pin which can be triggered multiple times however you want
Do they run concurrently?
Like same timeline node, play it two times at the same time
You can have multiple tracks running at the same time, they can either execute on an update, execute on finish or with an event track execute whenever you want
nope
Just tested, it doesnt
So if you had two things you wanted to execute after, say, 5 seconds - wait - and execute another 5 seconds later are up you can set the length of the timeline to 10 seconds, add 2 event tracks with 2 keyframes each at 5 and 10 second mark, they will have their separate execute pins and will fire off concurrently
Best solution we came up with before was limiting the number of stacks and make a separate timer for each stack.
You premake these timers in begin play, save their reference, then you can use them over and over for anything with a delay.
I see, so essentially the same thing as what I explained with timers, just the timeline version.
Timelines are easier to setup, so go with that.
Wait, how do I run them concurrently, not seeing any extra exec pins when adding more tracks.
So I'm having a play about with adding force to objects. You can't add a force to an actor itself, you have to add it to a mesh component. This is fine and I'm getting the desired effect but one thing I noticed is that doing a getactorlocation on event tick (just to see) does not update the coordinates of the actor's location. It seems like the mesh is moving around but the actor is still in the starting location it was placed. Is this anything to be concerned about or is this behaving as expected?
Anyone able to answer this please?
Make sure you select an 'Event track'
Ah, I was using float, my go to when messing with timelines. Never really messed with the other options, haha.
I've played about with them quite a bit, they're pretty versatile. You can also swap out tracks on the fly in blueprints using external curves - if anything makes it a bit neater than having a ton of tracks on one timeline!
This executes all of the event tracks every play.... Need them concurrent, but activated one at a time.
Are you using the 'update' pin?
This would not work. You would effectively be giving your player ammo that they may not have as you're adding ammo into your current ammo without checking your spare ammo.
If so you don't want to be using that
Use the indivdual exec pins from the event tracks
Nah it works, tested already.
Adding the difference of magazine - ammo
So if you reload when not empty.
Thanks for your time guys, i'll read this again after my little lunch. So at the end there is a way with either delays, timers or timelines to make each one of them execute multiple times on the same exec ?
Current Ammo 8
Magazine Size 12 (Wouldn't change)
Spare Ammo 2
(Magazine Size - Current Ammo = 4) + (Current Ammo 8) = 12. You've given them 4 Ammo.
Spare Ammo 2 - (Magazine Size - Current Ammo = 4) MAX 0 = You've removed 2 ammo from spare.
Oh, you are right, I didn't test to empty spare ammo, my bad, can clamp that easily
Bug-free version
Now convert to C++ and you got yourself one really efficient reload function.
Did anyone had issues with DataAssets, where they are NULL in packaged builds?
Everything works fine in editor, but all the references are None in build..
did they get cooked out?
Add them to "Additional Asset Directories to Cook"?
Well, that's a good point, but it works in Windows build but does not work on Android..
But in other project I had the same issue with Windows build.
Or if it is cooking messing it up, add them to "Directories to never cook". I've never messed with this stuff, just guessing, but I'd troubleshoot in that route.
if someone can help me with a savegame please, i can't make it work
What you got so far?
i have a menu, in this menu i have 1 map, then when i play if i overlap a trigger so i unlock the 2nd map in the menu
problem is that if i close the game, 2nd map is locked again (hidden button)
yep, i would like to save the variable
i show you the save game bp
Can I see what is further left too?
Looks like you are saving correctly. Where do you load from that save slot to then populate your variables?
Hi, I'm trying to add instance of my dirt block. But blocks are spawning on my head (acc on my camera). How can I solve this?
Unless you are reading directly from the save game for everything now.
I load from the same BP, in a function called LoadGame : https://gyazo.com/ce123484ebe9b7b8d709024919c7d300
I think this is right @_@
void AFunctionLibrary::Reload(const int CurrentAmmo, const int MagazineSize, const int SpareAmmo, int& NewCurrentAmmo, int& NewSpareAmmo)
{
int DesiredAmmo = MagazineSize - CurrentAmmo;
NewCurrentAmmo = CurrentAmmo + (FMath::Min(DesiredAmmo, FMath::Max(SpareAmmo - DesiredAmmo, 0)));
NewSpareAmmo = FMath::Max(SpareAmmo - (MagazineSize - CurrentAmmo), 0);
}
Like this
@proud hull Just to say thanks for your time, even tho I will stack only on substract and not on addition. Design wise will be better ๐
Haha, you actually did convert, that is great.
You then plug the return info into where it needs to be saved?
Hum, i guess so :v
if my player_BP collides with WayPoint_BP how can i get Which collision sphere was collided, i have 2 one largeone for discovering the waypoint and one inner one for using waypnt
Where do you call your load game function?
It is not my blueprint i'mm trying to edit it to save this variable :v
i think it is where it is called
https://gyazo.com/6898f40c0e22f73657b560b2129ed1b9 i have this too in the bp
In your main menu, where do you use the save game info? You should be calling Load Game somewhere to set the variables in your main menu to match what is in the save game.
Hi, I'm trying to add instance of my dirt block. But blocks are spawning on my head (acc on my camera). How can I solve this?
Use Actors to Ignore array input.
Hum, is that possible that it is called when i start ? it launch mygameinstanceinfo maybe ? because the nodes that i showed you are inside it and it is in my project settings https://gyazo.com/410bcdf026986388fbef76afccbc123a so does it get called here ?
How can I do?
Just because the function exists, doesn't mean it gets called. You need to have your main menu load from game slot and set the variables it uses.
i think you have to drag actors to ignore > make array and add your actor
What actor should I ignore??
Camera or something?
your dirt block
i'm going to try to find where it is called ^^
Dirt block, player character unless this is in player character bp and you have ignore self checked.
I get this
Right click the function, find references, then click binoculars to find references in all blueprints.
I get this error
Maybe try this trace instead.
https://gyazo.com/04cba0c6096ece7c566c7737e644d1ac i think it get called from PC_lobby (player controller)
Do you see it in your main menu widget?
hum no i don't think so
btw, I'm following this tutorial https://www.youtube.com/watch?v=fjt6O0h2Dyo&list=PLZ7R1eB0AmM-1duebqThOg0zsjESkSmkj&index=5
In PART of 1 of the next few videos, we'll discuss adding TWO different types of blocks to our game by clicking the left mouse button like in minecraft :)
SOON after we'll learn how to delete those blocks as well.
CHECK IT!!!
PLEASE SUBSCRIBE!!!!
and check out "DepriveD" Final Alpha EP
on BAND CAMP!!
https://deprived2018.bandcamp.com/releases...
Wow, that guy is hyper! lol
I want to solve this pls ๐ฆ
The cylinder in the screenshot is your player character?
I made cylinder for seeing the player. Normally its transparent charactrer.
That object doesnt affect anything
You sure? One of your first screenshots it looked like the trace hit that character.
This one: #blueprint message
Wait a sec
That tutorial series was for first person view, so no character should get in the way of the trace.
Or at least I only saw first person view in that particular video.
https://gyazo.com/fe181388a25d717710b8aae266bcff0b i think i found where it is called
maybe try to check overlap on the visibility and camera of your character mesh
Ok that looks better. So all your blueprints read from that Player Settings variable?
My dum head. Thank you so much ๐
This would cast to all actors of EntityCharBP right ? Not the Other actor from input only ? If so, how can I launch the event on THAT specific actor ?
i think it does
Nah, your character's dumb head got in the way, haha.
That would run only for that specific actor.
Check your main menu blueprint and where does it test whether or not you unlocked a level.
this ? it check if it is true or not and if true it show the button
You are loading from a different place than where the load game function sets it. You will need to edit the load game function above to set game instance variables instead. #blueprint message
Save Game function: Get variables from Game Instance and set them in Save Game BP
Load Game function: Get variables from Save Game BP and set them in Game Instance
Okay i will try to do this thanks you ๐ not an easy task this BP xd
Both sphere colliders will have their own events.
Just make sure you aren't doing the collision test in Waypoint_BP, do it on your player character and use Other Actor pin to cast to Waypoint_BP, if it is successful, you know you hit a waypoint.
BP_SplinePath = WayPoint_BP
Make a new project with ALSv4 and check out what they did.
https://www.youtube.com/watch?v=DOU5gvSlfPE i think this is what you want
In this video, I'll show you how to switch between default Third Person template control player rotation system to character rotation based on camera rotation. This is the most used for Third Person video games nowadays.
Support me on Ko-Fi for my current indie game development at Loish Games
https://ko-fi.com/loish
#ue4 #tutorial #gamedev
That is a bit different. More so looking to trigger a rotation animation when camera angle relative to player forward vector hits a certain threshold (45, 90, etc.)
Advanced Locomotion System did this already so should be a good example and you can probably copy/paste most of the stuff right into your project, or import the whole ALS project in and work out of one project to copy it over.
@proud hull Sorry for ping, I do all of the things. Now I can place block, but I have a one problem. Trace doesnt work for block sides. I can only place block when look other block's mid point. How can I solve this?
Yeah you are right ^^ anyway i hope it isn't a copyrighted character lol
do you have a box collision indide ?
If I don't look the mid of block, it will be place on top
check "Trace Complex"
Same
Hello, is there a way to add any type of gizmo (Like a player start icon gizmo) to a scene component in the blueprint editor window. I have a few scene components which moves every time any property is changed. It would be nice if I could visualize where those components end up, hence the gizmos.
I only have this
And they have like this:
are they making the size of your block ?
they are instanced static mesh
Hmmm, size is a good point though.
I call them from code and spawn them
maybe when you spawn a cube then the size is not set good
Does your tile size match the size of your blocks?
Hey all are 1, 1, 1
Oh, nvm, you have multiple placed, so it should
Which trace are you running now? You can set back to by channel if you are running by object.
Ignore self is usually checked in most cases.
If I check, I can't place
You running this from a level blueprint or something?
And the actor is the same as the cubes the trace is now passing through?
So I'm placing a cube and that cube has the logic for the line trace? Seems so odd....
Ignore self means to ignore the actor executing the line trace. That line trace should be done in your player character.
Move the line trace stuff to your character, you are doing it backwards.
The terrain shouldn't handle what the player does, hehe
I want to try it. But my blocks are in this actor. So how can I cast to MC->dirt_block
Hit Actor
You get the reference there in the line trace
If you hit your terrain with line trace, you will be able to cast that to MC
I cant find add instance
Keep the add instance part in your terrain blueprint, make it a separate event/function.
or like that?
Yes, that
same issue ๐ฆ
Trace is done in character now?
There is something wrong with your collision settings then.
Where can I look or change?
#legacy-physics would know more.
Okey thank you for your attention and help ๐
i have a compiler error after trying to cook the game, just because i edited a structure, even after removing what i added, still error ...
what is the error
error structure everywhere, i checked on the non-edited project and it has the same things but without errors
what version are you using?
4.26
i had no errors before, now that i edited i can't remove this
https://gyazo.com/b864266687b7269c970a4f2d7176c335 don't know whats wrong i did not touched this
This used to be a big problem in like 4.15-4.19 but they've said it has been fixed
I ran into this issue before and ended up having to remake all my structs
aaaaaa uff x) big problem really :v
unfortunately the BP structs kind of suck
hum yeah i should report that to epic
we ended up converting all the structs to c++
thanks you i hope i can fix
hrm... i have a door issue..... wondering if someone can give some advice...
if the player stops in the doors path the door stops moving, i need it to either push the player out of the way or squishy them ๐
why not keep the door open while the player is there?
its a timed door
add force when?
Thanks you, renaming all my structures worked, strange bug trough. also thanks @proud hull for help
these @weary jackal ?
that would mean everytime you hit the door then it add impulse no ?
even if it is closed
you should maybe add a variable "is closing" when the door close then if it is closing on component hit give impulse ?
I think there's an easier way
nah i can check to see the doors state (closing, opening, dorment)
there should be a physics setting on the door
because even if the door is closing and the player just runs into the door, it will still fire
wouldn't the physics cause a issue with the other door?
How can I get all the actors from the SphereOverlapActors ?
iterate over the out array
For crushing you can add bool isClosing. And on hit simulate physics. Also let capsule ignore door collisions and mesh should block it
For 2nd one. Teleport
drag off the array and type foreach
oops... physics >.<
@solemn parcel are you making interaction?
?
Interact with an object
Nah for now you are checking with class. What you can do is add interface to all actors that are interactive
you can avoid the class check you're doing by using the ActorClassFilter on the SphereOverlapActors
guess i could just add a blocking volume thats active when the door is opening & closing...
There's a node 'Get overlapping actors' with target as self and you'll get an array
But if I have multiple different classes to check
To use that you will need some sort of sphere/box/etc collision though
No
Ok been a while since I messed with blueprint interfaces and I've already forgot a ton of stuff. Left (new project) / Right (old project). As far as I can tell I have created a bpi and function on left in the exact same way as I have on right however the target pin is incompatible with the 'other' pin in the new project. Can anybody think why this would be different? Also, whats with the envelope icon in the node of the right string? Can't remember what that signifies.
Just implement interface in what items you want to check.
you need to cast 'Other' to your BPI
@primal smelt it is interface message
Sorry there are still plent yof basics I'm unfamiliar with or rusty on. But how is it that I did not have to cast on the old project?
No you don't have to cast
Ok thanks, any idea why this isn't on the node for the new project (left)?
If you create an inter face function, let's say function1. Then there will be function1 (message) in your bpi.
The reason is maybe the interface is missing
You can do it either way,
Interface Class is class specific, Message is not
Any idea how I should go about troubleshooting this? Here are both bpis and they should be set up in the same way, the old one just has an extra output
What happens if you drag off Other and type 'Select WC'?
That did it cheers, just realised I didn't have context sensitive de-selected which is why I wasn't seeing it! Long day :p
Hi, I'm trying to place blocks (voxel's) and they are instanced static meshes. But I only place it when I look middle of the block. If I look 1 pixel up it will be place the block on the top of my head. But I want to if I look this side it will be place next to this side. How can I do that?
Does anybody know if an event hit will pick up a line trace? So Dude01 fires line trace that hits Dude02. Does all the code need to be in Dude01's blueprint or could an event hit in Dude02's blueprint also detect the line trace?
no a trace does not trigger event hit
Ok cool thanks, good to know
Can someone help me debug why my while loop is crashing my game constantly...
sure post some screen shots
it doesn't look like you're actually rotating in the loop body
im setting the rotation speed for the rotation component
i know the character rotating part works but eitherway it for some reason doesn't change the bool
ah I see it now
or it does but still considers it an infinite loop?
honestly this seems like the wrong way to go about this
found the problem with the door, i originally had Sweep set on setrelativelocation:
you probably want to use something like this
and do it in event tick, not a while loop
yeah sleeper i know, but i'm trying to do it in a function
also for the record here's a cleaner screen cap
well that's not really how while loops work
i mean i'm getting a bool, while that bool is true do the loop (set the rotation speed)
they're a bit different in BP because of how they need to work to function
inside the loop check for the bool again
but you should think of a while loop executing everything in 1 tick
oh.. so you're saying it's just dumping the values before it has time to finish?
is setting a actors scale a okay method to increasing their overall size? or does that cause issues? know some static meshes have issues with their collision when they are scaled.
you need to interp over tick
it's acting like an interrupt?
for smooth rotation
ukaos i'm just setting the rotation components rotation rate
if it was functioning correctly, your character would turn instantly
i'm not actually moving my character X degrees
yeah but why use the while loop? i don't see what that is doing?
but you can check if your facing target, in tick, and then stop the interp
no need for this extra stuff
i need to look up how to use the interp stuff
never touched it yet
ok but the issue with checking it in tick is that this function is ran from a custom event
and i only want to run it once
but that while loop will lock your game thread
yeah i know hence my issue
yeah i was getting inf loops. Ok so i guess i need to rethink this entirely
to give you context im doing a top down game right, so when i right click it plays a montage and i want the character who is facing somewhere to rotate towards where i clicked while playing that montage
but it does a simple check to make sure you are not already facing that location, if you are not, it sets a bool (bEnableRotationTick) for example, and caches the location to face, your tick will check if that bool is true, then it will check if you have reached that location, and turn that bool off again
i assume rotating movement moves it
but that is all you need to do
ok but that would mean i need to put a bool checker in ontick that sets rotation to 0 if bool is false right?
so even if nothing is happening it's still checking that bool and setting a rotation constantly
There's a node 'find look at rotation'
i guess that's one way of doing it dirt. So in my function i would just define the variables and let tick handle it?
yes
if you want to use rotating component
i mean i'm not fixed on anything i just assumed a rotating component would be easier i didn't know there's a node that rotates over a fixed time from an angle to another angle
i guess it solves the issue of which angle is quickest to get from point a to point b
which i was gonna do later anyways
Man, for pawn inside character movement, you will find rotation rate. Also stop using yaw. It will make rotation smooth. Then the interept will be much better
@crimson swan you could do something like this
also
not tested and is simple AF
Hi! this is how my lvl is supposed to look like
sometimes things disappear when PIE
Is your city one giant mesh?
No
is the ground (sidewalk, roads, etc) one large mesh?
my immediate guess would be some occlusion/visibility culling issue
do they reappear when you move around/change camera direction?
or if they're gone, they're gone?
Some of the objects that disappear are small meshes too. not only those large ones tho
no, if they're gone they're gona,
as if I deleted them completely
Sometimes this happens and sometimes everything's fine. no pattern that I could detect
Have you tried restarting the editor?
ah when you said it's never happened before I thought you meant just now
oh no, I meant in my UE4 experience of a few years
Does it happen when playing in editor viewport or only separate window?
so if you play in editor viewport and pause are you able to select the disappeared object?
can you find it in the world outliner?
I need to have a look. Trying to reproduce this now.
yes I can
and if I hide and unhide it, it's back
Maybe you're using level streaming and forgot to load the level
All sub-levels are always streamed
In fact, this issue only happens sometimes with no distinct pattern to iut
also check out all the images, sometimes everything goes crazy
Sometimes things just vanish, sometimes they go like this
some of the city-wide meshes try turning off "use for occlusion"
Or try to play the game in spectator mode and check if the road collision is enabled or no
That may help
If you run PIE then press alt+s to eject from the pawn, does that change anything?
a temporary solution might be to cover the city block with a volume and parent all your disappearing meshes to the volume, then turn on "use parent bounds".
It's not exactly efficient tho
had a college assignment that had us import all of Vegas into ue4 from a provided sketchUp mesh. It had a lot of the same issues. What fixed it was separating all the buildings to individual meshes, breaking up the sidewalks, replacing roads and grass with landscape.
I think what the main issue was, the origin point of the meshes were falling behind other large geometry
It's indeed a giant datasmith exterior, most of it. but this problem didn't happen until recently
Try #level-design
Also how do you explain the random occasions when this happens?
I can't, I can only assume that the z order is having a hell of a time
Ok I see. thanks
another thing to try. Create a new, empty sublevel; make the sublevel the active sublevel, then make the sublevel hidden. Select any large meshes in the scene and migrate (ctrl+m) them into the hidden sublevel. Run PIE after every move to see if it changes anything.
Can I make a custom event like ''event begin play'' or ''event tick'' from a behaviour tree task?
There is a blueprint Node called "Find look at Rotation" which finds the rotation to let an object look at a specific position. This is for the X axis, is there also a node for the Z and Y axis?
Can someone tell me why the sweep pins from Overlapping events returns false randomly ? Having the sweep/hit locations from BreakHitResults works randomly, and the 'FromSweep' Pin returns true/false randomly
And I kinda need that Impact Point Location
Hello guys,
I need to get the closest point on the collision but the problem is, the existing function only works when that point is outside of the collision, is it possible to get closest point from inside the collision?
Hello! I'm having an issue using the GASshooter template of Reuben.
Reuben splits the logic fire between client and server, and waits for validation.
I'm trying to branch in the final step when the GE/FX is applied to the target, based on the current health of my target. However, health in the client is always one step backwards so is not reliable (for example I need one extra shot to trigger the wanted FX if the target reaches XXX)
Anyone knows any node or way of saying inside a GA how to declare the server has authority over an attribute? I can't find a correct function to override client data. I want to declare server has authority, and update client data from server BEFORE applying the GE.
UPDATE: Reuben made a "wait one frame" function that gives initial good results. However, this is me playing around and I think is not reliable at all. Another GAS function tested is the waitSync (client or server) but looks like not working / bypassing.
@solemn parcel I believe the bSweep only returns true when the volume is being updated by blueprints. If it's not moving, and another actor overlaps the volume, then it would return false.
Instead, try using a branch that returns true if the impact point is not equal to 0
Here's a rough breakdown of what LookAt is doing. Maybe you can extrapolate from here?
with the makeRotFromZX node and other similar makeRot nodes, keep in mind that the first direction is a priority direction and the second helps establish a twist along the priority.
So in this case, the actor will always orient its Z axis up in world space, but will twist to point the X axis towards the target actor
@solemn parcel I made a mistake. The overlap node doesn't typically return a impact point at all.
Hey, i was asking myself about save games
If i save for exemple players controls in "save" slot, then i load it on start game
Then i save the position of the player in the same "save" slot, will it erase the controls that are saved and remplace them by the position of the player or does it merge in it ?
the User Index for saveGameToSlot only matters if the Slot names are the same
So the player's controls can be saved to a slot named controls and you could use index 0 and never worry about it overlapping with other savegames
different saveGame classes will still occupy the same namespace when saving. So if your controls were saved under "save"/Index 0, and your character positions were saved under "save"/Index 0, then they would overwrite eachother
Hi, why my material is like that?
Sorry Poyraz, I can't really tell what's wrong?
It should be like this.
Is this good replication?
Try scaling the texture
I'm trying now.
How can I get this node?
the node is a "constant". Hotkey is hold 1 and left click
Okay thanks
@dull tree This is best asked in #multiplayer . I've tooled with a lot of multiplayer stuff but I definitely don't know what standard looks like.
Know its better than old version. But not exact the same texture.
(Selected block is normal correct textured block)
Best guess to what happened is the wrong block has some goofy UVs
I did same
@trim matrix What does it return then ?
How would I set it up so I can find the location of either the closest 3 objects or a random object from a chosen list?
if you want to try finagling with the material UVs some more...
I made multiply value 4. But their texture are colliding
example I got 3 food sources in my scene, I want to find the location of the closest food source
It seems to be the last saved object
I tested with two saveGame objects (using different created classes) that store a print value. The last one saved in a sequence is what is loaded.
I tried this and it get worse
worse than this
what software is your cube imported from
yes but the cube geometry. Is that just in engine or did you create it in blender or 3dsmax etc?
No, only engine.
Should I send texture?
are you using this cube?
this one should work for your use-case
the starterContent Shapes should also work
Okey wait a sec
if you created your project with default settings in the launcher, you will have starter content (I believe)
I can't use Shape_Cube, I must use different
Can I use one of them?
Okey I solved I think
okay thanks for help ๐
I selected this
If I choose this, will I have a problem in the future?
Because for now, everything is perfect.
if you created a default cube from blender, The UVs will appear stretched because of this layout
can I get the Impact Point of an Overlapping actor by somewhere else than by breaking the sweep result ?
I don't think overlap produces any impact point results. If you're getting an impact point at all, it's because an object is actually colliding with the actor.
hey if that content cube works for you, don't sweat the blender cube
So how to find that Collision Point ?
Hey that cube worked. Should I stick with this, or dont?
I don't know it has collision ๐
use OnComponentHit
stick with it if it works
Okey, thank you so much for your attention and help โค๏ธ
@trim matrix I can't tho, I need to use only overlapping for that detection, hit is being used for World Static
if you show me your use-case then I can help better
Since your object is a sphere, you can use a sphereTraceForObjects or sphereTraceByChannel to get a impact point
is* your sphere sliding along a path or are you teleporting it somewhere
nvm I see your projectile movement component so i'll assume this sphere is a projectile
any idea why set actor location will not work anymore. any time i hit restart game and it go back to play stay the ball sit at same location and just rolls from them
Its a projectile yeah
bind even being called here
well im working on the trace right now, I just wanted to avoid this to keep it as light as possible
something like this should do it
So overlapping being useless ?
Overlapping will not get you impact point. But sphere trace definitely will.
if you didn't need impact point, only the object location, overlapping would be just fine.
but if impact point is a must-have. This is the way to go
if the ball is on the ground, sweep will actually not move
the tickbox on setActorLocation node
interesting question for all of you here. Does toggling collisions trigger an overlap event every time?
this comes to mind. The actor might try creating emitters every tick unless you branch InitialOverlap.
ah. I really don't understand what would cause that. Sorry it didn't help.
i fix it when i move the z locatin it move
yeah that's what i was about to suggest
your issue is it can't actually fit where you want it to go
when you spawn an actor you have a setting that checks if it can fit and gives you options based on that. Same thing here except you don't have that option so i'm guessing it's just returning an error or something
gotcha. i move it up 70 to fit the other actor and it started setting it location after i hit restart
This seems to produce an overlap every timer loop
this is the code i'm running, kinda zoomed out but you get the gist of it. So the enemy has this setup
it only executes on the first collision, my guess is because the player is already in the overlap when it's being toggled so it doesn't technically overlap again?
is it overlapping itself or is the player a separate actor?
I've set up the reverse, where the player is attacking an enemy and had the same issue happen
I made the player helicopter attack with the same collider and it would only hit once. But if I alt+S during the attack so that I'm in spectator mode, then the attack seems to hit as expected
I never figured it out
alright, time to find a ghetto solution then
it did not seem to be linked to framerate either
yeah sorry lol
I still have that project somewhere, I'll try to find it and post a gif.
location will be 0,0,0
trying to find closest food location
trace results work I suppose?
yeah i know what your bug is, i spent a day tracking it down for myself
gimme a sec
do this
controller -> blackboard
if you do the key method it just picks the first item in the blackboard enum
@crimson swan is that aiming towards me?
yes
Ah okay, I dont understand tho haha
i'll draw it out gimme a sec
yeah it's 100% the same issue i was having
thats reassuring
@trim matrix
turns out I don't have that project somewhere. rip
@trim matrix oh no worries lol
i think its an array issue
like it cant find the vector or something
sorry its messy
and the printout of the value for closest food is 0,0,0 right?
where are you setting closest food
Probably the cube its walking on
my guess is it's taking the default value for that variable
set the default to like 100,100,100 and you'll be printing 100 100 100
or rather no sorry that makes no sense XD
it's an actor right? so try printing the actor(closestfood)
it's gonna tell you what type it is
@trim matrix is that tick inside a BT Task?
if so why?
tasks are to do one job, if you don't find food, end the task and try something else
yeah but you don't need to use tick, using Execute AI is fine
not using tick
oh
its what I used to find closest
that was not made clear
my bad
Keep doing you but I noticed three things you should probably address eventually.
- SphereTrace is pretty expensive. You can probably get a way with doing a SphereOverlapActors.
- I'm not sure why you're doing this on tick(maybe for testing which is fine) but you can probably use a SphereCollider and utilize the BeginOverlap/EndOverlap functionality instead of the SphereOverlapActors
- You can consolidate the "store noticed victims" and "find closest" to 1 ForEach instead of 2 improving this function's speed.
@unique harness Thats the example im working off ๐
@trim matrix i'm not 100% sure on this but i think your closest food is always gonna be null because closest distance is always gonna be its initial value which is always gonna be less than any other element
perfect, now you know what not to copy ๐
its ok i am helping him in the correct channel
@unique harness haha I was just looking for ideas on how to do it
@unique harness @worthy frost do you guys have any ideas how to cause an "onbeginoverlap" event to trigger when you toggle collision on and off?
like generate an event for all actors already overlapping?
this is only triggering once (if the player is already in the zone that is)
it's on a timer, so it should be triggering every say 1.5 seconds, but it's not. it's just doing it once and that's it
I don't understand your exact question, could you try again?
ok, i have an npc that chases the player and deals damage. This is ran from a behavior tree. It executes this code that i've shown
now the issue is the npc catches up to the player and triggers the collisionoverlap event but the player hasn't moved out of it. Therefore it will never trigger again
yes begin overlap is only called when exactly that happens
i'm using the collisionenabled to toggle when the npc can or can not deal damage. So my question is how would i make it so that the npc enabling it after the first time would still cause damage without the player needed to leave and re-enter the collision area
so you can grab that collision object and call GetOverlappingActors and handle the "beginOverlap" functionality
aah yeah that makes sense
and i guess i would check it on tick or something
gotcha. thanks
so you can convert your BeginOverlap functionality to a function that accepts an actor
then call that on BeginOverlap and when you enable collision using the above node and looping through
This might be a bit of a silly question but how do I see if a condition is being met on a boolean between 2 blueprints?
i mainly do it through casting
something like this
Could you describe what you're trying to do a bit more?
@unique harness yeah that's what i had in mind, thanks a bunch
Yeah, I am trying to use a boolean within the level blueprint to see if an item is collected so that other things can happen if it is true
You probably don't want to store that in the level blueprint
You can't really access the level blueprint from any other classes
You'll probably want to store that in GameInstance/GameMode/GameState
You can still do the logic in your Level Blueprint if it's level specific but just store that variable somewhere else instead of the level BP
I am destroying the actor within its own blueprint. So how would I make it in the level blueprint to know that the condition is true?
You should aim to create event based logic rather than sticking stuff in event tick
but if you really want to do it this way, create a boolean in your game mode class and use that
I had just used that to get it working
but it seems like you could avoid this logic by just telling your deleted actor (or an actor that manages this deleted actor) to spawn the new actor
I will try that. thanks.
That worked much better thank you. I forget you can split pins at times.
If I were to want to spawn an item in front my character using a console command but always have it spawn like 3 feet ahead of me how would it look?
thanks
@mighty fable might have to add actor location vector to the forward vector
oh yea, that too lol
that's just player controller though right?
yes the distance is in centimeters
so like 100
so like 1000 will be ~3ft
er 100 yea
Did you set the actor class to spawn?
Also, are you sure the function is being called
with the variable set to 100
yeah im typing it in
lemme put a print string at the end just to check
ok, so the string prints
and what class is this code in?
sorry, what class?
the level bp
add this
Awesome it works!! Thanks guys! โค๏ธ
You can load the same level again
I'm not sure if this falls under blueprints or not. But I made a hud widget for my HP bar. Is there a way I can make a blueprint so when I pick up a specific item I gain a heart?
Not healing a heart, but making a health bar got from 4 hearts to 5
Store CurrentHealth and MaxHealth as integers in your player class, increment MaxHealth
That's how I have it now. But I have it as a stand alone progress bar. If I make a pickup that add a heart and changes max health will that add a new heart image too? or is that something else I have to do
You would have to add that logic
Is that something I'd add to my widget or my characters event graph?
widget
ok
so I would create a widget called BP_Heart
and have it be your heart image
then dynamically change the number of "BP_Heart" in your health bar
Ok, I'll fiddle around with that and see if I can get it.
Thank you for the help
something like this
HeartContainer is a HorizontalBox
but you're creating the BP_Heart dynamically, not like in the image
And this is contained in my widget health bar binding?
Is it possible to change the origin of a mesh with UE4 ?
bpi... i have 2 actors (dice and playstone, both have a BPI)
what the heck do i put into "target" to make this thing work? and why?
so i still need a reference to these playstones and call it 14 times. jesus, what is that BPI even good for?
They're good for interacting generically with objects of different classes without having to cast to the specific class of the object, and if the object doesn't implement the specific BPI, then nothing happens.
If you're looking for something where you want a lot of objects to respond to something, then you probably want an event dispatcher and have all of those objects bind to it.
Whats the difference between make rotator and split the transform rotation values
They are opposites
Or do you mean breaking out the rotation from the transform?
A transform is a location, a rotation, and a scale all combined.
is it possible to aim down sights by modifying bones and making a socket on the ironsights go to the center of your screen?
I meant whats the difference between adding make rotator on the left , and just splitting the rotating transform like on right
They're the same thing.
I'd fathom that not everyone knows about splitting structures.
Everytime i enter a tutorial the instructor would make rotator instead, so i thought i am doing something wrong , good to know they equal
Like these are basically the same... XD
Oh , for organizations makes sense
Does making structures instead of having the variables themself in bp , differ performance wise?
if it does, it's not enough to matter
My bp Calling many structures say 20
Structures are very light weight
Great
So i am able to set a range in editor for a float value
Is it possible for float value in a structure
no
and I believe that range really only applies when changing the value in an editor interface, I think you can still force the value outside the given range by setting it manually
So i better bp it boloean if > value , set value to the same limit
though it may complain when cooking
Just use a clamp
^
Tbh idk what is clamp
Restricts values to a minimum and maximum, so anything below or above the min and max will be set to the min or max.
Ok i will see its effect on structure
Oh it worked but in the editor but not visually with numbers , so i will bolean the number
what do you mean "boolean the number"?
If its set above the limit the set it as the limit
So u cant increase
I didnt test that
that's what clamp does
I guess I don't understand how doing it with a bool would change what you're experiencing
yes I understand what you're trying to do.
I don't understand why bool will work but clamp will not
You can just skip the branch and set the value to the clamped value though
How
Is there another clamp node
When i remove the bolean id be able to increase the number infinitely
Oh thats smarter , Thanks
What is switch on int , because i have options in enum and i also just bolean , false then enter the other option , or it shd be done in switch on int?
screenshot?
Ok
You can also just set a range on the variable itself:
he was specifically asking about values in structures
Oh, really? Well dang, I've been using that for ages
Dang, yeah, I just tried it out, it doesn't clamp it's value. Well that's a shame
Use a "Switch on choice" node instead
That's where you'd use a switch statement
Oh
Alright thanks alot
I know how to specify rotation movement on a component , but is there a way to remove the movement from another component , so it ignores a specfic component
Worked as i wanted Thanks
how would i delete a specific instance of a blueprint, instead of deleting all blueprints of that class in the scene
i cant figure it out
Could you try to explain the scenario which you need to do this?
ok so i have a paint select, a few different colors they can come in, by switching the decal color of the object, when they hit the ground, they leave a mark, for my green paint, when i place a new one on the ground i want the old one to disappear, as to avoid confusion since they work as portals
so when you spawn one, store it in a variable
before spawning the new one, check the variable to see if the object exists
if it does, destroy it
i tried storing it in a variable, and then destroying that object, it didnt work, idk if i did something wrong
it just didnt delete anything
Can you show how your spawning the new object?
Hey guys, how would I teleport from checkpoint to checkpoint via console command? I have nodes with the tag "Checkpoint" and want to put them in a list so if you input the command again it will move you to the next one, but I'm unsure how to do that.
I feel like creating a widget to list the checkpoints as buttons would be more simple
I would rather have it through console commands. Do I use an array?
And a sequence?
yes you can do GetAllActorsWithTag
and store your checkpoints in an array
then send an index with your console command
Is there a reason you'd rather have it in console commands?
just so its more of a debugging feature rather than allowing the player to skip around freely
Do you plan on enabling the console for shipping builds?
yea
If you want it to skip to the next checkpoint with the same command you need some way to determine what the "next" checkpoint is. Idk anything about your game so maybe you can figure out some way to do that with some metrics. Otherwise you need a list (array) of checkpoints in order, and a variable that tracks the player's last checkpoint so that the function can select the next one.
so get all actors with tag then promote the array variable off of that node?
yes
I'm not 100% sure on what it should look like
Do you have a class for your checkpoints or how does it work?
Random quick question: Can you not play montage from inside a character blueprint?
does it have to be done on the player controller
You should be able to do that
i can't seem to get the "play montage" node in the character. It just doesn't show up at all
i get montage play but that doesn't have access to the notifys
It needs to be in the event graph
yeah there is a class, as a blueprint
So you can do GetAllActorsOfClass then
and I would use some member variable in that class to denote order
so you can sort the array
so getallactorsofclass, then promote variable
yes
compile and add the list of checkpoints into the values list?
yeah that's what I got so far
so that second one is if we are going to teleport in order?
yes
I added an Index variable to the checkpoint class
so you can't sort them correctly
ok, so that's what we want! Now does that include the warp and everything?
no this is just storing them
So what is the difference between the top and bottom examples? I get they're both making lists/arrays, but wouldn't instantiating a variable for them make the variable list that size anyway?
idk im trying to understand this too
the top one doesn't ensure the checkpoints are in order
Oh, it's casting them too
so your custom event would be something like this
note, I'm not testing any of this so it may need some tweaks
but the general gist of the logic is there
so you have 2 variables "Checkpoints" and "Index"?
Index is a member variable inside the checkpoint class
Checkpoints is a variable inside the level blueprint
Is this one going to teleport us in order or just look for the checkpoint actor tag and pick one at random? Sorry, I'm trying to keep up.
the index on the method will decide which to teleport to
so do I need your other 2 sequences of nodes then?
the second method is the console command
the first can be executed on begin play or something
ok, so the console command one is the one with the get array?
yes
ok, thank you so much! Sorry, I'm still learning
hey guys me again
how do you trigger the on notify begin/end with this
they never seem to want to trigger for me
in the anim montage, you have to specify that it's a montage notify. You can't just make a new one.
ok but that works only for the begin, what about the end?
When setting the value of a vector, is there a way to define a max and min values for the vector?
Thank you!
Hello, I am having a bit of an issue. My character plays two montages at once, each with a different slot. However, when one animation plays, the other one stops. Any idea why?
Hi, I'm using UE4 version 4.26.0 and camera shake seems a bit more rough. Anyone know why?
IT also won't let me set it as an single instance
I'm using Matinee camera shake for headbob
how can i find out if a player collides with a collision volume thats inside another on? it aways returns the BP thats colliding
like i have a waypoint with a sphere thats large for discovering it. then one on the platform for using it
is there any way i can select more than 2 possible death animations?
using a select node doesn't seem to work
in anim BP that is
Can you show a screenshot example of what you're looking to do or what you have?
sure
gimme a sec
this is what i have
the issue is i can't plug that select node into anything
the random sequence player goes through all of them instead of stopping after picking one
if i do it in the characterBP it just loops the montage of the death animation forever. I litteraly have no idea where to go from here
actually i think i just got it, it's in animation montages
Can you apply material instance to tiled landscape via blueprint in-game?
looks like you want random sequence player
Picking a random death animation shouldn't be that hard to do... I think I found a rather easy solution to work with that I'm satisfied about enough.
Sadly that one didn't work, it turned out i needed to create a montage section in my montage that would loop the final frame infinitely
and then add a montage notify window to allow for notifiy begin and notify end
crude way of me setting up a way to enable and disable the mouse cursor, problem is, when i click on something with the mouse enabled, whatever that is plugged into the action command for the left mouse button, fires in the background (the inputaction mouse is bound to tab to enable/disable the cursor). set input ui only doesn't seem to work for me as i can't call the widget for some reason