#blueprint
402296 messages ยท Page 739 of 403
The event or the game? The event i tried client,multicast,not replicated, on server// and the game is running on standalone so i think listen
This.. what do you have this set to?
and creating a session and finding for
Ok, that means you can't rely on the has authority switch as server is going to be one of the players.
so what should i change it up?
Calling that on GameMode,GameState dont work it runs as server
where can i call that as client? gameinstance? playercontroller?
playerstate maybe?
Is there a way to cull actors from particular cameras? I'd like a multiplayer game where players can grab a camera that can see hidden stuff, and ideally be able to change the visibility of something on the fly, choosing which cameras, or at least which type of cameras it's visible to at any point
For whatever reason even though the boolean is set to true, it keeps going to the false branch, am I missing something here?
In the TeamOnRep function, On the HasAuthority branch, on the authority do a IsDedicatedServer branch, and if false, then connect up to your existing logic.
Hey all. I'm trying to figure out how to implement an 'aimed jump' with the mouse cursor.
Essentially, a player would hold the jump button down, aim at a location and then release, and the player character would jump to that location.
I'm not finding any examples online or an effective way to do this.
Any thoughts?
I wouldn't know how to do it, but they did something similar in AvP 2010 for the predator,
that was exactly our reference
Umm..... You have get all actors on tick??????
All I know is it's virtually impossible to follow.
hi, I'm brand new to Unreal. I'm diving in and try to edit a material blueprint. Is there a node that will return the position of each vertex? Similar to how VertexColor returns the color for each vertex. There should be a value for each vertex (instead of one position for the entire mesh).
I figured it out, I misunderstood something about how the variable was initialized
and yeah messy, but it works so far
I can polish later
I imagine this is a really simple issue, but I'm having a brain fart:
How do I store a value that is potentially changing every tick?
I am taking the first index in an array and trying to store it in a var called firstIndex. In the event that the array becomes empty, I want to keep the value in firstIndex and continue using it; however, the way it is currently set up it changes the stored value
set index 0 = aDefaultValue
sorry aDefaultValue = index 0
if index 0 == null set index 0 = aDefaultValue
I will try that, I just encountered something strange
So it sets the firstIndex localVar AFTER it checks if the array has more >= 0, but once the array is cleared it does not retain the localVar firstIndex's value
It doesn't make any sense to me, it shouldn't be getting to that piece of code because of the branch
0 is the first entry in an array
if its > 0
I'm not trying to modify the array after it's empty, but just store the value that used to be in the index 0 spot so I can use it with the rest of the code
I can't see a problem
it seems like you check if the array has elements and sets *firstindex * to be the value of index 0
so as long as fist index value is not changed you should be able to "Set Array Elem" index 0 = firstIndex
at a later point
why can't I see this node? https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/MeshDescription/GetVertexPosition/ does it not exist if it's a material?
Get Vertex Position
do you have context sensitive on? @trim pollen
I have a door that has collisions on either side (for overlap events to set booleans for the door) and it works when in a normal area, but when in its actual place, it opens into an alleyway that has a TriggerVolume for audio, the door stops responding to linetraces. Any idea why there is this conflict between the door and the trigger volume?
i'm googling but not seeing where I set this. I have everything default.
where is context sensitive set?
shouldn't it be in this menu?
your in the material editor
that vertex node is for procedural meshes
in blueprint
blueprint has separate nodes from material editor which is shader nodes
thank you
I solved it. The solution for me was to set custom collision preset and set it to pawn object type
Now my linetrace is working on the door
Hello. I've got a problem. I want to check if the text is an empty string and disable the button if it is. Unfortunatly this isn't working and I can't see why. Could anybody help me?
What event is checking this
There's an event "on text changed" or something which you can use for this
.... again
Thanks man!
@gentle urchin How do you know you should use Text as an Input on the event?
*output
I didnt really use anything, it appears by itself when i setup the event
It makes sense tho. It's infinetly more usefull to append the current text along with the text changed and text commited node.
It doesn't appear in my editor. But it worked when I pulled the event node pin.
Sounds like you've got the wrong one
Is this an editable text box ?
Or text Box
when its selected in the designer (or as a variable) you can find the dispatchers in the details panel
It is avaliable there aswell
Hmm but the Is empty node isn't working
I also check on DoesSaveGameExist
that one does disable the button but the empty text isn't
is it possible to play a level sequence inside an actor blueprint?
Sorry I was afk for 15 minutes. Had somebody at the door.
Will check about the inversion in 15 minutes.
Ok I made an other stupid mistake
It's working now
Thanks Squize
level sequence is bound to level
I was trying to put a level sequence animation door inside an actor, so I thought in that way I could duplicate many times this system. Anyway, thanks for the answer!
You could consider using things like timelines for just doors, avoids having a lot of sequences in your level
I tried doing this but it doesn't seem to work. Could somebody please do a "how to for dummies" on how to access the values from a runtime float curve please?
So, has anyone doing the Blueprint Ninja Challenge gotten the Ninja badge? Or is only the Journeyman one available?
Oh, I took the wrong fundamentals course. ๐คฃ
I am having trouble with getting npc characters to move in a packaged game, for whatever reason it works fine in the editor but in game they do not move not all, and I can't figure out why, it's just a simple character pawn that moves to a specified point on the map, and the navmesh is in place around the proper area
I made sure to fully build the level, it has no errors or warnings either
this is the character's event graph
@gentle urchin my map was corrupted, I remade the entire level and it works now
Damn, that's unfortunate. Hope that doesn't happen very often ๐
@lunar fogThe link you mentioned has a how to, to access a curve's values.
I don't know why, but for the life of me, I can't figure out how to get access to a "runtime float curve"
it's a special struct with no "get" function
Cant use it in bp
Can you change area class in blueprint at runtime?
oh the nav modifier component sets it for everything in the blueprint though :/ @gentle urchin ๐ why unreal why
Hmm... how about the volume tho?
cannot be added to a blueprint that
Soo child actor with the nav modifier component ?
And a collision volume
Or a new component with this ๐
What do you mean by that?
child actor recommendations ๐
You like , or you dont ? ๐
What is it you want to do?
like, your intent
I'm trying to create a blueprint that sets randomized nav mesh obstacles of different classes dynamically @odd ember
right now I can have only one class though
and you're not using dynamic navmesh?
because that should handle your issues. you can spawn different actors with different classes and the navmesh will accommodate
Yes I just didn't want to do it by hand for every corner, I think I'll go with the child thing @gentle urchin pointed me to
... you don't need to do anything by hand?
the navmesh will handle everything automatically and you can assign random values for a spawned actor
no nav modifiers etc. necessary
How would someone mark this BP function as thread-safe ?
You can't do threading in BP's so I'm not sure why you'd need to do that
Not even sure if it's possible for them to be thread safe
i think that only works in animation blueprints
Any way to go to concrete usage from reference viewer? Currently, it's a lot of tedious work of opening the asset and searching manually
It's just that i'm getting this warning here when i use it in my AnimBP.
I would make this method anyways in C++ where i can specify the flag, but i was wondering if you can do that in BP
Can you do what it says?
Disable threaded update in โHas only one one handed weapon equippedโ
Not quite sure where this setting would be
do you even use multi threaded animation updates for that AnimBP?
Not sure what that function does, but does it use some kind of different update or co-routine inside it?
otherwise you can turn off the warnings (or just ignore them)
It's basically just a collection of some getters with boolean logic
Isn't that the default ?
no idea, it's in the class settings or class defaults
Yeah, it's on by default
however, any BP access is usually suboptimal
Strange I donโt believe Iโve seen that warming before
But I rarely do complex work in animator
This is basically the whole method
All of those called methods are also marked as BlueprintThreadSafe in C++
Yeah seems simple, just ignore warning โ ๏ธ ๐คทโโ๏ธ
no, the warning is there for a reason
I'm getting rid of this warning once i'm writing the method in C++ anyways, but guess it's good to know that BP methods are kinda limited here
Any ideas on how to change the player character while in game, like press a button and your character would despawn and create a whole new character. Ive seen a lot of stuff about just changing the skeletal mesh but that doesnt quite work for what I wanted, I wanted to change the player character entirely.
as long as the character is using the same skeleton changing the skeletal mesh is the best method honestly.
I know but I wanted to have different types of characters, like some bipedal some not so its drastically different skeletons on the characters
Set up character class bpโs
Destroy the old one and spawn instance of new one
This is oversimplified version of what will happen
can you give a example of what your trying to do? i.e. like is this for something like player is human, grabs stone, gets transformed into slug man... lol... or is it just a character selection screen where your selecting which character your wanting?
Yeah ive set up a character select screen (except for spawning the character so far) where the player can pick but some are human, some are animals on four legs, so I cant just change the mesh. Ive created the different character BPs but I dont know how to actually spawn in the new character, I was going to setup spawn points for when you do spawn in but switching the character BPs while in game has been a challenge
for the character selection you'd just be spawning and destroying actors till the player selects the one they want to use, and then you'd set that to the players active character.
simplest method.... player selects character .... stores data on player... loads map ... reads what character the player selected ... spawns that character ... possesses character.
Can you subtract rotators in Blueprints?
FRotator A;
FRotator B;
FRotator C = A-B;
if there's no node for it, you probably can achieve the same result by using break rotator and subtracting the individual components and then making a new rotator from those
(or just make your own node for it)
@fair sun Delta is what you're looking for I believe.
It normalizes it, but that's not usually an issue with rotators.
this all happens because the animgraph runs on a separate thread from the game thread. so when you're calling stuff from the game thread (e.g. any actor reference) in the animgraph you get issues like these
I think you can get around it by using the animBP part to set variables instead
I found a tutorial to make a camera lag, but i want the character to always be vertically centered, and i want the camera to only have an horizontal padding how can it be done?
is this third person?
if you have a spring arm component, all those options are exposed on it
no need for additional logic
Hi, I'm new to unreal engine and I'm trying to make small games with blueprints in multiplayer, I would like to be able to make a client have control over an actor's mesh transform and have the position sent to the server.
Is there any way to replicate transform from Client to Server with blueprints?
Thanks
But how to make the lag only horizontal and not vertical?
best ask in #multiplayer
Thank you
i have this interact key in player_bp, when i interact with drawer it opens and close, but i want to put something in drawer and want player to pick up, how can i make player recognize that something is in that drawer and that can be picked up instead of closing drawer
Interact function in player bp
open/close in drawer bp
@limber tinselthere are various ways to handle this, but typically you will use contextual commands. So if the player is near the drawer and the drawer is closed, you show the contextual command to be E = open drawer.
If the player presses E and the drawer opens, showing some content the player can pick up, your contextual commands become E = close drawer, P = pick up object.
yea thats nice idea! but is it possible to pick up something with e as well
Exactly. You can even use mouse hotspots, one on the drawer handle to open/close it and one on the object that can be picked up.
Can't figure this one out:
I need to sort actors in an array accoriding to their HP value (sometimes more than one may have the same value, so map won't work). Made a quick float sort function and I can't figure out how to get them. Any help pls?
ty i just looked up mouse hotspots might work, will try that
@limber tinselyou don't need to reinvent anything, just pick an interaction system you like from one of your favorite games and implement something similar to it. Unless you are inventing a whole new interaction paradigm of course.
Well m too dumb to invent anything, Just learnt unreal Bp Week ago so just looking for a simple way.
@high ocean assuming the array out of your sort function is already sorted, I would use a traditional index based For Loop, from 0 to LAST INDEX.
@limber tinselif you are learning the best solution is the easiest one, you can always make it more complicated later on.
you can use string array
and make it mimic map
with string formattings
11x15.0
12x14.2
etc.
then split with x
@orchid staromfg... lemme think... wtf ๐ฎ
and you got the values
its harder to do but once you get used to it its fun using it this way
woah i need to wrap my head around this one as this has the potential to change some of the stuff I find bug-prone
or you can use maps
but not with floats
but strings
enumxstring
and if there is a duplicate
you can make it with string as well
there will be duplicates, since the hp values of the actors will be the same at the beginning. Otherwise I would've used map and be done with it 2hrs ago ๐
Trying to understand this string method as it seems really usefull for a bunch of many other things...
I used to do this string, because I had to use Playfab
and I didnt want to deal with JSON that much so I made the arrays like that
it worked just fin
I dont think its the best way tho
it might make it hard to read for someother people
well, in most cases, u can't read anything from structs unless you print out and check, so that would only make my life easier, all my vars are nested and nested again
so... need to try and understand how this could work...
why cant you read from struct ?
when frame-breaking, structs return "variable out of scope" ๐
when frame-breaking, structs return "variable out of scope" ๐
so when I can't figure out from anywhere else, I just plugin a print just to see the fkin value - annoying
you can see the struct variables info
orly? Need to check that out while debugging
although if I forget one like that which isn't supposed to be - ouch ๐
if you right click on the pin and say "watch this value" you should be able to see it, regardless of scope
nnnope ๐
I wish it was
it isn't really, tried it many times, only works for un-nested vars
you should at least be able to view it in the blueprint debugger pane
so this method you were saying about would mean that I assign strings for each actor, then append the numbers to them? Something like that? Then sort the array... Uhm... ๐คฆโโ๏ธ
How about using min of float array?
stash their values in a float array -> pull them back out with sorted indexes
this
dude
it feels like Im an idiot
didnt know it existed
@gentle urchinThat's how I sorted the float array. But now, there's no way for me to get the indices of the actors corresponding to those values ๐คฆโโ๏ธ
Yes there is ๐
Save the index, which corresponds to the original array
So.. Original array -> store in float array 1:1
Float Array -> Save indexes in a temp integer array -> Remove said index from float array
Now your array of ints corresponds to the sorting of the original array
which you can then use in a for each loop to generate the outgoing array
Disclaimer: Untested.
@gentle urchin๐ค I'll give it a try, tell u if it worked. I'm not sure how sett array elem index 3 for instance will behave when added first - will it just fill up 0, 1 & 2 with "none"?
that's why I haven't even considered set array elem, I assumed it will just add it to index 0 despite me providing one
We know there exists data for every index
so long as we allow the array to resize for our biggest index, it's aall good
Size to Fit handles that
๐คทโโ๏ธ I'll try it out and come back. Been 3 hrs since I'm bashing my head against this ... this silly, crappy, simple thing really ๐
what was the original query
I think removing the index of the float array is what is messing it up as you would be changing the length of the array constantly. What you probably need to do is set the value of that particular index to a known high value, and check if the min value is == that number, and that's when you break out of the loop.
Yeah i think you're right
Not sure why i reinvent the wheel
i made a sorting function a while ago for another project.....
wouldn't it be smarter to just use any conventional sorting algorithm
^
@gentle urchinYea, nope, the while loop goes endlessly (I never use those cos apparently idk how to) and endlessly adds the same index: 0
I just realized how dumb I was in this proposal, along with Datura's pointer.
So it's broken in more than one way
thats the issue
afaik, the condition to break a while loop must exist inside it - right?
the index relation breaks as soon as i remove from that index
how can something this "simple" be so fkin complicated - wtf?! grrrr
I'm almost certain that in cpp it's like 3 lines of code.
Sorting is one of the big downsides with BPs sadly
you can sort pretty easily in C++ :P
you could try your hand at exposing the sort function that exists by default in cpp
depending on what your array contains it's just a matter of saying Foo.Sort(), otherwise you may need to define the < operator for the contents
but it's pretty straightforward either way
can generics be exposed to BP? I've never tried
https://answers.unrealengine.com/questions/961163/how-to-sort-tarray-in-c.html there's some discussion about it, so guess you'll find a working solution ๐
Never wrote a single line of code by myself, so i'll probably fuck up more than I can afford timewise
@odd ember nope :(
you could wrap it with an blueprint function ๐
I know that, but the project contains no code, it's bp only
that's what I thought... so perhaps the best way in BP is doing a... macro? idk
it's possible via some kinda magic of CustomThunk
but never tried those and it looks complicated lol
Yeah
But no local vars ๐
on a side note not having generics in BP is one of my biggest pet peeves
you can have local vars
Easiest way by far is to just don't bother to attempt to make it a generic function :P
You can have local ints and bools and some basic stuff like that in macros
look at the standard macros, plenty of local vars to go around
Oh?! Then why haven't I made more macros instead of functions... God damn it ๐
but not anything more complicated than those
because they're a bit sketchy
U right ๐
wildcard local var?
Does it actually allow those? ๐ค
i think so
Yeah I seem to recall that if you try to create a local it's just two or three choices for the type
look at for each reversed macro
because you can't create a variable for the macro, the local variable is a node in macros
well, might just be a wildcard parameter
and get fed whatever data type? wouldn't that break? like badly?
no, TArray<whatever>
I tried to make a PQueue macro once and it blew up in my face lol
@gentle urchinwhat works?
it
but...how?
it indeed
oh..
Datura pointed me at it really
removing from the float array made the indexes unsynchronized so to say
so by removing from temp array at the same time, while also adding at the sorted array along the way, made them stay synchronized
I'll try it asap... ๐
@gentle urchinIT Does!!! Jesus, GJ! Thanks alot for the help man, amazing! ๐ฅณ
And now, after you figured it out, I just realized how much sense this makes ๐คฆโโ๏ธ God I hate my own brain...
Heya, wondering if I could get some clarification. I'm watching a tutorial video and in it he pulls out these vec*scalar blueprint functions shown here
But here I am on UE5 and I can only seem to find multiply
Its the same
new nodes are dynamic
input float as secondary and it 'becomes' vec * float
ah, so I have to make a new float node every time I want to multiply by a scalar?
Not sure if you can right click the pin directly
havnt used ue5 that much
just know they're dynamic
ah, you can totally right click the pin and change it's type
Sweet.
Thanks a bunch โค๏ธ
yea the new nodes are a bit of a PITA like that
I understand the reason for them assembling it into one node from a tech perspective, but from a user perspective they should still have listed the options in the menu
yeah, it seems more convenient the old way lol
On another side, isn't it sort of more userfriendly from a search perspective that there's fewer nodes to pick from ?
When searching for a "multiply" node, all sorts of them used to show up
Now its just drop in the one and only, and connect the pins you want to it
Shortcuts
you cannot shortcut it because you still have to modify the node
in many cases you don't have a connection to start from
e.g. when writing in a number
so you have to either make a literal float (which is another menu lookup's worth of clicks) or manually switch the node to accept your type of number
Tru
so it is inefficient compared to the old way
Presonally i still prefer it this way, but surely it can produce more clicks, which is not something to strive for
Hmm
I personally prefer a robust click economy where click inflation doesn't happen often, and when it does, it is reduced quickly
it's even worse than i thought (havnt used it to any extent)
I expected it to remain wildcarded
My assumption was wrong
btw what're the benefits to making something inherit from pawn rather than character? i'm trying to decide if i want my AI enemies to be pawns or characters and i'm not sure if i need the features that come with a character
are there performance benefits from not inheriting from character? or is it mostly just a neatness thing?
Pawns dont have the CMC , so surely they're easier in many ways
If you need to defy gravity to any extent pawn would be probably be better choise. If you want regular walking and alot of basic stuff pre-handled, character is way to go. Set up for MP aswell is just a benefit as i see it
MP?
Is there any way of marking certain function inputs to have the compiler bark when nothing is connected? I searched for 30 mins for an unconnected pin ๐ญ
multiplayer
it has built in replication , movement prediction stuff and whatnot
ah
I'm not familiar with how far it extends, but its like 15k lines of c++ code, so it's a decent chunk of work done there for sure
Not that lines of code is a metric for awesome, but..
hm not sure to what extent pawn and character differ on a dedicated server
but that's a good place to test and figure out what i want to do
thanks
@ripe roseJust make sure you don't need the movement component in all its glory or proper access to animation blueprints or you're gonna have some pretty nasty surprises. Took me back a couple of days last year - wanted to be "performant" as well... Learned my lesson. You'd wonder at what's not exposed to blueprints cough looks at movement component & proper animbp support.
ic thanks for the advice
you used pitch, not yaw
nothing fixed, head keeps shaking
I use the lookat and that works for me personally
want him to look directly at me
guys
but you may have more luck with asking in #animation
can anyone help me with a bug
doesnt fix it
head doesnt rotate at all
wait
when i use the headbone it rotates in the z axis
when i use the vb it doesnt rotate
and it doesnt look at the rotation at all
what is vb
no idea what that is
arguably if you use something virtual it's not going to work because it's not the right bone
For whatever reason my npcs aren't able to navigate once in game, but are perfectly capable in the editor, I tried editing project settings regarding navigation mesh as well, I'm stumped on why it would work in editor but not in game
@kindred pierI can't remember what it was (but something silly/buggy on the engine-side). Had a similar problem. Just delete the damned thing and don't rebuild your level. It think that was it - can't say for sure, I can't remember for the life of me.
You just delete the navmesh, undo so it gets back & builds & don't do full rebuild when cooking - if it's an option
I have a C++ player controller and a blueprint child of it. If I add a UE_LOG to my C++ version's BeginPlay, I see the output. However my BP child doesn't seem to fire the BeginPlay at all. Other functions in the BP fire off just fine (ex: tick). I can't seem to come up with a reason why this might be, anyone have any ideas?
You need a call to the parent begin play.
^
Wait, that's backwards isn't it? The parent of the BP is the C++
And the C++ is working just fine. It's the BP's beginplay that isn't firing
the BP's BeginPlay is fired in the AActor's BeginPlay so you probably do not call the Super::BeginPlay
Right, you need to call the C++ BeginPlay because you're overriding it.
... Unless my understanding is completely warped, I should be able to use the BeginPlay in the child BP without calling the parent BeginPlay. It would completely override the parent function by not calling the super
(not to mention adding the call to the parent does nothing)
Ah, yeah there it is.
Super::BeginPlay() < - this is where the bp's BeginPlay is fired, bp class is not a real c++ class and unreal refection calls the begin play on bp manually so not all of the heritance rules apply to bps
if it is not working, move to #cpp and show the code
Worked perfectly, thanks!
Interesting tidbit of knowledge. Thanks.
also always call the Super::BeginPlay() because you will have some weird issues like not being able to delete the actor
Yeah, just missed calling it when I added the function
Why are you rotating the head like this?
how do i do it?
Aim offset, and I believe AI's have some node that allows them to focus an actor
problem is i dont have aimoffset
make one in the enditor
tell me about the focus on the actor node
won't do you any good if you got no aim offset I'm pretty sure
But you can literally make one. Just get the idle animation
:) no idle animation
so it's just constantly moving in every single animation?
?
the actor head must supposedly move in every single tick but the big problem is it doesnt
yes
when i import an animation the mesh becomes really small
so then are you planning to "animate" the whole actor by changing it's bones?
no no no
i am planning to make simple animations
but the head aimoffset i am planning to make it procedural
like every other animation i've done recently
but it for some reason doesnt work
never seen anyone do it that way before, ever. but I guess anything's possible. You just need to make sure you are calculating properly
What is your current logic for determining where the head should be?
"Head Look At" vector
earlier you said smth about vb, you need to rotate the actual bone not the vb
I mean I gave him that solution
ok
this is technically #animation talk anyways
nobody responded to me there
sometimes you gotta... repeat
you can't expect people to be a hotline for you 24/7
logic for getting the look at target rotation
i didnt
i just asked and waited
It's not really animation talk if he has to calculate the movement of where the head goes, he's already got the animation logic set up
but you're back here
and someone responded to me here so i discussed it with him
thank you
it is now a matter of helping him figure out the appropriate calculations to rotate the bone
thank you again
as far as I am concerned that's a simple value you set, not so much calculate. even if it was more IK like I'd still put that in #animation
its hard to assume what does he want if everything he says is "it doesn't work"
bro what is it with you and #animation
e.g. what are you looking at -> set location for use in animgraph
categorization
from what i know it got a bit of blueprints and animations so i dont understand
animgraph isn't blueprints
that's the difference
much in the same way material graph isn't blueprints either
and really I've tried to help you both here and by redirecting you to people who might be able to help you more in a channel that's more suited towards what you are doing
๐ค
so I don't know why you are complaining
okay, can we start over? because I got completely lost, @clever helm whats the problem?
I need a proper explanation if you want me to help you
ok
describe the problem
do we continue here?
alright so the head must rotate towards the player, which it does not
it doesnt rotate sideways but i did discover that when jumping up and down the head rotates with me
so its working but not really that much
what have you tried already?
and when moving sideways the head get shakey
the solution they provided for me and other stuff i found on google
i mean, what do you have atm
this is my current setup atm
and somone has sent me a video in #animation so i am going to check it first
and now show the output
you said you have registered some movement, could you record a video?
what the...?
had some addition and substracts here and just deleted them all and attached it to this
if needed i will add them
just for speed tbh
That setup is so funny wtf
@clever helm
anyone else have any thoughts on this, I've been searching for a while and still stumped
some up and down movements
i might help you
I dont know some up and down movements are so please record a video
ok wait
Perhaps try rebuilding everything in the level?
I've done this a few times and I've even made fresh nav mesh too to no avail
@kindred piermake a debug build, then you have access to the console, Through the console you can check the navmesh. Maybe you can spot the issue in this way.
i somehow fixed it
atleast the head is moving
thanks I will check that out ๐
it looks like you want to negate the rotation
yeah i tried that but for some reason the xyz in the vector isnt translated to world space if i can get it correctly
did you check that the anim node reflects the correct space?
Hi all, need some help please.
Hi Guys need some help in Blueprint how would i get the speed of a actor in the world the is moving along a spline
I have a track BP and then another for the Train. I need to get the velocity of the train to be able to rotate the train wheels at the right rate ??
isn't there a node called GetTimeAlongSpline
forget it
i fixed it
it happened because i was dumb enough to not uncheck local space in the look up and at axis
Maybe this is what you're looking for.
welp
I've tried that this is my set up
v = d / t
so track is one BP and the train moves along the spline using this code
is it because I'm setting location of the Bp on the spline over a timeline so the Train BP according to the engine isn't really moving ??
any ideas ??
Well, Set Actor Location is practically placing actor to another place.
that's what i'm thinking i'm setting the location rather then the actor actually moving if that makes sense
so rightly so the actor would be seen as not moving at all
Get Velocity actually only works with physical movements or Movement Component
damn any ideas how I could do it different
do trains actually turn their wheels when the run on a track?
all I need really from this is a way to have the wheels rotate at the right rate for the amount the train is moving. Could i add a Movement Component but not use the movement from it maybe and see if velocity would then be given ?
what you mean ?
if they didn't they wouldn't be able to move
the more you know I guess. I always assumed that train wheels didn't rotate, which explains the excess of track necessary to make a train turn
v = d / t
I don't understand that obvs V is velocity i'm guessing
velocity = distance / time
Velocity = Distance / Time
Distance = Location B - Location A
you can get the velocity by doing current location minus last frame location over frame time
I am getting an infinite loop pointing to the branch in the middle, yet I don't see anything that would make it loop infinitely
whats best way to get that obvs get actor location for current
would i literally set old loc - current and reset the old loc ??
size of vector from where
from subtraction
oh, its called length in bp
thats the same thing
now divide it over time and you have the velociyt
delta seconds okay
Wont he be sending in 0 0 0 into Vector Length?
also is Float being divided or the vector before the length ??
yeah he will
Pretty sure you should set old vector the last thing you do in tick and then use it before you set it
@trim matrix you set the var before subtruction
As I said, set it last
need to get it from somewhere
And use it before updating it
That way you have the last frame's loc
first frame wont be incorrect but that velocity will be one frame behind anyway
i don#t think that would work
Should, unless you use it more after the set
every vector has a default value
Or just don't use it for the first single tick if that's possible
delay by 0
emmm no
you can ignore the first frame not being correct for your case of wheel rotation
so what i had before was fine
so that
I have no idea about the math itself because vector math is not my strong side but yeah
neither is mine haha
its okay, trust me
I always brute force vector math and then never touch the algorithm again
Learn OpenGL . com provides good and clear modern 3.3+ OpenGL tutorials with clear examples. A great resource to learn modern OpenGL aimed at beginners.
i always look at that
it has a very good explanation
i'll keep that somwhere might come into use
disregard any opengl stuff
I mean I have stuff like checking if a runtime spawned collision box is fully inside another and stuff like that but I can't describe why it works. It just does
I understood it for a couple of hours while writing it but after that I forgot
so we have an issue
let's just say the speed of the train and the rate of the wheels spinning are veryyyyyyy different
like I think the divide is wrong or something haha
I had the same issue and always looked at the link I sent, after about a year I just remembered it
well, I do not know how you apply the rotation, I just gave you the way to get the velocity
so the
thats how to apply it but the math to get the velocity seem to be in proportion to the speed the train moves veryyyy different
lets say train was leisurely stroll, wheels were usane bolt
you need to consider the velocity in terms of how big the wheels are no
.36m
Could be
is wheel siz
@odd ember is right
size
well that is completely not correct
so you ever driven a car?
the value of the TrainVelocity variable is what you would get on the speedometer
or whatever its called
#blueprint slowly turning into a mechanical engineering course
with a diff that your velocity is in cm/s while in car it is usually in km/h in europe where im from
anyway, the value could be one frame 100 next 105 next 102 next 110
it is not the incremental change
depending on the speed of the train
Well it's nice because some of this stuff is things that I've forgotten from school
and each frame you add that velocity directly in degrees to the rotation
Rotation would be something like 36*Pi / Velocity then right?
so lets say your train is moving 200 km/h that is about 5555 cm/s so every frame you add 5555 degrees to the rotation of the wheel
Or did the diameter of the wheel not matter anymore?
you dont have to involve the PI into it, I would just find the correct multiplier for it
I thought you took circumference of the wheel / velocity since you said size of the wheel matters
Jeeze
it wasnt me who said that
what did you think it would be simple
You kinda agreed
Lads
Can we just jerry rig the Vehicle BP into train?
I was thinking same
Same, which is why I got interested
After all, trains are wheeled vehicles but the wheels stuck into a rail.
if you want to caculate exactly how much the wheel should turn you would need the size of the wheel but that you also involve some more advaned math and I would need to think some more to calculate this
basically convert the radius of wheel into radians, convert speed into radians, divide? something like that ?
Wouldn't it be simpler to calculate velocity from the rotation since that's how it actually moves?
because as the train came to a stop the wheel speed came down to a stop
And by the time this is all figured out and decided, it'll probably look ridiculous, so it'll get scrapped in favor of something more visually friendly and less accurate.
The built in PhysX vehicle physics did most of the vehicular equations.
I would've gone the lazy way and let the physics engine to the hard work.
or maybe not really, if you have the radius of the wheel it would just be:
Velocity / (2 * PI * Radius) * 360
assuming the units are correct
ie cm/s everywhere
from start of spline to end so it's setting location each frame rather then actually moving to follow spline, hence all this advanced math stuff seems to be only way so far
blender is m
UE4 is cm
sorry, did I miss smth? I stopped reading your messages for some time XD
wheels are 0.34 m in blender
diameter or radius?
radius
Velocity / (2 * PI * (Radius * 100)) * 360
I'm sure you can make the ride path to be fixed within the rail spline, even with physics engine in charge, right?
i did the entire equation for you and you ignored me ๐ฆ
oh sorry i thought you were still working it out
Cut the manual equation labour as much as possible and let the automation do the hard work.
At least that's my way of doing things (because I got bad grade at math in school)
its done here for you
Yes, because of Vehicle Movement Component.
you have to multiply the radius by 100 because you have radius in meters and velocity in cm
right so gonna sound stupid to ask but that equation
I take the vector length / 2 to begin with
you can just use the math equation node
and copy pase
copy paste
PI is constant
math equation node what is this
Math expression is what I think it's called
yep
Learnt that they existed a couple days back
then copy and paste what you sent
yes
Will probably use them to clean up some of my ugly BP maths
for pi what would that be
PI
literally vector length * pi ?
i think
well lets see if it works
forgot the name for them ๐
should i remove some ??
okay
Also now you have to set old location after the add local rotation I think
If you are plugging the return value directly into the X (roll)
it doesnt matter
You should alos save it as a variable to not do the calculation twice imo
this is what we have have i missed anything apart from maths frying my last brain cell haha
Try it, should be good
Don't leave us in the dark, does it work?
try graphic programming someday, it will get worse
i am so pleased can't describe
You mind downloading screen to gif and get us a preview? Would actually love to see some trains
๐
only thing to do now is reverse one set of wheels are the rotating backwards but i've sure theres node to invert
Yeah just * -1
X * -1
that it
I need to walk the dog and wake up in 4 hours so please show the train ๐
Glad I can wake up a lot later than that
I still have a good chance of getting 6-7 hours of sleep
highschool sucks...
whats X being * by ??
-1
Haha, I work in a clothing store and do dev on free time
Are you still in high school?
yeah, last year
right i'm cplieing and i#ll show
Impressive
If it's that zoomed in I really want to see
I thought it would be something like railway empire
I just want to sleep now ๐ฅฑ ๐ฉ
walla
pls hurry up
Haha
Looks neat, was hoping for full fledged train but ๐คท๐ปโโ๏ธ
We made this peepoHappy
hahaha no the game has them, with a modding team thats brought out unoffical editor mods can not be made for the game unoffically
this is why it;s was awkward as it literally has the location set as it progresses etc dosen't move like pawn or vicheal haha but i'm thankfull to you all and happy it's working haha
i can sleep now
I dont care about the rest, I saw the train, Im happy now
im going to sleep
see ya guys
Sleep tight guys
cue Thomas the Tank Engine theme
I am wanting to do a check to have an actor on its colllision component overlapping an actor it checks if that actor as an oppositi boolean, IE if actor has right collision for placement of wall section it knows it can be placed if its right side collision overlaps with a walls left side collision. any suggestions?
I am trying to write the world's simplest material. which colors by vertex position.
That was a bit tricky to understand because of the wording, no offense.
Are you talking about on overlap to check which side the actor overlapped specifically ?
If so, and if you are doing the collision checks on the object in the image above -> just use overlap node on each one and do things accordingly.
If you are doing collision in the other actor, just assign 'tags' to the ones in the image above
@trim pollen I belive you will have to use blueprint to assign vertex colors on the mesh components of an actor
then just plug the vertex color into the color output in the material editor
Heya, is it possible to get the parent of a component?
?
Seems like exactly what I'm looking for, cheers ๐
yeah pardon spelling earlier, Yes I am trying to figure out how to have it do an on overlap with actor of class to check that class and if its struct has a boolean set to true to then set placeable as true.
Implementation In-app purchases for assets unreal engine tutorial video or github code.
Any SUGGESTIONS WILL GREAT HELP.
Thanks in advance.
๐ซ unable figure out myself.
Yes๐
target is just simply who you're setting it on, you can drag off the holder pin and search for set interacting then the target pin will show up, assuming you have the 'interacting' boolean in your holder class
I'm a bit confused with timers? Not really sure if it's the source of my problem tbh, I have a function that I'm kicking off on a timer
https://blueprintue.com/blueprint/ukhc6kfm/
But it never runs the end segment for some reason
Thank you!!
can you elaborate a bit more, i mean from what you're saying it sounds like the condition is never true? if so, use prints (or breakpoint) to see what A and B return at the time you're expecting it to be true
yeah, it stops one step away from the interpolation target every time
for ex. target is set to 900 and it stops at 903 and ends without ever triggering the true branch print
I don't know how this is possible
the timer definitely ends
thats strange, so you're saying the timer ends but the print string doesn't print even though the timer clears after the print? and there's no other place where the timer is being cleared? also... isn't this an infinite loop..?
like, are you crashing due to infinite loop because in your link you are calling the function at the end of the function if your max walk speed is nearly equal to unboosted walk speed.. after setting your walk speed to the unboosted walk speed
maybe in ue5?
ahh it was a crash thing, I was crashing the timer by spawning too many apparantly
.<
all good then? 
Yeah I think so >.<
Don't call timer 800 billion times or they stop working, TIL
Thanks, lol
Hi, everybody for this function, for each loop only fires for W and not for the rest. Does anybody know why?
Hi, everybody for this function, for each loop only fires for W and not for the rest. Does anybody know why?
@slender stream Check on LoopBody, not Completed. Completed runs after the loop is over, which means that ArrayElement and ArrayIndex will be the values of the last index in the array.
If i go from LoopBody it doesn't even check for W
ReturnNode ends the loop. You have to be literal. Might need a branch before the ReturnNode.
If ArrayElement IsCurrentlyPressed == true return true, else do nothing. If the loop completes it'll return false.
Didn't work either just so you know it works when I dont use a function
Because you're ending the loop before you intend to.
Loop body -> branch (criteria is pressed) -> TRUE -> return true
Loop completed -> return false
When I switch the weapon I also destroy the previous one and my question is, whats better, save reusable info about a destroyed weapon (current ammo, max ammo, damage etc) on player controller in variables or make a seperate struct for every weapon? Or maybe something completely different?
I would think just de-attatching it and hiding it would solve it for you instead, avoiding unessesary saving of variables in controller , but could be flawed thinking from my side
there's definetly scenarios where it would be not so great
They would be still eating up some performance in such way, especially if I would end up with xx weapons
But I see it's usually between these 2 methods, either hide or destroy and save variables elsewhere
Depends on the amount of things going on in your weapon during not active, how many weapons you realisticly will have etc
Usually the number isn't in the hundreds
You can always optimize it later on if performance becomes an issue for you anyways
using profiler to find culprits etc etc etc
Sure, I think it may be the time to give hiding a chance instead of always destroying the weapon and see if performance will be an issue, thanks
hide, deactivate (stop tick, remove collision, detach) should get you a long way atleast
If you create/destroy there can be mem buildup aswell before GC comes in i think
Hiding is imo the way to go because it allows the code to be simpler :) The effect on perf from it is most likely entirely negligible and unnoticeable
What's wrong with my Ammo Text? It moves when its below 10
your alignment along with auto size
When it changes size, the alignment's displacement halfs due to the texts half size
Alignment is relative to containersize
Ah yes the auto size fixed it by disabling it. Now do you know why the ammo text isn't on to the edge of the screen even thought i set the text position on the edge? It's way far from the edge
Your setup in the canvas is... questionable at best
You're anchoring it to center , then displacing it with alignment
I'd suggest (without being an expert in setups if it needs to be scalable and whatnot) anchoring it to the edge or corner you want it to be in, and offset it in the direction you want it
That seems to work for me thanks. Should i offset the position with the positionX/Y or with the alignment? Both seem to behave the same.
I prefer position X/Y
makes it not depend on the size of the container
you can easily test this by adding another element to the text
wrap it in a horizontal box, add an icon (for the bullet image or whater)
If you've used alignment, you'll need to readjust it
if you used X/Y, it should still be correct
Okay, thanks
I do usually set the alignment to 1/-1 depending on start position tho^^
Drasticly changing the size of the container, yet it remains in the same spot (anchored down, right)
VaRest is the only plugin I've heard mentioned for that purpose
Not sure if it's paid or free though. There's a HTTP thing on C++ side of things, but none of it is exposed to BP's afaik
Hi,
I would like to know how I can handle a Sphere Collision to only be active if my Player Character is dead. I know when my Player Character is dead. I dont know how I can effectily disable the Sphere Collision until he is dead. Is disable collision sufficient in this case? I have read this thread about it: https://forums.unrealengine.com/t/disable-an-actor/4738 and they suggest to 1. Stop it from ticking, 2. disable rendering, 3. disable collision and do even more. I am wondering if there is a better way to achieve what I need. Or does in my case disabling collision is enough?
Is it better to spawn a Sphere Collision via AddSphereCollision every time I need it and destroy it when I am done? This is for reviving a player, so would not occur very often.
Hi there, Iโm both new to Unreal Engine as well as C++ (mostly, letโs just go with new). Coming from a Unity background, I am wondering if there is a way to disable an actor (rendering, physics, tick, etc.) and itโs components/children in a simply manner to be enabled again at a later stage. Unity, for example, has gameObject.SetActive(bool), i...
I want to move my pawn when when game paused. I set my pawn to tickable when paused, the movement events are "Execute when paused". Events are executing but add movement isn't working.
Sounds like you wanna play with time dilation instead
Set Collision Enabled
maybe you need to set smth in your movement component? never done this before so its just a guess
I tried the actor time dilation but it didn't work can you refer me to a good tutorial about it
Global time dilation and custom time dilation on the char is prob what you want
Havnt watched any tut about it so got no good refs
I have tried but got into a situation where one actor supports the custom time dilation who has time line and event tick code and the other one which isn't using any of them didn't support.
Thank you for you reply. I know that these functions exists but according to the thread I have posted this might not be enough. Do I also need to disable tick and other stuff? Those Spheres should use minimal resources if the char running around while the sphere is only being used and should be only active if the char can be revived.
Hey guys, why isn't my linetrace doing anything when I go underground? I put my door underground in the tunnel and the linetrace even shows the green, the door's overlaps work, but none of the doors execute
if I take them above ground then they do
I have an Audio Volume in the tunnel but moving that aside did nothing either. I thought it might be that because earlier I had trouble with the Trigger Volume whose collision settings were causing interference with the linetrace, but Audio Volumes don't have any such thing and as I said, I moved the AV away and it made no difference, where as moving the Trigger Volume away did show me it was the culprit.
I dunno what's going on lol
If I switch it to Line Trace by Channel (I had a For Objects before) node, then it works
any explanation why these two are behaving like this, especially that it works fine above ground?
Did you say line trace by objects worked as expected when above ground ?
When you say "above ground" if you are simply referring to something like (ground level vs. a cave) for example. This should not matter.
It all comes down to the collision presets and trace Params being setup properly.
Do you know the real differences between trace by channel vs. object ?
Only what the descriptions of the nodes provide so I don't know anything deeply
it's strange to me that line trace by objects is failing when I'm below the ground plane
yes
by above ground I mean the base 0,0,0 plane that is the default 'ground' for any world
I've circled it here
it's even weirder because everything "above" is actually still halfway "under" the grid
not halfway but somewhat
Doubt it has anything at all to do with "above" and "under" ground
I had ALS IK traces working below "sea level". That's what I named for the Z=0.
Hey Guys
does anyone know what does this button does?
Like, it seems not to run OnBeginPlay, does not seemed plugged to the output log
is there any reference that says what really happens when someone clicks there ?
That thing actually had puzzled me for years, but never really bothered to take a further look
Yeah I found that topic before asking here I'm very puzzled by it.
What does that mean ?
@warm elm @icy dragon That button allows you to simulate the actor within the blueprint editor viewport. Try for example to create an actor with a cube and a rotation movement component. The cube stands still until you press Simulate, then the rotation movement component is enabled and you will see that the cube spins around.
So even if the actor is not yet placed in the level you can still "test" it (to a certain extent at least).
any thoughts on what could be the cause?
Not without seeing the code atleast
Okay that's a start! we've found something that works when we push that button. Do you know the general rule of what's gonna run, and what's not ?
OnBeginPlay is not called, I tested that
Maybe you know this but if you need to test an event in editor, you can make a custom event and check thr 'call in editor' bool in its details panel
fair point! I actualy knew that and forgot it.
Thsi whole conversation really seems to prove that no-one really uses that button
We often just use the logic visualiser that debugs the BP flow of one instance in game, and go from there :P
I need cart to follow the spline behind the train
So far i have tried taking the location on the spline and offset on the Y but it's mot really working cause then the actual location dosen't match the location for where the cart is set
anyone have any ideas how I could do this so the cart follows behind the train as the train moves along the spline, with Cart also obvs following spline ?
get the location at distance X on the spline for the locomotive, and get location at distance along spline at Y for the cart
Where Y = X - (0.5locmotive size + 0.5cart size)
yes half the locmotive length plus half the cart length
Blue plus red:m
the leftmost red cross is where you wnat to get the distance along the spline for your locomotive
the rightmost blue cross iw where you want the distance for your cart
They are separated by Y as expressed above
I don't think i understood the expression
1 is half loco size / .725 is half of cart size
it's ok
just take a distance along the spline for the cart at an offset
how long is your cart ?
2.5 M
?
I feel like something is not working
should i be added onto the get distance or minus like I am here. When i try this the cart starts moves back and then when train gets to near end of the spline the cart then starts moving until the train stops (end of timeline) the cart stops also but not far from start of spline
I'm going to have to leave you in other's hands
no worries thanks for the help though
I assume physics constraints are out of the question
i want to do physics now
cause then I can get velocity normally without expressions and I guess it would be easy to do what i'm trying to do
I heard from someone that it can become insanely difficult to make it run on tracks based on physics , but dont quote me on it
oh it's simple
like its a minature train that is for the visual not something for player to use
Maybe it was because it was some train sim thingy
Still just allowing it to follow a spline should be pretty much easier
hmm shouldn't be i have a empty project I think i'm gonna get it working there and then transfer things to other project when I know its working
well it would need to do that
Is there a way to change the parent of a in-use material instance inside the editor without it crashing the editor? Not tryibg to do this at runtime, just as a utility, https://blueprintue.com/blueprint/al6qrau1/