#blueprint
402296 messages ยท Page 428 of 403
Had a Macro near beginplay that checked if GameMode was valid inside of Opponent, instead of if Opponent itself is valid first
Thanks!
Hey, does anyone know why, when I try and set a variable the FInterp doesn't actually change any values? If I set it directly to the value I want it to get to, it will work fine, just instantly. If I use the FInterp to do it, it doesn't do anything.
@pure tulip Can you screenshot?
I do see that maybe having the variable plugged into current would mess it up but I tried not having it plugged in as well.
No, that's fine, are you setting delta seconds on tick?
Lock on is the graph I was in
Actually, I believe Interp needs to be run on tick to actually update it every frame. In your case it will run once during that chain (which I'm assuming is not hooked up to the Event Tick)
If you want to run the interpolation once, you can use a Timeline with a Lerp instead
Set up an Alpha in the Timeline and hook it up to the Lerp
Good idea! I was trying to run a delay every 0.01 seconds until the value had reached what I wanted but that didn't seem to work.
I had thought it was that.
Yeah, interpolations are usually used to smoothly interpolate between values and this has to be updated constantly until the value is reached
A couple use cases:
- An FInterp via Event Tick to smoothly but constantly update the rotation of something.
- A timeline with a Lerp to smoothly update the same rotation of something, but only once and once the value is reached, stop.
You can either use a Sequence node to split off, one running the timeline and another continuing your logic, or you can use the OnCompleted output in the Timeline to only continue once the value transitions fully
๐
I can't seem to make a Timeline? Can make one in a macro?
No, as far as I know they can only be created in regular graphs (event graph, for example)
Ah, ok. Thanks for the help!
Np!
Any ideas on how I could make my character look towards my enemy? I've got it kind of working. Each screen shot is one the opposite side than the other.
hello, probably a simple question but, if a function i made returns an array and i want to copy that array to a variable, can I use set? or should I use a for each loop and add?
Does anyone have any good ideas on how to fix this? (IK LEG) https://youtu.be/RvWFAFG53uI
By the looks of it in my opinion one of the knee axis are being bent the wrong way. Say that the left and right is X and forward and backward (The proper movement of a knee) is Y. The X axis is taking the Y values and the Y is taking the X. If that makes sense?
I thought something similar too, but have gone through the code several times and see no errors. :/
Hmm. I'm not too sure then. I've tried many times when it comes to making IK stuff and I had absolutely no luck so I just resulted in getting a plugin on the marketplace called Dragon.IK.
Thanks, Maybe I'll do the same to save some time
Np ๐
I've been having a problem lately where I can't get an actor to attach to a socket on a static mesh, it just sits there until I shift + f1 out of the editor and click on it in the outliner, any ideas?
It's being spawned in at the location of the socket, then it tries to attach itself to the socket it spawned at
Is there something that I need to be waiting for before trying to attach this actor, which gets triggered when you select it from the outliner?
Here's the part where it's spawned in
Is that running on an event tick?
actually, no. You wouldn't want to spawn it every tick..
and then attached
So wait, you only need to update it to make it attach to the socket?
For now I guess?
I'm trying to just make it show up in the player's hand
I don't have a skeletal mesh for them yet, so I'm attaching it to a socket on a static mesh
You could try moving it to the socket location once to update it. Then it should automatically follow with animation? I feel like I read what you said wrong.
hello everyone,,, i have question?
by getting an object reference of a specific blueprint into another.. and i'm able to access all the variables inside it, why do i get "accessed none trying to read property"?!
No, setting it's transform doesn't seem to work
@sullen radish I'm pretty sure that means the object isn't initialized in the world or placed anywhere. So It can't find anything.
aha okay ๐
@pure tulip does making a reference for a certain BP acts like casting to this BP ?
Do you mean like taking a cast to and making it a variable to use somewhere else without having to cast again?
@pure tulip no i mean making a new variable and setting it to an object reference to another BP ..
when i use casting on that variable a blue note under the cast node says "It's already that object"
I'm not too sure. Though, making a variable of an object instead of casting it is still getting info from the object I believe so I don't see an issue in that.
I'm no pro though.
i think i figured it out at the end
You don't need to cast a variable if it already is that variable type. Casting is just used to change the reference type.
the variable has not been initialized as you said, it's empty, i think the best way to do is to get all actors of class instead.
@maiden wadi yeah i get it now, thanks.
I have an event on one blueprint that works fine if I call it from construct. If I call it from a different blueprints construct (using cast to) it behaves different. Any ideas for a solution? This is the event:
@pure tulip thanks for the help
This works
@sullen radish Not sure how useful I was but np ๐
This doesn't work
It still prints the string, but not all meshes are removed, it seems to only select some at random
Any ideas why it'd behave differently when called from another blueprint?
That kind of function looks like something that should be put in a library instead of used from a different blueprint.
hi guys what's the animation blueprint library how do I access it https://docs.unrealengine.com/en-US/BlueprintAPI/AnimationBlueprintLibrary/index.html
Animation Blueprint Library
@pure tulip You told me that it has not been initialized, and that was the password for me to understand ๐ lol so thanks a lot
i didn't even get where the problem was ๐
Except with failed cast the print string in the other blueprint wouldn't have fired right? Or could it half-fail?
@maiden wadi you can only call DestroyComponent from the actual blueprint owning the component, not from other blueprints/library as far as I know
Well, my problem was resolved by engineering around it
ah true that... try print stringing everything with sequences of 1 to whatever and see where it breaks
heay i have problems with y rotion on degreas with controller
i want to turn like this
@toxic salmon Just tried it, it works fine.
Would destroy any spline mesh components, just needs the actor reference fed into it.
Thanks @maiden wadi !
Hi there, anyone know how to get a total number of line trace hits? like if i have multiple line traces firing out and hitting the player, is there a way to get the total number of hits happening simultaneously within a given time frame?
the multiple linetraces are all firing out from one linetrace node
using an array of the objects vertices
@toxic salmon Anytime
@fathom spindle I don't know if there is a built in way to deal with that. If you want to amount of hits in a given time, I'd probably just put a function in the line traces to add to the count somewhere and reset it on a timer or tick?
@maiden wadi ah i see so it would be a matter of specifying a range and listening for hit events within that, adding them to an array then getting the array length?
i'm trying to get a number which i can compare to the total number of traces to get an occlusion percentage
@maiden wadi Did you see my reply i made yesterday about my problem? I tryed to add clear and it did clear but still didnt work all the times. That was about the mouse over hit trace thing with enemies i had.
I need help with making platforms that are intangible and invisible until you press shift, and if you press shift again they revert to their original state
@fluid folio I missed it. Been off and on. I remember thinking about it, but did I ever ask you to put a print node on the tick right after the get hit results to see if the cursor was on the unit or if it was an issue with the highlighting code?
@lapis inlet Not sure if there's a better way, but basically you need to get an actor reference to those platforms, and set their hidden to true, and collision to false.
Where is collision located?
Use SetActorEnableCollision
Got it
Ok rethought the question a bit. I have 30 line traces firing out from the vertices of a static mesh. I want to check to see if there are hits happening anywhere on each line trace. If there are hits then add that to an array if there are no hits on that trace remove it. This should allow me to get the total number of line traces that have current hit events. I've not worked with arrays before so any help is very much appreciated.
@fathom spindle Yeah, I just realized I answered that a little wrong after I realized what you were trying to do. If I understand right, you're trying to see how much of an object can be seen by another using multiple line traces?
How do I apply the two conditions of actor hidden and collision to false upon game start? What is the event start?
yeah thats correct, trying to derive a percentage
of how many of the traces are being hit
@lapis inlet Use Event Beginplay, probably.
Alright so it does make the platforms initially invisible and non intractable, which is good
But now I need to set the input to make them visable
@fathom spindle Mostly what you need to do, is run a function. Probably put all of your start points in an array, for each loop and run the trace, if the trace hits the specific object, add to an integer variable. At the end of the for each loop, take the hit count variable and divide it by your total number of start points.
I currently have an input in the project, which is โshiftโ
But even though Its there, when I press it, the platform doesnt appear
I added the โinputโ and the results
yeah i have all my start points in an array and a for each loop already to do the traces
and i can break the hit to get the start hit vector and compare that against my array of starting positions
what im not clear on is the specific node to check if == then add to array then check != and remove
@fathom spindle Drag off of the OutHitHitActor from the trace, and ==. Then use that to check each trace against the target actor. plug the bool end of the == into a branch after the trace. If Hit actor == target actor is true, then add +1 to an integer variable. On the completed part of the loop, take that integer variable and divide it by the total number of traces you just ran.
@maiden wadi thanks i'll give that a go now. was trying something but fairly sure it was garbage
@fathom spindle Can I see your trace part?
sure
this part sets up the for each loop off the vertices
this is the trace
then off that break hit result i'd want to check the vectors of the trace start to see if they are the same as the vertex positions
so i thought this contains node would do that
but maybe it doesnt
Is the actor that's being fed into the function the actor you're trying to check how visible it is?
no sorry, im trying to check how much of the actor thats sending the traces
how much of this sun is occluded by these hands
linetraces coming from the sun and hitting hands
In this case, wouldn't your end point be the camera instead of the hands?
yeah the end point is in the direction of the camera * a large number
but the thing im trying to get is how many of the traces at the line trace source have hit something
so im checking if the hitStart matches the vertex positions of the source mesh
there a grid at the position of the sun sending the traces
does it make sense?
Not entirely. If you're trying to see how much of the sun is occluded, you'd want line traces from the skybox where the sun is all of the way to the camera lens location. Or the other way around, direction doesn't entirely matter. Then you'd let the hands mesh block them on it's collision channels. Note any line trace blocked by the hands and get your percentage from it.
i see, i've done it this way because the dev of the sky blueprint im using recommended putting a mesh at the location of the sun and tracing from it. In theory though it should be possible to check if hits are happening on a line trace and if so add it to the integer and if not remove it? even if its not the ideal way to go about it
maybe this helps clarify
What are the numbers being printed?
thats the HitItem from Break hit result
they are being printed if the hitStart matches the vertex positions array (if contain does what i think it does), so they only thing i need is how to +1 to an integer and -1 if its not, then can deal with finding the percentage at the end of the loop as you said
This is inside of a function, so you could just use a local integer variable. Right after the contains node if I'm not mistaken? If it contains, add one to it. If not, do nothing.
do you know the node for that? i'm new to blueprints so learning as i go
Ah, yeah. On the left side, you have your variables, at the bottom of those under EventDispatchers should be LocalVariables, click on the + to the right of that.
yeah i have that made a local integer
You can either use the Increment node, or get it, add 1 with the addition node and then set it.
Either of those works.
Greetings friends. I have a kinda complicated question, but maybe one that has a simple solution.
So, here's the scenario:
In the world, there's an actor A of class A and an Object B of class B
Object A has a child actor of class C (and an object reference, set in the construction script, to the actual actor of class C that's inside of the child actor wrapper)
Object B has an object reference of class C
How can I get object B's object reference to match object A's object reference (which is a reference to the class C child actor in object A)? I'd prefer it to be set in the details panel of object B in the world editor, but when I try this setup, the child actor is not listed.
I want to respawn My character after death but it gives " Pending kill error " So cast my character one more time after death. is it any better way?
I don't think it's the cast so much as that you set the variable again.
Also, things like this should be event driven instead of being done on tick.
Hey @maiden wadi Everything is working great I just need a way to reset my values to zero when theres no hits
currently decrementing the integer but that still leaves 2-6 hits in it
When my player dies I wana disable all in game UI in 1 or 2 nodes so that I dont have to create an endless amount of visibles and hiddens but this doesnt do the trick. What am I doing wrong?
@maiden wadi Yes, I am using "set timer by function name" Node. I'll will remove event tick. But i want to ask that I have many enemy and actor blueprints which use PlayerRef so it will affect on performance? If I cast player again and again
not like that
or you can, but it's not a great way of doing it
but you still need the foreach loop
float HiScore = 0;
for (player : playerlist)
{
if (player.GetScore() > HiScore)
HiScore = player.GetScore();
}
return HiScore;
I'm not that comfortable with code, but isn't it the same thing I'm doing now ? you are getting the score and if it's greater than the hiScore you set it
yep
you can get the player directly as well as a variable instead of using their index
saves you looking it up again
yeah that's cool, so what I was thinking is to remove the winner from the list and then run then same process to get the other two
do you know of any other way to do it perhaps?
if you want them ranked you need to sort
I would look up and see if anyone has done a sorting algorithm in blueprint
and just copy that
thank you ๐
@odd ember hey, did you happen to see my message on dynamic or static?
is there any PDF viewer plugin for ue4 ??
@maiden wadi Just tried to put print string after the succesfull over , works only when the highlight happens.
@mighty fable yeah but I'd gone to bed by then
so how are you setting the color of the player?
and is there a relation you want the color of the player to have to the color of the enemy
@odd ember Right now I just have it being set by the default material. If we could just make the player blue and the enemy red that would be decent. I'm new to UE4 so bear with me here.
because it seems like it would make it easier down the line if I were to learn how to add more teams or something like that
if that makes sense
a friend and I have been trying to get it to happen but cant quite get it. He has some stuff that he's been working on but I've been tied up with work so idk where he stands with it exactly either
I mean I can show you how but from a design point of you it's probably in your best interest to pick each team color to be unique
just saying
anyway, you need dynamic instance materials
ok well here lemme say this... we need the player and the base character to be different colors. If that is dynamic then we're on the right path
Ok awesome, so how do we start?
I just don't think it's worth making dynamic
you need a material
with an exposed vector4 parameter
lemme open my project so I can try to work on it at the same time, sorry just got home from work
quick question for you, is it possible to keep the existing material and change the parameters on that instead?
as long as those are exposed, yes
ok, so lemme see...
Why would getting game instance succeed 10 times and fail 11'th or whatever the numbers, switching widgets from game instance, part that fails once upon few tries is this thing
And this gives Unhandled exception
so this is what I'm looking at when I open the material
we're not really interested in the material
so once you have the parameter let me know
like I said you need a dynamic instance material
I'm trying not to change the material if I can help it just have it work off of a branch command when the mesh is player controlled and when it isn't
ok, sorry I'm learning, gimme a second and lemme see if I have the right train of thought
better?
yes
pick a source material
the one you want to use
we're creating an instance
which means sort of like a copy that exists in a transient space during runtime
so the material would be the one that is already on my character
it could be any material you want
if you want it to use the one already on the player you can do that too
yeah, I just want the material to change colors depending on whether or not its player controlled
just do mesh->Get Material and plug that node into the source material pin
@maiden wadi Ommmgg i found another way to fix this, i used object instead of channel and it works like a charm, i hope it wont change my results in future tho ๐ thanks for the help!
like so?
yea
so delete the branch and those other nodes
from the return value of the dynamic material instance you should get something like set parameters on material instance
so off of the yellow node call for the players position?
no
you don't have the right node actually
this is how it should look
because again you didn't drag it off the return value
forget about the mesh variable
guys, please, i really need your help. I've been stuck with it for week.
I need to set my camera rotation zoom like in mario games
When i rotate camera up which i assume -90 degrees it should zoom (or move) back
when it's 90 degrees it should zoom (or move) in
It's like in mario odyssey
I am a newbie so i don't know a lot of things ๐ฆ
I would really apreciate your help ๐
so from your get vector parameter value, drag out a node and then search for !=
yea
keep this ditch the != node?
yes
ok
@slender sage Spitballing here -- you could do something like on Tick check the world rotation of the camera, and then fire a custom "zoom out" or "zoom in" event when the rotation becomes < your "zoom in" angle or > your "zoom out" angle
so your player controlled bool goes into that
@keen goblet i tried something like this?
ok got it
ok so I have that
cool
from the GetVectorParameterValue drag out another node called LinearColor - LinearColor
off of the exec?
always the return
@slender sage Don't see a check on the camera's rotation in there. My idea could work, but there's probs a better way
I'm not the best guy to give advice on this anyway, since I almost exclusively do VR. Messing with the camera transform in VR is a great way to make ppl ๐คฎ
sad, thanks for help anyway..
ok
drag the top pin out and write white
yep
so this is the math behind the color
whatever your player's color is, the enemy color is inverse
do I plug that linear color - linear color into anything else?
oh yes, into the select
ok so can I set colors from anywhere or what's next? I feel like we're missing something
we are missing something, but this is the math behind it. what colors do you want to set?
so since we subtract the white color value from the value that is inputted into the player character that is how we come to showing the enemy players colors?
I would like the colors to be the typical red v. blue if possible
we subtract the player's color from white
white in math terms is just a vector with (1,1,1,1)
so subtracting the player's colors we get the negatives of those colors
we then assign those to only those that are not player controlled
oh ok, so essentially if we want to generate a color we would subtract from one of those placeholders to get said color?
subtract from white
and if we subtract from white we get black
it's important that white is the one being subtracted from
otherwise you'll get black like 90% of the time
right because white contains all colors
oh
ok, that makes sense then
all colors are inbetween
in the RGBA gamut
so if you subtract something like a 0.5,0.3,0.8,1 from white's 1,1,1,1 you get 0.5,0.7,0.2,0
which is the inverse
alpha doesn't matter in this case though so it's discarded
gotcha, so how do we assign those values to subtract and get the character to display those colors?
we already have
someone else.....help
that's the purpose of the select node
and the SetVectorParameterValue
now, like I said we aren't done
ahh ok, I think I understand
I just did an intermission to explain the logic to you
ok, makes sense to me
so in your screenshot you're still not getting the GetVectorParameterValues from the material instance
you need to get it from its node
Hello, so I got this weird thing going on: the mouse is locked onto the screen but if I go really far on a side I am able to click on the game window and resize it. On fullscreen, nothing happens but the input (click) is lost
so from the target node on get material? Or where would I want to put getvectorparametervalues?
I have been messing around with locking mouse to screen, hiding cursor with no luck
it needs to come from the dynamic instance material node
like so?
nope
delete the node you have
and get it from the return value
the node you have is the wrong node
the get material node?
Sorry, like I said im new to Unreal, been toying with it for 2 weeks.
I know and I appreciate it. When I drag off of the return node from get material it wont let me attach to getvectorparametervalues
oh ok, then that goes into the linear color - linear color node right
yes
two things are missing
once this is done
you need to find the name of the color parameter in your material
whatever it's called
and put it in as it is written exactly, in the Parameter Name pin
for both the get and set node
once you've done that, at the end of the execution thread, you need to use a Set Material node on your mesh
ok so this is what I found in the material im assuming its this
Is it possible to trace only a single object?
normal traces only trace to a sngle object
what are you looking to do
like a trace only exists in the world you trace in
it doesn't exist as an abstract concept
I have some ground plate (platform). I have a character that has to stick to it
I would like to trace only that single platform
so get that platform's location and trace to it
So this is what I have atm
get material params return into A of the Select
oh I think I misunderstood you then h/o
so you didn't hook up your dynamic material instance into the functions. where it says Self you need to plug it in
Anyone have any insight into this, I have actors spawned in the world, I want to store the actors into say crates, how would you handle this, store all the stats in something like a struct and destroy and respawn the actor, hide the actor or anything I'm not thinking off, I need to keep all the variables on the actor, but dont need to 'see' the item in the crate, any help on this is muchly appreciated
in the Set Material node, connect your mesh to Self
and your dynamic instance material into Material
@ocean radish destroy crate -> spawn loot
but really you will want a loot manager
I wont be destroying the crates there just containers that can store items in
depends on how your game is setup
storing items usually refers to an inventory subsystem, so you'd store them in an inventory rather than physically
unless you have a physics game
think of it like a top down rts style where AI's can go to get resources(but each resource is unique)
Yea I was thinking that, just didnt want to have to go back and put all the vars into structs and rewrite a bunch of stuff ๐
@ocean radish Depending on how on depth you wanna go, I'd make an InventoryComponent that holds an array of structs or classes, and you can call DropItems on it.
DropItems will then spawn all the items or unhide them or whatever.
nevermind i did it myself woooohooo
Sorry Cranz I don't understand what I am plugging into the dynamic material
@odd ember Yep big mess up on my part on this one totally overlooked it for no reason what so ever ๐
@odd ember @faint pasture Thanks peeps confirmed what i was thinking but was hoping there was another way ๐
Ok, I think I got it?
@odd ember but what if my platform has a curve-like geometry?
see if it works, and if it doesn't, reread what I said again
it's all there
@verbal bolt what do you actually want to do?
Say you have an Earth Worm Jim like game with all the curvy platforms.
@mighty fable You are setting the vector parameter value on nothing. Save the dynamic MI to a value and call things on it.
Your character once lands on a platform now has to "stick" to it.
@faint pasture you don't need a variable if you assign it to a slot
afaik
anyway that's the least of his problems
and when you go forward, you just stick to the next nearest point on that platform.
which part?
even on the picture shot you can see that the platforms are actually not flat
sometimes you go up sometimes down
yup
just use box collisions
but how can I place the character exactly on them?
rotate them until they fit
I wanted to trace a segment for the platform that I'm currently on to place a character
Could use custom collison imported with it
ok, so once they are rotated and placed as I want, how to place character ON THEM
if your collision is correctly placed, it will handle it
I have a pivot at feet, now I want to place that pivot on ground (platform)
that's nice
but the collision in your case are going to be more than enough
that would be nice*
you mean physics collisions?
so that my character would be placed on the ground be the physics engine?
all collision is physics collision
but that's how you do it
that's how all games set up collision
the complex meshes are rarely used as collision because they are too expensive
so how do you implement the gravity then?
I just wanted to trace beneath the character and stick to the ground
on the resulting hit point
so that the character would "scan" the ground
gravity is already implemented on the character movement compnent
no need to reinvent the wheel
yea gravity is already there, you just need to implement IK to place the feet, to make it look like there walking on the surface
probably won't be necessary
earthworm jim doesn't do IK either
at least from the video
https://www.youtube.com/watch?v=q7JMTNPPByY
@verbal bolt Good old time!!!
gravity is already implemented on the character movement compnent
@odd ember even on non-physics based character?
yes
How can I use a texture to define where I can spawn meshes or blueprints?
For example I have a ring generator that spawns instances of an asteroid mesh in a ring shape. I also have a ring material with a texture, I only want to spawn my asteroid generator where the ring exists
The ring material is applied to a plane
This was manually placed
@odd ember how are we looking?
@odd ember but I want it to be based on the texture
then you're in teh wrong channel
your best bet
Thx
Okay so I have a problem
Here is a simplified scenario:
I have a light. I want the light to turn on when a button is pressed. The button is a child actor inside a buttonbox actor. In my light, I have a variable for an object reference to a button. I place both a light and a buttonbox in the world. I want to be able to set the button reference in my light in the details panel, but the button isn't listed since it's not directly in the world and is actually a child actor inside the buttonbox.
Any ideas on what I can do? ๐
@odd ember yeah, it didnt work because im not launching it
you probably want it off begin play
both characters are the base color
did you hook it up?
yup
try to promote the return value of the dynamic instance material to a variable, and then use that variable for all the other nodes where you used dynamic instance material's return
I need help again, only a day has passed... ๐คฆโโ๏ธ
just state your problem
yep, sorry 1 sec
here I'm taking what actor I have taken in vr, and seing if it is in a specific class, all good
it works as intended, but it only lets me plug it If I plug the array last. The problem goes when I close and reopen the engine, then it gives me an error and I have to unplug and replug the things, then it works again. Of course, if I wanna be able to release the game I cannot have it like that
https://youtu.be/PYtBOO85wwg I explained the problem in this 1 min vid, idk if it helps or does the opposite.
This works, thanks for your help its extremely appreciated!
Does print string also print to crash log if one happens?
Yeah I did check it
But still no log and engine crashes
I mean both editor and standalone been checked
the log probably gets lost then
@normal rampart why is a buttonbox and button seperate?
@vernal torrent that's a bug, report it
nice, I'll do. Glad to hear it's not my fault at least, thanks for the help again!
Just sayin'
any ideas why my turret is facing the wrong way ? its supposed to be looking at third person character but its looking perfectly backwards at me. any help would be appreciated
It's just an example. ๐The buttonbox just represents a wrapper that holds a child actor. I don't want to place the button in the world directly though. @faint pasture
Your interp speed is too slow or the barrels model itself isn't facing forward in the X axis?
the mesh itself is wrong way compared to what you think is forward it would seem
hey could anyone help me with a method of getting the steam username, i have this but it doesnt seem to work
also tried this way still doesnt work
@whole roost try #multiplayer
@wintry grove try switching the position of player location and barrel location
or reimport with the offset rotation needed
or add 180 degrees to rotation found ๐
reimport would be the wisest but we don't know for sure how wrong the forward is yet
fair point
how do I use functions from a blueprint function library in a game mode blueprint?
Brรถther, is there an easy way to create a "singleton" in editor, using blueprints? Or just C++? For example I want some player stats values to update and read from, and save, but they should always return the same value from anywhere in the game when accessed...
Would a Struct and Data Table suffice?
A struct should work
I know this is such a simple thing but I keep forgetting how its done
I want to reference in the Static sphere mesh from Ball reciever Test
an then plug it into my niagara static mesh sampler
@gentle urchin @distant sedge how do i make model face along x axis ?
@odd ember what do you mean "Try switching the position of location and barrel location"?
Change it before you export it from your model app? Or in the details panel there is import options where you can add an offset of 180 on the Z axis and then reimport
@wintry grove well follow the other suggestions if you want, but in your code you're getting the look at rotation. switching those two vectors would at least see if you get a correct rotation
if you get it right there then you can change it on reimport
@distant sedge i believe im in the right spot but which one do i change ?
The very bottom one you have circled
@trim matrix state your question and if someone can help, they probably will
Hey guys, how do I save the level actor in the save slot? Example: I pick up a stick, save game, load the level and I want the stick to no be there anymore
@odd ember alright, so i have a gun w/ animations seperate to my third person mesh animations and I was wondering how would i go about adding my gun animations to my third person character
i have the gun already added the character but not the animations
can someone help me out
i am currently having issues with fps object clipping
so i want to make a script that stops character movment when the box collider is overlapping
how can I check any static mesh (not cast to a specific one) but any static mesh in the scene
and set walkspeed to 0
if it collides
@trim matrix first person animations don't mesh with third person animations... if you have both you'll want to use third person animation and some camera trickery to show it from first person view
no like actual gun animations like reloading
this is what i have currently
not first person arms animations
so just regular animations for third person?
no like the gun itself
not sure what you mean... like you put animations on the gun itself?
I mean the gun isn't supposed to have animations really. I struggle to understand how you'd want that to function. perhaps through anim notifies you can make it work
I think this is much more an #animation question
alright
@fickle nebula you'd have to ensure when item is picked up it is added to a no spawn list that you save in the game instance
@odd ember Yeah I thought about it, but how manage this list when I'm not spawning the item in the beggining, I'm just loading the level?
@gray dune this is a bit more difficult than you'd want, since yuo would have to mark up every static mesh you'd want to do this for
@fickle nebula you could have every item check its own existence on that list
@odd ember well Cranz, you were right about the game instance but to answer the original question, in my game context, the save file would serve better to store values than the game instance
thanks anywho
@zealous moth sure but the game instance also doubles as a space that is persistent throughout the game. so if you need variables that need to be correct regardless of level, they need to be stored there. you also don't want to save values to a savegame too early
so you shouldn't really store values until you want to save
so my problem is that I have a box attached to my fps character infront
if i walk close to a wall
the box clips through entirely
I dont know what to do, anyone got a fix on that?
my characters capsule works just fine but even when usign a box collision on the object
it ignores static meshes
it works fine on physic meshes
but static meshes, I get clips every damn time
I am getting mad lol
@gray dune set up a new collision channel in your collision presets, that everyone blocks
(and set the box to block everything)
the box collison was set to block all
collision is a two way street
the box collision i overlayed ontop of my object i didnt want to clip through walls was set to block all
BOTH actors need to be set to the same collision
so if one blocks and the other overlaps, it won't work
both have to block
each other
that is
@odd ember When I press play the level load, I dont spawn any item.. that's the problem, How I will check if they are in my list?
let me check
@fickle nebula inside the code for each item I meant
@fickle nebula foreach - print string
each item has a BeginPlay event
in there you can make it check itself against the game instance's list
so in each item, begin play -> if it's on my list -> destroy actor
if they all derive from the same base class you're in luck, you can do that logic once in the base class
yea something like that
keep in mind this is just the way I'd do it on top of my head
it's good because the item is responsible for its own behavior
failing that, a spawning manager system could also be implemented, but that's a bit more complex
Hey how do I perform something on game quitting? For example if someone presses ALT + F4
It can be in C++ or BP doesn't matter
but imagine a lot of sticks, so if I picked up one stick once , It will make all my sticks dissapear
@hollow dove pretty sure alt f4 is a windows command, so you can't execute logic as it overrides game logic
@gray dune because whatever it is clipping with doesn't have the collision set up to block that mesh
both have to block each other
do you understand?
@fickle nebula not at all, since every stick performs the check individually, only sticks you have picked up would disappear
(as in, only the sticks that are on the list)
if thats the case
the wall shouldnt block my character
if the wall didnt have collision
it blocks the capsule of my character just fine
as you can see i have the box collision set
up
show me the collision setting of the wall then
I can't actually see the collision settings
you cut them off
the collision presets are what matters
and whether or not you have set them to custom or not
its the fps test map
by default
those have collision
otherwise I cant explain why projectiles etc bounce off
I still can't see what's inside your collision presets
like I said
if BOTH actors have collision set to block each other, it's fine
if only one of them has block, it won't work
my guess is that is what is wrong
right but I can't actually see inside of your collision presets
you're just showing me the "block all"
but you could have custom logic inside there
cool
show me the other collision you're saying fails
@fickle nebula I think I left out that you'll probably need to use some kind of identifier to identify the item. perhaps it would be better if the array was a struct of class or soft ref + id string
yes, I'm trying to do a list o obj ref
or perhaps a map with string : class
try unticking generate overlap events
Can someone tell me why my character stops roaming after ai move to?https://gyazo.com/93b72d877efd2215f8541bb05601066c
so it goes through the wall?
nevermind then
unticked on the box collision
people are rude
yeah excuse us for not answering your questions immediately while in conversation
we're not paid to be here
Id help but I am not really experienced with ai
and cranz is currently trying to help me out
so we were ina convo
ok so a bit far out
but
perhaps try a video
@gray dune
so I can get an idea of your issue
of the issue
Is there a way to add components in a BP Actor via blueprint?
that is indeed strange
no idea, the cart itself has collision
untick hidden in game for the collision volume
let's see if the collision actually follows you
yep does follow me
but wont react to static meshes
physical objects get interacted just fine
is the cart overlapping your capsule in any way?
just did, didnt work
@true valve literally, Add Component node
this is why i was wondering if theres some way to get any overlapped actors with box (check if its static and then idk stop movement
which in return would be a really bad solution
yea i see bunch of problems with that
can you maybe try in your end and see if its works fine
the collision needs to function
maybe its just me
try deleting your box and do a sphere or capsule instead
see if you get different results
@odd ember I don't see Add Component when I right click and search for it. It's in the components tab but I want to add stuffs via blueprint nodes.
@odd ember It worked ! ๐คฉ Thank u
@true valve it's a node in existence
maybe got any last clue
hmm
object type is dynamic?
idk just the barest spitball here
@true valve you have to specify the type of component to add
I want to add a BP to a child actor. ๐
Then that child actor will go under the scene in Components tab.
so add child actor to a scene
I will need to add multiple of child actors to that scene
@true valve you should never use child actor components
they're terribly inefficient and there are much better ways of doing whatever it is you want to be doing
How to add BP to a BP? Let's say I have a light-bulb BP with some features and I put that in a houseBP which has its own features.
Any best practises for creating save games while in development where variables and such might change?
@true valve why does the light bulb have to be an actor? can it be a scene component?
@echo scaffold not really, save what you need, and only what you really need. it entirely depends on your game otherwise
Is it a bad idea to create a SaveGame Object which contains a single struct of all your data you want to save
Rather than have the variables separate and within the SaveGame Object
I mean structs are useful when you're organizing variables
if you just have one struct that every variable is part of, then you might as well not have it
unless you need those variables to be together at all times
it's better to think of packets of data that you want to keep together
Yeah that makes sense, so in this case it's a character creator save game
So a struct seems like it would make sense. But I'm concerned that it would be less stable with constant development, things being reordered, renamed etc
Since wouldn't it break the entire struct / save then? Rather than if it was all free floating variables
if a save fails to load then that save is corrupt, structs or not
I don't know how either structs or SaveGame objects work behind the scenes really, so I can't imagine how it might break or might not
in the end the data is serialized, so it's gibberish anyway
Right but if one variable of a save game doesn't load, won't it just ignore that variable?
Or will the entire load fail
nope
well if the variable is a null value it'll load fine in either case
if it's corrupt it'll probably crash your game
Alrighty thanks for the answers then, will do some stability tests to see what I can get away with
but like I said behind the scenes it's all serialized anyway, so in terms of data it doesn't matter
The docs say you can get a player subsystem in blueprints: https://docs.unrealengine.com/en-US/Programming/Subsystems/index.html
An overview of programming subsystems in Unreal Engine 4.
I'm trying to do this in a level blueprint event BeginPlay and the value is none
then it doesn't exist
if I first get the player controller 0 and use that to get the local player subsystem, it works...
odd.. so getting player controller 0 then the subsystem is the correct way to solve this?
subsystems will instantiate themselves if not instantiated already. so if one returns null, it either doesn't exist or isn't callable from where you want it
i wish this were documented on that page
How do i change key board focus when a widget is opened for example? So my arrows left and right will move the player but if I open up my journal it will also turn the page. I don't want them to do both at the same time.
@rose spire there's a node for this, set input mode
is there a way to access the ULocalPlayer in blueprints -- that seems like it fits the docs better?
@odd ember It's legit called set input mode? I can't find it
@rose spire
tbh I seem to remember these being a single node
but I can't find that one anymore
@woven pagoda if you have the low entry standard library, that has a function for getting local player (still requiring player controller):
thank u
am I going crazy here?
how can the default of that spawn node be the third person character when it's connected to the variable which has a value of "drone" as it's default class?
@stuck hedge your var could have been modified after creation
Creation of what? that's what it's set to now.
you could make a breakpoint and verify if its still drone at the point
It's not running
this isn't about running.
Notice the search box at the bottom
if i search for "third" it claims the default for that spawn actor is third person character, but it clearly isn't.
I'm trying to delete the third person character BP because I don't use it or need it, yet it's claiming several BPs have a reference to it. This is one of those BPs, so when I searched it claimed this node had a reference to the third person character BP, but there is no reference there.
just fyi I believe there is a bug where the first search doesn't really work
I always have to search twice
No. I just found the issue.
dono if that has anything to do with ur problem tho
if I unhook the variable, the spawn node has "third person character" set as the default.
if you set something as default and attach something else, it seems to "remember" it.
ok
I've never seen that before.
so If I clear what is set there, and hook the variable back up, it works fine, and the "default" is cleared.
With spline mesh
Im trying to make one of those expandable accordion-like things
Can anyone help me
Anyone know the node I need to set the number of characters to show after a decimal of a float? I know one exists, but can't find it again
@rare gale I think it's set precision
hmmm, not finding that...
hmm this is in cpp, wait
the one I'm thinking of is ToText(Float), but I was looking for one as a string... maybe not the same
that one works for me... had to dig it up in an old project. ๐
Does anyone hear work in VR or am I just along here
@fickle nebula
Well that is insanely disappointing. Is there any other channels that deal with VR or is it just not here in this Discord server
@cobalt current There's a VR-AR channel in Platforms
@fickle nebula Clamp didn't have the option since it changes the number. I just wanted to set how many digits were shown in UI and print strings. ToText then ToString worked
ToText lets you set the digits to show
aaahh interesting
hello, how can i make "if camera stopped" node? i need it for my timeline
help)
@slender sage you need to write camera location (or transform) into a variable as the last thing in your timeline update chain, and then you can compare the current camera location to the variable, which represents the previous frame camera location, to determine if the camera has moved at all. There may be some better way but idk anything about your project so that's a generic approach.
@cobalt current There's quite a few people in here that work in VR. I don't personally, but there are some.
Following Unreal Engine's Blueprint Multiplayer tutorial series on youtube, it's approach is that game instance handles switching widgets (creating them) and if you have something like back button in one of widgets, you remove from parent and then call creation of some widget from within game instance (you get game instance on construct of each widget that needs to switch between widgets and cast it to your own game instance class). Although the issue there is I log each getting game instance and failed cast, unreal engine crashes, nothing is logged, and idea why that is?
@tight schooner are you talking about timeline that moves synchrony with camera float?
Hi everyone, I'm running multiple line traces in a for each loop and accumulating the number of hits, then once the loop finishes dividing this by the total number of traces to get a percentage. The question I have is how to smoothly interpolate the resulting percentage float. I think I need to store the old hit percentage to a variable every time it gets updated and use this and the new one to drive an finterp with delta as the alpha, but im really confused by the order of operations of how to set this 'LastPercentage' variable. Maybe someone could help me with the maths to get the last frame and compare it with the current and set them that way?
@slender sage you can use my solution on tick or on a looping timer; it works anywhere. The premise is to compare the camera's past state with the current one to determine if the thing has moved over time.
Iโm sorry, iโm pretty bad at speaking english. So i donโt understand the half of your message
To determine if an object is stopped, you need to compare the object's past location with its current location. The object's location should be stored into a variable. Then, in the future, you can compare the object's stored location to the object's current location. If the two match, the object is stopped.
You can do this operation on a timeline, or on tick, or on a looping timer.
Any event that fires regularly will work.
Another question i have is that: can timeline play animation as object goes?
What i mean is that i have a camera with timeline. If camera is 90 degrees, the timeline animation should be on 90th frame or second
Is this even possible
I heard something about โtime setโ but iโm not sure
I think that's possible. I'm not in front of the computer so I can't say how to do it.
It should be possible to play the timeline at any starting point.
I suspect you'd have to do some math. Timelines work with seconds rather than frames.
Then i..guess i should make the timeline 180 seconds?
That seems like a very long time. It's possible to set the timeline's playback rate if you want to go that route though.
I know very little about your project, so I can only speak generally.
I can show
I would suggest simply trying stuff. Get it working first. Over time, you will discover cleaner ways to do it.
How many seconds long is your timeline?
...1
I should know this, but I always forget. Rotators range from +180 to -180 right?
yeah
Your script might be feeding the timeline's "New time" with a very large number. For example, 90.
It's telling the timeline to start at 90 seconds, but the timeline is 1 second long
You need to do some math on the rotator's values so that it can produce a number in between 0 and 1.
It's a glitch. Restart the editor or something.
(I wonder if that's even in the UE issue tracker, lol.)
holy jesus
it worked
it actually worked
thank you so much man
you are a true savior
now i have to figure it out with negative degrees
"abs" (or "absolute"?) node will remove the negative sign from negative numbers, if that helps.
oic
lol, is it possible to make in timeline -90seconds
So I've been following CodelikeMe on youtube, with his climbing system. But I've run into a problem and can't seem to find a fix for it.
I have a Enum, where i have a couple of movementstates that my character can go into, but I just get stuck in my idle hanging animation. I think I've narrow it down to either there's a error in the animBP locomotion or in the way I'm handling my Jump. I would love some fresh eyes on it since I've been fighting it these past weeks.
is there some kind of shortcut method of inserting a new node into an existing flow?
to brake an existing flow with a new node, to paraphrase that
hello guys, how can i make an integer that has values of thousands... for example (1200) to be have decimal rounding link (1.2k)
and (2000) to be (2.0k) ... knowing that it's a slider so the UI for the value is dynamic and always updating
doing the simple integer-integer will not work in this case i guess, coz it gonna update the slider value.
so what's the best way to do it?
You can use the to text node to format an integer as text, there's an option there if you expand it to include a thousands seperator
@severe rune Thanks a lot, that really did the trick
how do I round a float so that its still a decimal and not completely an integer
for example 2.8734 to 2.87
@sick sapphire I've just asked this question, and @severe rune actually gave me the exact answer, >> use the "To Text Node" and expand it to modify the rounding options and criteria you like
@sick sapphire And here's a link for the documentation that may help you, it helped me a lot too,
https://docs.unrealengine.com/en-US/BlueprintAPI/Utilities/Text/ToText_float/index.html
ToText (float)
@sullen radish wow, i never noticed there was a dropdown!
thanks, that worked!
@sick sapphire you're welcome, actually @severe rune is the one who helped me figure it out first ๐
@sullen radish still not quite sure how 'ToText' is going to help you convert to using 'k' as an abbreviation? Would love to see your results
@tribal umbra actually i've made some few work on it, and i will post you the blueprint as a screenshot, i'm not sure is it gonna be helpful but here it is
.
it's a simple set text in the UMG and i've added some text values as variables containing "Million KM" and "Billion KM" .. that's why i've divided the float by 1000
the slider current value i mean (Integer) That i've converted into float.
simply by checking if the text contains Million .. it takes the number and divide by 1000 then by using the "To text" node i was able to make the decimal rounds properly by controlling how decimal rounds i want to display,, and then set the text to "Billion" if if the value of the current slider more than or equal 1000
and here's the "To Text" node expanded.
also by implementing the Format Text node, i was able to get the different values separated from each other and alter each one individually .
@tribal umbra Hope that helped.
Thanks for sharing!
Im wondering if you could use a select with the different text suffix and select based on the length of the integer, maybe thats over complicating it though
yeah maybe you're right i guess i have to try that too. Thanks
How do you manage having 100 AIs all running at once , just walking around , what would be the best way to handle that many of them in the least performance cost way possible?
Interesting question, I also want to know it
@short coral turn them over to a minimum activity BT at certain distance
there's no simple answer really
but the fact is you don't want 100 AI active at the same time
unless you want your PC to send smoke signals
So turn off their behavior tree?
But if that's the case won't they still be rendered regardless?
I have thought of pooling as well but pooling can only do so much
sure they'll be rendered
you gotta find out smart ways to make them work
you probably still want them to perform tasks, just very low key
optimizing at that level requires cpp access really
you're not going to do it effectively in BP
mathwise estimations running on an off thread custom BT might work
swap in for normal BT when relevant for players
yea AI is a huge performance hog
I tried a pooling system where it would put the AIs into place depending on distance but even then
you did pooling in BP?
Using in a BP AddHierarchicalInstancedStaticMeshComponent on an actor during runtime. When selecting that actor in the world outliner the added components do not show up in the details panel, but the meshes definitely exist in the world. Is this expected behavior?
does anyone know, why I keep getting different calculation results, with static forms? eg., I've three nums, in array, and I'm looking for their average. Sometimes I get the correct amount, sometimes I don't. It's totally random, as far as I can tell. Any ideas?
how can i make a timeline for negative numbers? with new time set help!
@teal spade debug it. use breakpoints. look up breakpoints in the documention.
@odd ember been sort of doing that for a while, by listening to those three variables
and other parts of the graph
have you used breakpoints though?
I just, but it tells me nothing. it hangs up on a branch
then resumes
thought that even if I were to manually set (A+B+C)/3 gives a different results sometimes
the variables come from traces. sometimes they magically don't hit anything (most of them), thought that might've been the problem as well, but...
have you set a breakpoint on your average function?
can only watch that function, can't breakpoint it
you can if you scope to it
not sure what you mean by that
nah, can't open it, don't have visual studio ๐
then I suggest you make your own avg function
did that with simple math, but that changes as well
never mind i figured it out
btw, is there a limit on line traces?
as these variables come from them
as far as I know there isn't, unless it tanks your resources
however, they're hit&miss with thin static meshes
no limit
well
performance is your hard limit
but you'd need upwards of 20 traces in BP alone to even feel that
several hundred in cpp
per frame that is
'cos I'm working on a climbing system, and if I move my pawn near a thick wall, all traces fire, all the time. But, when I approach a more narrower, it becomes a Russian roulette. Mind you the wall is about 20-30 units thick (guessing)
I see
3 traces is like spitting in a bucket
its infront of pawn
facing forwards, to detect walls
but if I move to that one (on pic), the go haywire. But if I approach a much thicker block, everything seems to be fine
Show where you are starting and ending the trace
Also draw debug
You should be tracing from capsule location to capsule location + 100 x capsule forward vector
What about the best approach to populating a city? Is it the same kind of dilemma ?
@short coral That will depend on your scale and how persistent the AI needs to be.
I would just like AI that would walk around pavements and such
To show up only in a specific distance
@faint pasture you say I should ditch the line trace?
@teal spade No, show how you calculate the trace start and end
@short coral How many AI at a time are you thinking?
That should work just fine with AI controllers.
@faint pasture simple Arrow component > Get world location (Start); Arrow Comp. > forward vector + start location = end
plus some change for the difference, mine is set at x130
Draw debug for a frame and make sure it seems right.
Make sure it's ignoring the player mesh too.
strangely enough, now I scaled down another wall, and it seems to work
they're both simple meshes
dunno why it works with only one
wait
In my experience a line trace isn't gonna bug out, it's either the collision setup or geometry being messed up.
OK , lemme just explain my setup of this whole thing so maybe you can suggest something to help , what i have right now is a function that ticks every second which checks if a player is within distance of a point , if true it will spawn Ai to just walk , if he's far from it , it will destroy the AIs if necessary.
I just checked, again after you said, that the smaller wall didn't have the *Generate overlap" set
like doing stuff on tick is going to cost you more, not less lmao
But dont overlap events tick every second anyways? to check if it is being overlapped with an actor?
@teal spade traces use Hit events, not overlap
Line trace on tick is practically free. I run several hundred a frame in 0.8ms
@short coral well no not really, and it's cheaper anyhow because it's all done mathwise
BP are always going to be more expensive than cpp optimizations
That's unfortunately so true\
so why are you doing stuff on tick
in BP
if you want to optimize
like you can get away with not using tick in 95% of cases
it kinda works, but still doesn't register all forward facing traces, only one
this drives me nuts! ๐
can you take a screenshot
@teal spade show a screenshot with the trace debug
Also show the trace and the collision setup of the wall
(mind the jumping, its offset)
as you see, because only one trace fired
so as only one trace registered, the average of the three vectors are messed up
that looks like the traces are too far
yeah, because if I get too close, it fires the actor; didn't tick that off, because that's irrelevant (its now set to Tick, not manual input)