#blueprint
402296 messages · Page 660 of 403
how can I add more into here. reference viewer
my friend who migrated this duplicated the pawns so half the stuff is referencing the wrong pawn
delete the wrong duplicated pawn, and in the dialogue set your correct pawn as replacement
that should replace all of them with the correct one
why can't i make this sphere smaller?
brimstone!?!?!?!
Thanks @spark steppe
Hey everyone. I'm working on a side scrolling shmup type game. The player has free movement across the horizontal and vertical plane but I'd like them to be able to shift planes between three lanes when it comes to depth (far, center, near). I'd like the lane shift on key press, right now I have the input set to Q and E.
I will have enemies spawning inside the three lanes so I want to make sure the lanes are set jumps and not free movement between them otherwise the player may not line up with the enemies. I can't seem to convert my free movement blueprints from the other two axis to fit this need, attaching what I have for depth movement so far below.
I've done a lot of research to try to answer this question on my own but most help I've seen out there from people who've done something similar are doing it for an endless runner and their solutions break my free horizontal and vertical movement. Can anyone make any suggestions on how to tackle this differently to achieve the desired effect? Thanks!
Blueprints related to "plane shifting" so far:
PS: This works right now but as "free movement" described as before. I want the ship to move 40 units away from or towards the player and in it's current configuration it's acting more like a speed setting but the ship can move to any point on the depth axis.
what would be the best way to setup 6 lights in a scene that when you press x they all slowly dim at the same time?
i cant think the best way to do it
What you don't know in particular, all of it or just one step in particular?
best way to approach it efficently
i know i can just put the lights in a bp and reference each of them seperate and reduce their intensity using a timeline
but thats seems not the best way to do it
@brittle sky I mean, if it works, and you aren't building huge amounts of code on top of it, I say go for it and optimize later if needed. Perhaps Light Functions would be another approach https://docs.unrealengine.com/en-US/BuildingWorlds/LightingAndShadows/LightFunctions/index.html
Lighting projected using a Material as the source.
I don't know off-hand
idk what should be wrong with a timeline in that scenario
Timeline should be fine
once i added a timeline to this
it simply didnt work at all
how would i incorporate a timeline into that?
you would need to add a float value to the timeline which is your intensity and connect it to the node, actually you are just turning all off
surely i cant just lerp between two values and just ignore the timeline
if you get what i mean
wouldnt that be simpler
but i dont have a clue how to actually create that
well, it's the same, up to you what you prefer
you will still need to add a float track to the timeline which goes from 1 to 0
or 0 to 1
whatever your brain can handle
Wouldn't this work too instead of making an Array and looping?
perhaps
just drag them all on the target pin, might also work to connect an array there
it does
ohhhhhhhhhhhhhh
Hey, does anyone know the easiest and maybe best way to create an allied AI team and an enemy AI team?
but only individual pins OR an array
basically a foundation so they fight each other etc
you would add a team variable to your actor class, which could be a name, integer, float, enum, vector, whatever and decide in the AI logic if it should attack it or not?!
Hmmm, I suppose that's the easiest way
I wonder if it's the most optimized way though
you can also create different child classes of your actor, TeamPotatoActor and TeamPizzaActor
but i think that would create more overhead from the class instance + class checks than what an enum (which is bytes) would do
this is a non starter
just do what you know how to make
technically this isn't even per-se the best way perf wise if you had to make something uber fast
Perfect ❤️
I say this, not that perf can be discarded in BP, but because a team check is a rare event (usually) and so it doesn't have to be fast (it just cannot be slow)
any way to do this in a library?
Item Array is Empty, needs to be Set somewhere
when creating dynamic material, how to set static boolean? SetScalarParameterValue does not work and I cannot find any other relevant function
hint is in the name, you need to replace your static boolean
what do you mean by "replace"?
sounds like I can't set static bool in dynamic instance, even during creation ;/
I need to change color material in the white clouds to pink clouds of "Volumetric Clouds" any idea how to do it?(edited)
you need a static paramter for that I think
I do have static bool as parameter
wait
but no way to set it with dynamic instance
yes, I have that
my problem is with setting it programmatically during creation of dynamic instance of that material in blueprint
yeah, you can't do that
though so
shame, that makes static bool params half useless
it's more expensive because both version will have to be calculated
or you could have 2 materials
as base? inpractical for me
not lerp but if, but same problem as you said, both pathes will be calculated
if is even more expensive than a lerp
anyway thanks for help, I will have to think on it.
np
@modest gulch there is a dynamic branch node but it's really only worth it if it is masking out some really heavy operations
good to know anyway, what is that node?
It's sort of equivalent to a CPU branch.
I mean, how it is named
Branching isn't really a thing you want to do on a GPU very much
I think it's just called dynamic branch
thanks
Hello, i'm trying to craft a behavior tree reading the following: If unit into range, set isAttackeable to true, then if it's true do task Attack, otherwise do task MoveTo:
Do you know how to use the value returned by the first task without creating a blackboard value ?
Isn't that kind of the whole point of the blackboard, to be the memory of it? If you're doing it with a task, you probably need to communicate through the blackboard. You can probably make a find attackable Target service
Can someone tell me what node should I use to rotate an actor over time (1 sec) in my level please ? I tried AddActorLocalRotation but it goes directly to the final rotation instead of going slowly to that final rotation
multiply it by delta time
if you have a target rotation, then you can use lerp or slerp
Nope I'm using a timeline for that but I need to know the name of the node for the rotation because there are alot of them related to rotation
Look how messed up it is
Is it possible to SET variables from a Class without it being a object? Might be a silly question.
@gusty shuttle you can with an editor widget, but it changes the actual asset
you wouldn't do it for gameplay stuff
Fair enough. I'm just having a issue with my bad structure and I'm currently using a event dispatcher and it's calling to every NPC (as it's made to do but I don't need it in this situation)
I mean, if it was a object class I can pull out the variable and SET it, but I can't with a Class variable
Is there a way to know when a FInterp is done besides comparing target value to return value?
@gusty shuttle objects are instances, but the class is the type, not an actual thing
I want to create a level where my game users can upload there own anime, blueprint, character , code of it's functionality and it is appplied to that particular user.
I think I wanted to use the class because I need to tell the specific instanced object (character in level) that I need to switch a bool. Ideally I'd like my code where I don't have to search for the specific object. Hence why I wanted to use a class.
As in, NPC Master (object variable) but I need to tell the NPC child 1 and 2 what that do in their instances
@narrow kelp
I mean, I could do GetAllActorsOfClass, but thats sloppy no?
you can have your NPCs bind to an event on your master object / game instance or whatever
then call the event on the master when something changes
Yeah bruh, that's what I was already doing haha
But it calls weird
Since it's a event dispatcher, it gets called on all instances and I don't need it to.
So the conclusion is, to not use event dispatcher for this specific case
I want to create a level where my game users can upload there own anime, blueprint, character , code of it's functionality and it is appplied to that particular user.
you can bind and unbind as needed
Can anyone help with that
Ayeeeee, true. Perhaps I should unbind it after use
@narrow kelp Unbinding it worked! Thanks a bunch man!
@ashen stirrup Can you be more specific?
@gusty shuttle actually I am making a multiplayer game and I want that there is an upload option where the users can upload a character file with anim blueprint and character files and thay specific character is applies to the third person character of that specific user
So by upload you mean from the internet to your game?
hey, can someone help me? i was doing the loot pickup from enemy stuff but, when i kill the enemy, the pick up effect appears, but the loot at self does not.
i think the enemy is picking the loot, because he is a character's child
can i fix it?
@little flare hey i dont know much but see if this works, promote a variable and in character child blueprint set value variable x to 1 and in kill animation or loot drop animation set the value of variable x to 0 which means when ever a player is killed value of x will change to 0 and them make a condition statent that if value of x is 0 then that character child can't pick up up loot and I think you need to make a tag for each player to work this
And this is not perfect as I am currently new to this and currently learning
ok, i will try, tnks
Welcome. E
I need some help here please!
There's an object that when my character take it will be immortal for about ten seconds. How could I do that?
can I use a timer on the death?
hi, how can I get a skeletal mesh asset bone position in a editor widget blueprint?
I tried this but it's not working 😕
How hard do you think it would be to set an airplane to be controlled by moving the mouse to orientate the direction it flies towards? It sounds such an easy thing to program, and yet I find no tutorial
That gets deep into buff systems really quickly but the easiest way would be to check bCannotDie when health < 0 and don't die if it's true. Then your buff would just set that Boolean true and then a bit later set it false.
That's a hacky way to do it and won't scale but it'll work.
Not hard at all, depending on what sort of flight model you want.
Thank you ! I did it done
Yeah sorry, I've been too vague. I should make the nose of the plane to change direction based on the movement of the mouse, in a very arcade-y way, so that the WASD keys are not necessary. There would also need to be a maximum turning speed after a certain degree of turning, but that's another problem. The mouse input for 3d movement is the real deal here
6DOF or always oriented to ground plane?
6dof
I would start with mouse X rotating the craft about UpVector and Mouse Y rotating it about RightVector
You can do roll however
Thats for direct mouse = joystick control
which is exactly what I'm looking for
Yeah just take the mouse axis value x some value and rotate craft by it.
@golden cipher you trying to move kinematically or by physics?
hey, i need help with other things, i want to set up the defend action and do a pick up weapons system, can someone help me?
Sadly I don't know what you mean by that, I come from the 2d world
Are you trying to use torques and forces or just move forward?
Just forward, with the possibility to only go faster or slower but not to stop
Ya then just set position = position + ForewardVector x Speed x DeltaT
Deal with collisions later, get this working
Alright, I'll be sure to grasp these concepts and then give it a try. Thanks @faint pasture 🛩️
The Set Property Name Blueprint. Uses new property names: Is there a list available to find out what the names are?
Ok so guys I want to make is so when the character reaches certain speed(acceleration) I set the condition to true
Need to make a reference to self on public variable... any way to do that?
(need to pass a ref of the master umg to child umg... only other way i found is get all widgets of class)
@restive dagger When is this function called? And do you mean speed or acceleration? Two different factors.
I think I got the answer, but I meant the current speed, not the speed variable of character movement but I meant velocity by speed
@maiden wadi The current code here
Ah. You can just call GetVelocity on the actor and get it's length for current speed.
You need to do this kind of check on tick. Otherwise it will only check when you press shift.
TakeStamina lowers your currently stamina amount I assume?
oh yeah u are right, rn it only reduces the stamina when I press shift, it will stay at the same amount forever without the tick
yep
Yeah. Shift should just change your run conditions, like speed/acceleration factors. Movement input adds movement. And then on tick, once per frame, you can check the factors and alter stamina if you're running faster than the 300, modified by deltatime to make it framerate independant.
Your stamina drain will be CurrentStamina - (StaminaLostPerSecond*DeltaTime)
That way people running at 120fps don't lose stamina 4x faster than someone at 30 fps.
Is there anyway for us to disable jump input like "Set ignore move input"?
Under what conditions?
Yo @maiden wadi I have a problem that shouldn't occur
So heres the code after all the changes
when I release shift it still take stamina
even tho the running var is false :/
Does anyone know the namings for this blueprint?
https://docs.unrealengine.com/en-US/BlueprintAPI/View/SetPropertyName/index.html
Set Property Name
I wouldn't bother with the extra state with the Running bool. If you really want to know if you're running, you can check input keys for some things, or rely on the character velocity for others, but the explicit state is just going to complicate.
You also probably don't want to check any conditions on shift released. It should just be allowed to go back to normal.
yess thats the solution
Rn I'm coding with c++ and blueprints
should I keep a code like this in blueprints or c++?
In the ThirdPersonControler-Blueprint:
there is that "function Jump"/"function "Stop Jumping" (see Image),
how can i build my own function? (or where do i see whats inside?)
It really confuses me sometimes
That's personal preference of design. I personally prefer to prototype in blueprint, and once I'm fairly sure I like it, I'll go to C++ and replace do it there. But then some things are just simpler to add straight to C++.
Double Click on the function to see what's inside, if u want to create a function on the left click the plus bar https://gyazo.com/8f6d9d6165a80f7d161a74777410d85e
https://gyazo.com/37ca7733fe0c020f79bcfa84cb3adffb that plus bar ^
Thanks for all the help man
thanks, just noted that "function Jump" is a build in function and cannot be opened
how can I get a skeletal mesh asset bone absolute location in an editor widget blueprint? I can get a socket relative location but I don't want to add sockets to the bones, especially not manually
@soft peak You need Visual Studio, or Rider installed to see the native code.
thanks alot! i prefer blueprint but i will try it👍
If you have programming aspirations past simple design work, I strongly recommend taking a couple of weeks to a couple of months and learning some basic C++. Even if it's just enough to write simple blueprint static library functions, and to be able to read source code. It'll make your Unreal experience so much easier.
My AI works perfectly fine and chases my player when playing in the editor but when I launch the game, it stops working and goes completely still. I think its to do with the nav mesh not working…
Please can someone help me, I will appreciate it so much! 🙂
I need some help here please!
There's an object that when my character take it will be "immortal" for about ten seconds. How could I do that?
can I use a timer on the death?
can i open it via visual studio code too?
@soft peak Fair question. Not certain personally. I've only ever used VS2019 and Rider for Unreal.
yes you can but you need to do some steps beforehand, they are related to compiling
when a add a new animation to the UE4 project, my model looks like this, its just with new animations, all the anims that i already had work just fine
can i fix it?
Looks good to me.
Jk, the anim is prolly from another skeleton. Look up retargeting
nop, i check and recheck, is for this skeletal mesh
I want to create a specific movement and it's really hard to explain. It took me last time a week to get it done and it worked really well except i broke the collision.
So how I've made it is by moving the ROOT object in the world (flying plane) and move the mesh to make it look more dynamic, so the camera was actually locked to the ROOT object not the mesh, the mesh was just like idk how to say it, for visual purpose and this broke the collision.
I think how to fix it would be to have no collision on the root object but the root object would inherit the movement of the mesh. So when the mesh hits something, the root object stops.
Why? The root object moves like a glider you can imagine, like the normal "Flying template" but the mesh makes it look different like it's swinging left and right, moving little forward when boosting to make it look more "speedy" and so on. I've spend also another 2 weeks to find a different way but I don't know how
Why do all blueprint exposed functions that let you get actor or component bounds always return some janky orientation-relative version of the object bounds making it totally useless :|
I am currently having issues with my camera/ player start
I try to click play but i just spawn in weird places i have tried many things i have found online. Nothing worked. My player start has a visual of "BadSize" any solutions?
Move it someplace where it doesn't say BadSize
It usually means your placing the start capsule inside of something, or overlapping with something
I dont have anything near it, and i cant position it anywhere without it saying it, when i first import it doesnt say it
there could be invisible colliders in your level
Do you have a screenshot of where you were trying to put it initially?
i tried to add a model i believe then i deleted it
but in the world its no longer there idk
Guaranteed there's s collider inside of there
i can show a screenshot one second
i ahve tried everywhere here too
I tried looking with collisions shown
still nothing
Tried placing outside of the cave?
And can you then fall/walk into the cave after you spawn?
Do you have some volume that you set collision on accidentally perhaps to "block all dynamic"?
I even looked here
still nothing the two boxes are like post process
I spawn under
like here
How do i set that volume or whatever? sorry man im just really stressed out
Deep breaths... the only reason why you get "bad size" there's a collision volume, and the setting on the player is to spawn and tray to find a place where it's not colliding with something, which is why it's pushing you in weird places, its the closest place it can find where it's not colliding with anything. Just hunt more carefully for colliders. And try to place your player on the ground outside of the cave system just to test. Maybe try switching your views to look around for something you can't see in 3d view
This is the lowest it can be before i can no longer spawn him or whater
there is no collision here tho
Should a Airplane be an Pawn or a Character? :x
it's hard to see here, but you see how it looks like I'm not intersecting anything with player start, but really, I am actually? @fossil crypt
what would be the easiest way to have my character walk back and fourth, like have it walk to the left until it's X location is under -600, and then walk right until it's X location is over 600?
I have tried for around 45 minutes looking for collisions, i am going to try and move my assets to another place selecting certain models at a time. I have moved afew so far and im still able to spawn
jeez i found the issue and its so stupid
it usually is for things that seem crazy 🙂
This helmet which is a grouped actor is the issue. I select "NoCollisions" and i can play perfectly fine
A helmet? wtf lol
weird.. if it's a static mesh, open it and check the simple collision on it, or it's size...
whatever works, I think you can select it in your World Outliner as well
Yea they all have normal collisions lol
idk it works with no collision anyway just weird
Thanks for the help though man really appreciate it
🤷♂️
hi guys can someone help me
i want to do a footsteps sound in first person character with bluepint pls help
In regards to UI widgets, I'm using a simple function to display the player's ammo.
But in terms of performance, is this the ideal way of doing it? I found out that this function is actually called with every tick. Is there are better way to make widgets?
yes this is about the least performant way to make UI. you want an event driven UI
Learn how to optimize your UI elements by driving updates through the use of Events.
go to example 3
Thank you. This looks super useful! 👍
hey, can someone help me again? i want to make a mountable dragon but when i mount in he, i cant move, i can do all the other things like mount and dismount, but the dragon does not walk
ramificação = branch
definir = set
alvo = target
malha = mesh
componente da cápsula = capsule component
definir colisão ativada = define activate colision
possuir = posses
obter controlador do jogador = get player controller
and don't know what to do in the anims event graph
wait, he can move, but the animation does not work
and i don't know how to make him fly
Hello i would like to have a loading screen when i transition between my levels. To get to the next level you must collide with a certain Object. Here is the code that i have tried but instead of loading my level it just loads the loading screen.
Actual loading screen can not be made in bp's afaik
Some marketplace assets may help you
Otherwise most you can do is show some static widget
I have a pawnsensing component and I told it to print string "hello" when it sees a pawn. my issue is that is should be seeing me but it isn't printing hello
my vision angle is at 90 degrees and my sight radius is 1000
how do I fix this?
Someone please correct me if im wrong. Does event dispatchers like this, fires off the bound event from playerstate upong widget construction?
@smoky belfry That doesn't fire anything. All that does is when the widget is added to the viewport, construct runs, and binds your UpdateHoleScore event to that event dispatcher in the playerstate. So that any time after that, if the player state calls that event dispatcher, that event in the widget will run.
If you want the event to run at that time too, you have to explicitly call it after binding.
Is this a known bug by any chance? :
I edit a comment box's colour, but then forever can't Play because of this
Happens even after I've closed the whole BP editor
just restart the whole editor, only solution here
loading another level and reload the current might also help but i had best success when that happened to just restart the editor
can i fake a "hold down key press"?
Maybe with a delay and condition
I want to lock my character's camera in the Y axis. I made this BluePrint but when I shift right or left, the camera bugs a little bit, does anyone have a idea to fix that or have another alternative?
Hello everyone, I’m experiencing an odd problem with a blueprint created from a static mesh: tessellation and world displacement didn’t work when I initialized a new dynamic material instance in the construction script (which is saved to a variable which is then set as a material for the mesh), but worked fine if I put it in the begin play event. Is this a known “feature” or would I be doing something wrong?
Thx
@hexed inlet @opaque blade It is a bug. But tagging both of you to save you some headache later. 😄 You can get around it by making sure all of the color menus are closed, and simply saving the current open level.
i try to smoothly rotate my character via blueprint like that:
and it seems like the float value does not change much:
it should happen while sliding:
https://i.gyazo.com/61d54037fefe681f1799a6c11068c2ee.gif
Where is this being called?
inside third person character blueprint (event graph)
Which event?
event tick
Huh. Are you setting rotation explicitly anywhere else? I can't tell, but it seems like your numbers are fighting a little.
They go up and down repeatedly. Seems like something else is resetting the rotation or something.
ah good call i will check as soon as i can (afk for short time)
Thanks, yeah that's all I've found to work, but I'll try that level thing next time
Hey guys, does anyone know why the player doesn't roll the direction he's looking? This is what I've got set up, if I use "Get Control Rotation" or anything like that, then he only rolls the way the camera is facing
Is this the correct way to prevent a Widget from being created over and over? I am unable to Debug because a new widget is being created every time I go to another widget and back.
@worn nebula What does that do at the current moment? Seems like it would make your velocity go crazy high.
It does this https://gyazo.com/dfbe6b275049211b5eb9913f9ae4a9fc
The roll is fine, it's the direction I'm having a lot of issue with
ah of course my mouse direction is defining the rotation too....(third person controller after all ^^), now i need to find where thatis defined!
@worn nebula Some meshes imported from some software have Y as their forward, and you have to rotate them in the actor to make their Y face actor's X. Could be that. You might try changing that to GetActorFowardVector.
I know default mannequin does it. If you add it to an actor, you have to rotate it by -90 degrees to make it look forward because it's default is to the right. So if you relied on the meshcomponent's forward, it would be the actor's left.
The get actor forward vector only goes the way the camera is facing as well. I mean in the blueprint the character is facing the right way and everything, but that is what's happening, if I rely on it he only wants to roll left. Where do I rotate it by -90? as he's already facing the same way as the arrow component
The turning is based on an animation blendspace, right?
@soft peak Remove the interp and put that TEMP directly into the yaw of set location. Does it spaz out when you slide?
so?
Yeah that's right
@soft peak If that spazzes out. You have something else explicitly calling SetActorRotation. Probably InputAxis events. You'll need to probably gate those off if you're in sliding mode.
nope it does a correct rotatatio without any spazzing
the temp val is never used anywhere, but with finterp it spazzes out
@worn nebula What is the blendspace direction based on in the animbp? Veloctity's Yaw direction?
This is the direction being set
like it never reaches 0 (from 100), still spazzin
@soft peak Hmm. What about the other rotation function you have? That I believe is based on the actor's velocity? Is that being called on the same execution line?
no, its like a bug ^^
@worn nebula Given that, I assume you could just use the same function going into that. Instead of breaking the Delta Rotator, convert that to a vector in your timeline and use it as your roll direction.
Actually I think you might do that straight off of velocity?
Does replacing the Mesh's forward vector with velocity work?
Guys, how do I get component an actor is attached to ? I can only see get attach parent actor.
or should I then get the actors root component and get its attach parent ?
Pretty sure you can do that off of the root component's GetAttachParent.
Ok, I'll try that, thx.
oh...okay that makes sense:
oh..okay
Like this? This does it in the right direction but now the roll flies me forward, I tried dividing the lerp but that made me roll on the spot not matter what I put in. Reckon I can multiply get velocity by get forward actor vector?
Well. From the last few screenshots, yes. But he was originally using GetActorRotation.
i sadly need to go right now, but i will be back and let you know if i ever solved that 😄
is there a node that i can use to reorder the children in a box? I want to get the pink box and be able to put it in the front/back through BPs
@worn nebula Do what you had before, here. But normalize Velocity, and use the normalized vector directly in place of GetForwardVector.
Your roll worked, just need to change the direction.
@violet wagon Not certain if there is in most widgets. Most times you'll just store them all in an array, reorder the array, and then add the newly ordered array back to the parent widget.
Sorry you've lost me a little bit, when it comes to normalizing and stuff it proper confuses me. So from get Character movement - get velocity, then normalize that, and replace it in the multiply by float?
oh thats actually a solid workaround. thank you
@worn nebula Yep. GetForwardVector from a rotator will give you a 1.0 length vector that points in a direction from 0.0. Your velocity is the same thing, except that it's length is not clamped to 1.0 because it's length determines speed. Since you're multiplying it, you want the non lengthened version, so you take the velocity and normalize it to a 1.0 length, then multiply it.
hey guys, how can I get the position of a bone from a skeletal mesh with blueprint or python, I didn't find anything online 😕
I can get the skeleton from a selected skeletal mesh asset from the content browser but not the individual bones
in python
Thanks @trim matrix! And @maiden wadi you absolute life saver, I had to change the float multiplier but works great now, thank you!
I have a problem where my screen is really dark compared to my lit view. Also this problem is only for a specific gamemode. when selecting a different gamemode my lighting is fine. Any solutions?
Guys, we have this "Make Visible after load" toggle, but how to make level visible later without this option toggled?
Or how to hide/unhide level?
@trim matrix Sounds like the montage just never ends for some reason. Are there any loop settings in them?
Hi there, have been working on a game the last week or so and have been using a combo of blueprints and c++ (Was unsure which channel to put this in since its kind of both but don't want to spam both channels). I'm using a UClass:UObject for a player object, I have a pointer created in a parent class I've used for my main level. I have ran a construction script - NewObject<T>. However, when i try to access it in my main_level blueprint its giving me an "Accessed none" error when trying to use the variable. I'm sure it's probably a simple fix and i'm just too close to fix it.
@next cliff What is yourUPlayerClass based on?
It was an empty c++ class i used
@next cliff I'm semi surprised that compiles. Despite putting it in a pointer, I'd also try specifying an outer. Garbage collection maybe munched it up?
Hi does anyone have any ideas on how i could make my enemies health bar only show up when the player is looking near them, like in destiny?
And i do that on every tick?
Is there a good way to share functions between actors that don't have a shared parent actor ?
Perfect thanks!
ah, of course
wait, no, correct me if I'm wrong, but within the interface, you can just define the function (name) and then each Actor that implements the interface can use that that call to do something differently. What I meant, if I have a function that grabs some data out of a DataTable that I might want to use in a Widget, an Actor or the GameMode
@trim matrix
I have 1) right now, and am trying to make a more futureproof/easier to edit/less breakable version 😄 For 2) how/where do you define the code for a "process this data" function since I can't seem to do within the interface itself (only define the function name). For 3) is there a 'best practices' here as to where to do that, for ex put all those into the GameMode?
If it's the same data, and the same function, just throw it in a library.
Thank you, do you have any suggestions on where to learn about outers
@maiden wadi I haven't gotten the logic of the library yet, I can't seem to be able to access the functions within it from any BP, just the ones who share a parent?
@maiden wadi welp, I just tested the libraries again aaaand this time it seems to work O.o
In that case @trim matrix , function libraries seem to be exactly what I'm looking for
@next cliff Uncertain. But there's two calls that I at least see for NewObject, one with a long list of arguments and one with just an outer. Try using NewObject<MyObjectType>(this)
aye, that's precisely what I'm looking for, thanks!
I'd kill for a basic HTML/CSS widget for styling right now.
Theres the crash you were talking about, i'll try seeing if i can make an outer
You should just need to specify "this" as the first argument. If this is a valid object and properly created, it should be safe from collection.
Basic line traces and smaller shape traces are cheap. You can probably do a quite a few hundred on tick in bp without noticing anything.
You see, i get an engine crash when doing this now
What is the crash?
oh wait it actually gives me an error
Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/CoreUObject/Private/UObject/UObjectGlobals.cpp] [Line: 3211] NewObject with empty name can't be used to create default subobjects (inside of UObject derived class constructor) as it produces inconsistent object names. Use ObjectInitializer.CreateDefaultSubobject<> instead.
so subobject then?
I feel this is more c++ discussion now oops
@swift pewter Doesn't seem like it. The call only does anything if you change the value. So you could set it true in the same frame 50,000 times and probably not see a frame spike. Might if you alternate it. It does some render state updates. But occasionally changing every few frames likely won't do anything much unless it either has a ton of hierarchy children or you're doing it to a few hundred components.
@next cliff Oh! Wait, where are you using this? OnConstruction, or the actual class constructor?
i believe OnConstruction
Oh. No. Don't do that. See the yellow function at the top? That'll be your class constructor. ctrl+Click that. Your Property should be
UPROPERTY(BlueprintReadOnly, VisibleAnywhere) UPlayerClass* Player = nullptr;
Then in the class constructor function, run this.
Player = CreateDefaultSubobject<UPlayerClass>(TEXT("NameYouWantToSee"));
Worth noting I've never done that with a UObject base before. Only UActorComponent
If that doesn't work, you'll have to have the same UPROPERTY, but override OnConstruction, and do it there. That's the C++ native ConstructionScript. And you can use NewObject there.
@next cliff Side point. Not sure if you have gotten the talk yet. But generally do not compile with the editor open. Always close the editor and compile then reopen the editor. Enable Livecoding to keep yourself from accidentally compiling with the editor open. Otherwise you'll ruin blueprint stuff sometimes.
Thank you, i've mostly just self taught myself so far
Been there, done that, still doing. 😄
Sorry for more questions, would this be since the player object is a nullptr
Fatal error: [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/CoreUObject/Private/UObject/UObjectGlobals.cpp] [Line: 3211] NewObject with empty name can't be used to create default subobjects (inside of UObject derived class constructor) as it produces inconsistent object names. Use ObjectInitializer.CreateDefaultSubobject<> instead.
No, that's crying because you're using NewObject somewhere that it thinks is the constructor most likely.
Is this looking about right?
Hi, im trying to make a skill tree but having trouble assigning to each skill slot the next slots it unlocks, any ideas?
@next cliff In OnConstruction, use NewObject. CreateDefaultSubobject is just for the construction script itself.
Ahhhh
Er. Yeah that. 😄
@drifting socket Make a function in the Skillshot widget. And make an array out of all of your widgets. For EachLoop over the widgets and call that function when the skills update. Let the buttons update themselves based on datatables.
ok i see and what would be a good way to make said datatable
i want to be able to branch off from one skill or converge back
(to a further one)
ok that sounds good
thanks!
how can I set the parent material and textures for a material instance that I created with blueprint?
can you redirect me somewhere to understand if it is possible to run python code inside blueprints?
@trim matrix Print screen me blueprint function creation, if you have a mo, can't find it haha
Execute Python Command
@trim matrix Tah, thanks
Made a Timer that ticks every second but i want it to tick in the background and when it shows at the end of the race (mario kart sort of project) it needs to be frozen but mine only goes up once its visible at the end and keeps going up after the games paused
college project any help is great ^
thanks a lot! couldn't find it somehow..
But first you have to enable the plugin 😄
Do you need a time value, or do you need something to happen every second?
i need it to count in the background but only be visible when a certain widget is open
and stop counting like to show how long it took you to complete the game/course
Setting materials at runtime does work yes
If it doesn't have any effect, make sure the material is actually correctly configured so that it works for the target use (eg. if you change UI material the new material must have the right settings)
and make sure you're setting the right material index
And how do you set a parent material for a material instance that created with blueprint?
And I also want to set the textures after parent selected
For texture you need the thing that's like a texture variable
first it would be great if I can assign the material 😄
Delta Time
nope
no
I tried with 30 fps, the platform moves 2 meters
there a controlld tick from my undrrstanding
60 fps, 4 meters
multiply by delta time
nope
probably not
well actually depends I guess how u have the timeline values set
no
not like that]
but if its a vector
you have to save the start location probably
and add the offset from the timeline to set the location
unless your start/stop location are "hardcoded" in the timeline vector
Lemme explain, I'm making a moving elevator, on 30 fps, it just moves 2 floors
but on 60 it move 4 floors
How to fix that? each single one of u is giving a different answer.
ohhh
Uh its not working
I think I misunderstood you
https://gyazo.com/26285a2457406f78ba8dd8518c78e03b this worked but it was not framerate independent
yeah
xD
ok lemme try
vector track
only Z curve
umm
It doesnt work
I gtg, imma comeback to this problem later
hey folks, I'm having a small issue with my music resetting if there are too many sounds going off at once. When I drop a mine and it kills a large amount of enemies at once, all of their death sounds and explosion sounds cause the music to start over. Is there a fix?
My plane keeps falling through the floor 😦
DefaultSceneRoot (I'm moving the root with addLocalOffset)
- Camera
- Capsule (collision block all)
-
- Static Mesh
@devout dove This is why most objects use a capsule or other shape as their base. Root component is the sweep check for movement related things. This is because of how movement is called. The root component will sweep move and stop at what it first hits, and then tell it's hierarchy children to update. They'll move into their world position based on what their local location should be, and then they'll tell their children to do the same, until the whole actor is moved. It's efficient, but at the cost that the children are not taken into account when moving. So your root needs to be the one with collision.
It works now after making the collision box the new root.
Is it possible to make something not stop when colliding but like slide collision?
for example when a airplane is landing
Not explicitly with easy calls. That's why movement components are used most times, they have functions and whatnot to determine things like sliding. Default calls simply move the object in one of three ways. Normal, Sweep, and Teleport.
Is it even good to use movement component on a airplane? or is it only for walking characters?
CMC isn't the only movement component. There's also the Rotator, Flying, and SplineFollowing.
Floating Pawn Movement
I've added the movement component and then used add movement input
Do i also add rotation to the movement input?
@devout dove Use physics and make it perform like an airplane
Start with making a Frisbee
Then graduate to a wing
I think my question got lost in the above, just popping it back incase anyone knows a fix
I'm having a small issue with my music resetting if there are too many sounds going off at once. When I drop a mine and it kills a large amount of enemies at once, all of their death sounds and explosion sounds cause the music to start over. Is there a fix?
@faint pasture i guess it's not a good idea to use physics for that
hey I was wondering if anyone could possibly help me with something in unreal?
post it, dawg. If someone knows they'll let you know
No
bruh ok
If youre not willing to spend some time writing it but being cheap and asking if someone can help without even asking the question the answer is always NO
jeez man Im sorry Im just terrible at this and after looking online for a few hours I felt like asking someone that is actually experienced
buddy it's all good, just ask about your issue
No it's not good
@whole quarry Should read the page ive linked above
"I felt like asking someone that is actually experienced" So you assume there is no one experienced in this discord server to help you?
I can dig that
basically I have been trying to make an enemy spawn after a set amount are destroyed however after trying out everything I thought up it still doesnt work
@whole quarry Set amount of what?
yh basically
@whole quarry So you want to spawn a group of "monsters" or similar after the player has killed all of them, something like a wave based enemy system?
you'll likely need to setup a "kill counter" type thing
how would I go about doing that?
I'm working on a wave game right now. I will send you a screenshot of how I calculate kills
ok thanks I appreciate it
you should then be able to have you boss or whatever spawn if kills = *
@whole quarry It's very simple, create a counter, on each kill increase it by 1. If it hits a set value use a Branch(if statemen) to spawn something
true
u smort
I was using addLocalOffset to move my airplane but now someone told me to use FloatingPawnMovement and yeah, it seems to make no difference. A video said that it's more complicated than the localOffset node because it also checks replication and prevent people from haxing.
My issue now would be, can I set a new max speed on the movement component? Like item based? So when using a different engine or something it increases the max speed?
you are doing the gamedev course, right?
yh
thought so
so you are trying to have your health pick-up spawn after a certain amount of enemies are killed?
yh I mean that part works but basically right now I am trying to make the big boss enemy spawn after 5 minions are destroyed
or in this case I guess enemy turrets
its just compared to other software I have no understanding of how to do this
You spawn the enemy around you, you have a line trace for example that has a distance of X (lets say 300) then you get your players position and get a random rotation or you spawn them in front of the player where he is looking. Then you add 300 units to the forward vector and spawn the enemy boss at the front of him
I guess you add a enemy killed counter to the game mode that checks if you have reached 10 and if yes then it spawns the boss
you can create a function in your character blueprint called "Increase Kills" or whatever you want.
game state
best game state
I mean how hard is it... the enemy has 0 hp = kill = increase counter by 1
like this
then in your enemy bp, where you kill your enemy cast to your character bp and call the function increase kills.
then when any enemy is killed, it will add 1 to the kills
And use a custom event?
I would not have the character be doing this, do it in GameMode or GameState
I'm pretty sure I know what course he is doing. If he continues on it I believe it covers all of this, including creating the kill counter and displaying it on the HUD
Why would it not be a good idea to use physics to model a physical system (Airplane flight)?
im having a problem with my player controller, when i click play it spawns a new player with controlls. how do i make it so that when i play it controlls an exisiting player rather then spawning a new one
Details of Character / Pawn when placed in the World
last question for the day before I log off and actual PLAY a video game. Question. My wave game - once I get to Wave 13, it spawns a very large quantity of enemies. My enemies have around 7k tris. When a huge quantity of them are spawned, I'm noticing a drop in fps. What's the best way to handle this? Is there even a way?
Set the auto possess value on the placed pawn in the level.
Nvm someone else already told you lol
Does the collision box need to be the root in order to work?
@trim matrix they are rigged and animated, so I guess that's a no on static mesh
wave 13 the fps drop to around 25-30 while looking at the horde
I've never worked with lods before. I guess it's time to learn some more.
oh dang
maybe instead of more...I'll just spawn stronger enemies 😛
@severe geyser profiling the bottlenecks is super important. Theres some workarounds you can use like fancy Niagara mesh particles
oh boy
But in general is you're using basic skeletal meshes on actors executing logic constantly, theyre going to be inherently expensive
Profile everything. One of the most important development habits
@maiden wadi @trim matrix i figured out why "FInterp" did not work eith "SetActorRotation",
because ACTUALLY the rotation is handled by the thirdPersonCharacter->CharacterMovement,
i disabled this (screenshot), and it worked 😄
yes, that was just to debug
just wanted to let you know what that was 😄
I think I know what might be causing the enemies to be more expensive. For some reason I still have enemy attack from event tick
if this wasn't run on tick, and maybe on it's own custom event, would it be less expensive?
The question to ask is, do you need to be checking whether the enemy is currently attacking and is within range every single frame (unless you have the tick rate higher). If the answer to that is yes, then by all means, let it run on tick.
It really shouldn't need to. I think I did that at the start to test and just never went back to make a custom event
but I imagine 50 or 60 enemies running around checking if they are attacking/are in range every tick will cause some performance issues
Depends on the math being run really. Something <= to something else or Checking if a boolean is false aren't massive CPU hogs. Calculating specific angles and doing 20 line traces, and then determining your player is within range based on those values is a different story.
Running a logic check on tick is going to be expensive as more instances are active. Event based would be much better. Sphere collision events for when it overlaps the player pawn are a basic option, for example.
alright. So if I fix this, I should be able to see minimal FPS drop when we have a mega buttload of enemies running around at one time
Not necessarily. It may improve your FPS, but it may not entirely fix your issue.
It won't fix it completely, but a big step in the right direction
It also comes down to howmany actors are ticking. The ticks themselves are not very expensive, but even trivial logic is still going to be wasteful
First step is profiling and seeing if your gamethread is actually what's stalling, or if its the renderthread. It may be that your rendering settings need tweaked with how shadows are rendered, animation complexity, or a dozen other things on the render side. Profile and see then you can have a targeted scope to focus on
Okay. I'll need to learn how to actually profile but I will do that. It must be done
this a good place to start? https://www.youtube.com/watch?v=EbXakIuZPFo
This in-depth presentation from Unreal Indie Dev Days 2019 outlines CPU and GPU-related overheads, identifying bottlenecks, and how to plan optimization strategies and pipelines early and as a team. Learn the tools and how to employ them to identify key performance problems as well as engine features that can help you improve performance in your...
I need some help.
How do I print on the screen to count the coins I get in large colored numbers? (with some font for example)
Can you dm me for some help please?
Ok thank you no problem
oh yeah true.. I will
I have a weird issue I need to fix.
I set my struct to have a MatineeCameraShake
I created a DataTable expecting to see the camera shake option in it. No dice. What gives?
In the struct
It should be below Voice but it's not there
Change it to a class reference instead of an object reference?
Ayeeeee
lol most camera shakes ask for the class instead of the object so that checks out. Thanks @dawn gazelle
5 black magics at least
I mean, multiple inputs to a target pin just call the function however many times it's hooked up
it's pretty simple
Yep
Is it possible to make a function like this that is agnostic to the type of array that I feed it? If so, how?
You can do so only in macros, not functions.
@dawn gazelle How would I do something like what I tried above since I can't have local variables in a macro?
Open a new macro. Right click in the graph and type Local Integer.
It's also worth noting that if you know any C++, this can be placed in a Library very easily with a wildcard Array.
Trying to do that in BPs right now
Learned that quickly when I got tired of doing Array->GetLength-> Is>0?
Array->IsNotEmpty() is much easier in blueprint and takes up less space. 🤷♂️
Aye!
I need some help.
How do I print on the screen to count the coins I get in large colored numbers? (with some font for example)
There's four ways to add text to screen. Two are debug. That's Print String, and DrawDebugString. The other two are not debug mode, which is telling your AHUD class to DrawText in it's ReceiveDraw function, or creating a widget to hold it.
The last of which I believe is the only way to do specific font.
@maiden wadi So I set up a macro library with the macro as above, but I can't find the macro by name in my function library. What am I missing?
I don't believe you can use macro library macros in a Function Library.
Not really sure how Epic's macros get around that, like Loops.
:triangular_flag_on_post: KostadinosKy#4518 received strike 1. As a result, they were muted for 10 minutes.
Would it be possible to take orthographic camera and set controls to wasd move it one viewport pixel at a time?
@merry yew I haven't used the orthographic camera much, but wouldn't moving the camera itself one unit move it by that much?
@maiden wadi well, no, it moves it one unit in the world, which might be however much it happens to be in the viewport
If I have this on the screen, and move one unit to either direction, the pixel content on the screen should remain identical but just one pixel in either direction
Instead, there's some type of interpolation in the rendering. It's easy to see e.g. in the aliased borders of objects
Hey all, I'm working on sort of a death animation when my pawn dies. I'm setting the collision response to the Pawn channel to overlap, but I think its still blocking the navigation of other pawns. Is there anything I can do?
how do i get the current move direction? 
i wanna make a dash
and the player should dash in whatever direction they're moving right now
@onyx token try getforwardvector
player isn't rotating tho
the player rotation is always locked to the camera
(that way you can fight & run around)
so forward vector just does this
https://streamable.com/omf834
altho i could maybe scuff it by adding an invisible object and rotating that one instead of the player? 
that feels wrong tho
Does anyone know why I (the character) can fire an event in another actor on the server, but not on the client? It just doesn't fires when doing it on the client. Everything has replication on btw.
oh! nvm - figured it out. "GetComponentVelocity" did the trick 👍
Can you be descriptive? Only the owner of the RPC is able to call the RPC
So I have a Player Character. When I click the Fire Button, it should fire the shoot event in the Equipped Weapon. And this works only on the server. The client does nothing.
so your input is happening on the client
so where it says "Replicated to owning client (if server)"?
you're calling it on the client, not the server
I tried to call it on the server too, nothing works tho
The problem is only on the client btw
show code
The screenshots are the part of the code which dont work. The first one is the weapon and the second one is the character
Ok are you going to change what I suggested?
ok show the code
do you have any idea how can I do this: I want to make a multiplayer arena map with zone triggers. The number of deaths would trigger lights, making them shift hue or intensity. So for ex: a white light on some volume would become increasingly red-ish the more frags happen there.
store the number of kills and use the FLinearColor lerp
yall im sorta new to this and the documentation on SaveGame is sorta confusing (or im probably overthinking it)
im tryna save variables for a mobile app im making and I want to load it with every startup
if anyone have any idea/example ss that would be helpful
sorry if its a dumb noob question lmao
which part of the code?
Ok are you going to change what I suggested?
I would assume the thing you changed...
He needs to see what isn't working
You create a SaveGame object and add variables to represent the data you want to save. Then you use SaveGameToSlot node to save and LoadGameFromSlot to load it when you need
Overview of how to save and load your game
ok so that will make it shoot on the server, you likely need a NetMulticast to call it on all the clients
Alright. I just changed it and it still doesn't work :/
Is there any option I'm missing?
you're incredibly "un-helpable"
you can't just say "I tried it and it doesn't work" without showing what code you tried that didn't work
Multicasted and it still isnt working
Alright, thanks
Btw I just wanted to mention one more thing. The exact same code works in another project, I just tested it and it works on both client and server. Why isnt it working on this specific project then?
I was just overthinking it lmao, my bad, thank you
So this guy here https://answers.unrealengine.com/questions/376952/run-on-server-event-doesnt-fire-for-client.html has the same problem but its outdated. Do you know what he meant?
look at the answer, it's exactly what I told you earlier
well not exactly, he's a little off. The object owner has to be the one calling the RPC
from the link I sent you
But he said something about the controller...could I have mistakenly changed something?
switch the RPC to RoS and tell me if it executes on the server
Replicated to All aka Multicast doubt works if not Run on Server beforehand, lol
it doesn't
Yeah, in that case it surely doesn't
uhm I found the mistake and I'm feeling dumb as f. The 'Set Owner' node was disabled for debugging and I forgot to switch it back on. Sorry for the inconvinience :/
nice
when ever I open a level for the second time I cant do anything in it
I've loaded in a png as an alpha for a widget and the image quality round thr edge is terrible its s big enough image and looks fine but when in game it'd very bad, anyone know why?
Hello guys, i came across a weird issue. I am having 2 separate levels on my game, after i created the second one i went back to the other one and my player character no longer generates overlap events. Any idea what that might be? Sorry its so vague
Oh its because i am dumb, i forgot i made a new collision channel and by default it was set to ignore. Sorry :p
@royal kraken Need more specifics about how you're using it.
It's in a blueprine widget to change colours of an object when clicked. I am using a png, it could jpg also as an alpha to cut out images within the widget.
I'll get some screen grabs together
Two major notes.
If you're using any textures in UI directly, make sure to mark them as UI in their settings. There should be a LevelOfDetail setting in the texture itself and a TextureGroup setting there. Make sure that's set to UI. It'll disable streaming and not generate mips.
Most times if you're using a separate alpha mask texture for UI stuff, you'll need to set your stuff up in a material.
do children inherit a parent's interface event implementation? i have this parent actor which offsets itself to the left on tick, but all its children are not firing the event
OK cheers, is there another way to do it as I've tried changing those settings and no luck
i want to send a signal to all moving actors(Tag) to start moving left essentially. assumed interfaces were the best for this scenario
@royal kraken Do you have just a single image with color and alpha, or are you using a material with a separate color and separate alpha texture?
All actors with Tag still grabs all actors in the scene and then checks each one of them to see if they have the appropriate tag. This can be considerably slow if you have thousands or even hundreds of things in your scene.
Probably better to have any actors that need to do this move bind to an event dispatcher that passes through the tag you're looking to interact with within some kind of control actor in the level - then you just tell the control actor to do an event and all the actors can respond to it and check if they have the tag that is provided through the event dispatcher.
It's a umg material with an alpha (I'm new to this, I'm sure it's called a umg material)
A material is just a material. There are materials that have settings set for being used in UI specifically though.
i plan on hiding and resetting an actors location once it reaches offscreen, that way i will never have too many actors in the level. my main concern is still that implemented events from an interface do not get passed down to children
Sure they do. If your parent implements an event and you don't override it in the child, the child will still execute the BPI call. If you override it, then you can still make a call to the parent version as well if you need to.
Parent:
Child:
Output:
i still dun understand what does this node do
Are blueprints better or c++ to develop game
Better to prototype
But neither are better in that sense, BPs is still C++
Both have their uses, C++ runs a tad better and has more access to things, you can do everything, in BPs you may find limitations
But BP is faster to build on since you know, it's visual coding
best to use a combination of the two, its not one or the other
Rotator A - Rotator B then Normalized. Basically you can get the difference in angle between two rotations, between -180 and +180. If you compared two actor yaw rotations if they are both facing exactly the same way, the value would be 0.
If facing the opposite direction depending on which side you're closer to, it'll be - or + 180. It's next to impossible to get 180 exactly.
Basically I wanted my widget to have circle selections to change the textures of an object, do you know the best way to make a interface like this
Sounds like a Radial Menu
@twilit heath ya it's best to use both
tq
Hello, I have a VERY WEIRD bug when setting a value in a struct. Basically, my unit receive a hit which set its current life to N, then it calls the CheckDeath method to check if its life is <= 0, and if yes then it is destroyed.
Problem is, the value in the struct is updated AFTER I do this check, but I set it BEFORE in my call chain, which means that the first killing strike won't actually kill the unit. But the value is still set correctly and the second strike after will kill the unit:
You can see the logs top left. Anyone has an idea WTF is going on ?
https://streamable.com/va12kn Hello, I am currently fixing up some of the character blueprint and would like the player to rotate towards the forward of the camera, but I dont want it to be fixed to the camera if you know what I mean. Kind of like gta5 where you can rotate the camera around and the player will just rotate towards the camera forward if they are holding W.
Get the difference between camera rotation, and Pawn rotation. On W, turn the pawn toward the camera by a fixed amount
is there an event with finish event when success reach to location?
Is there a good way to do a ForEach loop with a delay as part of the loop? Seems to just get ignored...
@latent junco Yes, https://www.youtube.com/watch?v=zh8xx9abzZY
#ue4 #beginner #blueprint #foreachloop #delay
Byte Sized Tutorials! How to create a custom "For Each Loop" with built in delay!
thank you kindly 🙂
Not with a simple move, but you can use the more complex one and add the finish method out of onMovementFinish
i'm moving my character, not Ai
yes obvious i can make my own method, but is there pre made?
While (character location not at target location) move to location, when out finish the task ?
Changing the speed of audio intrinsically changes the pitch. High frequency sounds slowed down will become lower frequency thus becoming lower pitched. I can't find anything within UE4 myself that looks like you can alter playback speed specifically while maintaining the pitch.
You will probably need some sort of plug-in similar to what's done in audio production
Hi, I'm currently making a mini-map showing where the player is supposed to go. It does follow the player but it does not rotate with the player. So it basically just moves back forth and stuff and I don't know how to fix that. I'm also struggling on how to make the arrow to indicate the player is at to show on the mini-map aswell. I’m currently using a static mesh component for the arrow icon. I'm hoping someone can help me fix this!
Do it all in one material. Use a rotation node to rotate the minimap under the player
What's the source data for the minimap, a texture or a render target?
I used a render target and connected it with a scene capture component
so basically i want the minimap to show the direction where the player is facing, it currently looks like this
Make a material that uses that render Target and adds the additional stuff like The arrow etc
Hello, I have a VERY WEIRD bug when setting a value in a struct. Basically, my unit receive a hit which set its current life to N, then it calls the CheckDeath method to check if its life is <= 0, and if yes then it is destroyed.
Problem is, the value in the struct is updated AFTER I do this check, but I set it BEFORE in my call chain, which means that the first killing strike won't actually kill the unit. But the value is still set correctly and the second strike after will kill the unit:
Are you storing any special data between different item types? Like item durability on some items, maybe item expirations?
Why not just use Interfaces ?
Yes. Like, not all types of items may have durability... etc.
and do you need to store them? like, durability you would need to store.
Friends, help me out with some advice.
I need to make the enemy shoot my character only when he stands in front of him.
I was able to get the enemy to turn in the same direction as the character, but I can't figure out how to make the shot be made exactly when they are facing each other.
Thank you!
Btw I don't want to be a dick, but it took me 2s of googling
Heyya beautiful people, anyone knows if it's possible to delete/hide polygons in runtime? Specifically with event hit or event overlap, or something along these lines
Theres the "Delete Polygons" function but seems to not be for runtime, any insight is much appreciated
Does anyone know if it is possible to get the value that they look at each other in this case?
ummm https://gyazo.com/a11f83cb4d51447a941e2a2f35d6d15d Do Once doin it all the time
So, if that is the case and you want to do it relatively painlessly, without having to create tons of structures.... is to use one main "slot" structure:
item class reference
quantity
<any other data that needs to be saved that is common between all items>
an array of bytes OR a formatted string
What you do, is have encode and decode functions that will convert your item's data into an array of bytes or a string format - this should probably be done on the parent class (so armor, weapon, tool, etc.) This way, you can get the item's class reference and determine which functions to use to encode or decode the extra data.
The string way would be to have a specified format.... So like, you could store it something like:
durability|tokenupgrade1|tokenupgrade2 which would actually look like:
73|1|2
And use the "Parse Into Array" node to break it apart, and then get and set the values where needed when loading.
Doing it with bytes is a bit more complicated, but computationally would be faster as you're dealing directly with numbers/bytes rather than having to use string functions.
Interesting read. I haven't worked with this system yet. Previously I just saved the data in an array of structs. This method has advantages though I assume.
So I would have one main struct with data that needs to be saved. Then another struct for each class with the remaining data that doesn't need to be saved
Data that doesn't need to be saved should be contained within your item BP.
Ah with variables, okay
When you have the class reference you can get the class default object from it, so any values that the item has by default.
The array of bytes mentioned in the second paragraph, should that be saved in the SaveGameObject?
Anyone has an idea on this ? I'm stuck
And then on (e.g) player respawn, I would get that array of bytes and run the decode function in the parent class
Yep
Might be better to put it into a function library if the item isn't spawned as an object.
Gotcha. Thanks for the explanation! I'll have to look into it, maybe watch a few videos as I haven't done this before
@trim matrix What is your life's default value?
100
And these prints are after several hits, or one?
after several hits, I only kept the very lasts showing the issue
Also the SetUnitStats after the SetMembersInUnitStructure is not needed. The SetMembers sets the value directly.
that's the goal ? I want both print to say the same thing, since one is the value I use to set, and the other the value in the struct, supposedly after being set. Or I'm misunderstanding something
Yeah that was a fix attempt
Just move your print before the damage application.
Ah that is right, thank you. So if I get it right, I cannot reuse a node in multiple "action" nodes, everything behind is re-executed if I do ? Thank you for the answer 🙂
Ok so next time, promote to local variable
Or will the local variable also be updated ?
Storing ints and floats as bytes is fairly straight forward as you just convert them to bytes and then you just merge the arrays together as you convert them.
The difficult part is getting the values out from the full array. There's some free plugins out there (Low Entry Extended Standard Library for one) that give some extra functionality for handling byte arrays which would make it trivial as it gives you some nodes that convert byte arrays to the appropriate variable type and you can just specify an index and the length (always 4 for floats and ints)
okok, thanks for the explanation 🙂
Anything numeric? Go for it. Vectors, Rotations, transforms - these are all just glorified float containers - so long as you write and read them back at specific indices, then you'll get the data back out.
Enumerators are effectively bytes to begin with, so they can be added to the array directly.
Booleans are basically one bit, again the low entry library has a nice thing you can use to store up to 8 booleans in one byte:
Is there a method to get the Unit a HUD is attached to ? I'd like to bind the value directly to my unit's health without having to update it manually.
Storing and retrieving a string is possible too with the low entry library, but gets a bit more complicated - you need the length of bytes to do it, so you store that first knowing that is a string length value, so then your next step is to read the subsequent X bytes to retrieve your string, and any subsequent reads would have to start from "starting string index" + string length.
Example:
Output:
Yea I feel like what I've seen and read so far, bytes would be my preferred option
Hi, how would i go about setting the anchor of a widget from blueprint?
To be more precise im trying to make it centered
the slot variable has those methods
Ok i think i found it but what would i plug into in anchors, i would like to have the center anchor
idk hover the pin and create the struct or spit it
ok thanks!
I have a problem with rotation and speed. I want the crocodile to rotate while he is moving in the same direction as the rotation and NOT rotate while he is moving. Here is how i want it. Green line is the way i want him to go
I think I have an idea of how to fix it! But i haven't tested it yet tho
yea thats what im thinking, but i cant really find a way to do it. I tried add movement input but i dont know how to make it work
right now its like this, just added the croc in the game to see how it would look
only that atm, i will add ai bt later but this is just for testing
mhm
well i want to udnerstand how its rotating and moving. If understand the math behind this block i can reacreate it to only rotate
then i can add something like "move forward"
ok ill take a look
how do i open a codeblock
I need some help, where I can plug a dynamic material here?
Here?
Yeah but where do I have to plug it to work?
If u want to change ur material of « mesh » just put ur dynamic material here
Oh ok thank you guys
I just plug to "set relative 3d" and its works?
Depending if u want to set ur mat after relative 3D or set timer by event
Hey! I have a Perforce problem if any of you might know!
I locked a file on a PC. The PC died (harddrive went boom) and now I have a new PC. The file is still locked.
Is there a way for the "server" to override a locked file? Or similar? Can't keep working on my BP's :(
No idea
@faint pasture Thank you <3 I think my language when searching for it was inaccurate so I got bad results
When I call something to spawn.
I don't want it to just spawn οut of the blue.
How could you believe it to make a smoother spawn?
Do you want your spawn object spawn with a smooth animation?
Yes sir or or some opacity that slowly rises like 0% - 10% - 20%...
You are going to have to make that mechanic yourself. Spawning just pops the thing out of thin air.
So you're going to have to do something on begin play
U can Set dynamic mat if you want to change the opacity of the spawn objet
Can I have an blueprint example of this sir?
yea
I tried it, but as soon as they fall to the ground they are not stable then sir.
Then Their collision don't work for some reason.
Thank you sir
What do you mean by not stable, are you simulating physics? I start with figuring out that before dealing with stuff like transparency on spawn
There is no documentation about what this does
Can someone briefly explain what it is about ?
Not sure what it does specifically but it looks like it calls some internal update function, which updates some of the data on the spline
is there a way to create levels in blueprints so that if you press a button it will create a level called level 1 and you will spawn in it
Not entirely sure why it's an optional update because it seems like it might go out of date without it
yea weird..
Looking at the C++ behind it, it's iterating over the spline. If you were wanting to add multiple points using this node several times, you may want to wait until you've added all the points you are going to and then finally update the spline.
Oh I guess that make sense
Yeah that's what it looked like, but why would you use it to set multiple points in multiple calls instead of just generating the points and then calling it?
Yeah exactly I use "simulating physics" I want as soon as they fall to the ground to remain stable and these thorns to kill the character, but as soon as they fall to the ground then I can push them and damage collision doesn't work.
Thank you very much sir
That's a function of your characters CMC physics interaction settings. If you want them to NEVER move again after settling then disable physics on sleep.
And u can create an Opacity Parameter in ur Mat for fade him in the BP after
Yeah of course thank you sir
Oh really, I will try it sir
You would show me where are these settings becouse I can't find it sir
Just dig around in the character movement component, they're somewhere in there
not in the object?
The CMC on your character will have settings for interacting with physics objects.
Like how much force it imparts when trying to walk into something etc
Okay I unterstand I think
Where I could find CMC settings in my character I'm not sure...
Any idea why this doesnt work?
Small question about the Camera Lag function, is it just good to use as a visual effect or can it be used as a part of movement? I mean is it using much processing power and prone to bugs/errors because I'm actually able to do this myself.
Well what's not working about it?
if i wanna save something is it better to cast to it or get actor of class?
This is the error message
Then you haven't set that reference to anything
It all depends on what you're trying to do. And what kind of reference you're trying to save.
i have a question: is core good for learning ue4
What is core
If you wanna learn UE4 just start learning UE4, there's plenty of example content you can refer to
fuckk idk
You're not gonna learn it through Core
so hard
?
is there a type of game i can start making that will teach me the all round basics?
Well, to make a game in the first place you need to know the basics, so seems paradoxical
Follow some tutorials around in case so you get a hang
Learning the Engine
Can someone help please?
Where could plug this?
Depends
BeginPlay most likely
Construct if you want it in Editor view too
i just wanted to save some variables of my char and the location, but when it wont load the location if i load the game in the menu level, how can i load a new level and then the location and variables? if i set open level before i load the variables it only opens the new level
Open Level resets all values
You would need to read and use the SaveGame values after opening
would it be a waste to make every light map in my level 1024 instead of the default 64
I mean, try it, if there's not any noticeable difference then it's not worth
would something like this destroy performance? I have an issue of thin walls from my blender my map so I get bad random shadows
Lightmap is mostly gonna influence how much space it takes in Memory and how long it takes to build
does anyone know how can i disable a keybind, for example the F keybind
Easiest way probably have a bool toggle it and check if it's true/false before handling the key event
thanks
Level blueprint: I have a reference to an actor in the level. How do I make another one?
Figured it out
- Select the actor in the World Outliner
- Switch to the Level Blueprint and right-click empty space
- Since the actor is selected back in the World Outliner, you'll see a Create Reference to... option. Clicky.
I have a material and I want it for an obstacle for 10 sec with "BigEvent timer" only, after that I want return in normal material
any idea? The problem is that "BigEvent" there is in first person character and material is other class
So it's like a powerup on the character? So during the powerup, you want to change the material on the player?
Exactly! but I don't want to change the character I just want to change the objects that can pass without killing.
you want to change the material or change the collision settings?
material
on which object
where is the BigEvent logic? which object?
BigEvent logic?
You should handle the logic in the respective classes
only handle player stuff in FirstPersonCharacter
only handle energy drink stuff in that class
So what can i have to do
so like you're setting the mesh scale of the player in the energy drink
set it in the player class
You're also drestroying the actor you said you want to change the material on
can you make me a sample of that please?
no, sorry
Ok thank you
just use the lightmap density visualization and make sure your pixels seem small enough
I was thinking, adding option to hide unused "nodes" in BP modules will be useful? for example:
use Ctrl + M, O to collapse / expend (like in VS)
any way to add collision to hierarchical instanced static meshes?
why the heck when i build my game it shows that a timeline is fucked up.... the timeline does not exist since 1925
what was the node called to get different results based on a float or integer value range?
RandRange?
Does SwapWeapon do anything to that ref? That BP is pretty unreadable, just put a get node under each node that uses it instead of spaghetting all over the place
First sniff it smells like references might be getting shuffled around on SwapWeapon. I usually prefer to have weapons know nothing about their owner, that is, flow the references in one direction.
that looks pretty bad
and really hardcoded also
like why do you really care what the WeaponType is?
why do you switch lots of bools around
You know that is actually a good question... I am going to refactor this. So I withdraw my question lol
Hey @faint pasture I refactored my code and it works perfectly. Thank you for trying to help me
is there a way to mass/batch/bulk replicate varaibles?
I tried adding a delay and even a retriggerable delay but neither seem to work
Any obvious reason why this doesn't work the way I expect? Thank you in advance
Anyone ever make a sims style wall actor where you can build walls
trying to theory craft one but not sure where to start
why doesn't this switch my default pawn class
Have you tried adding the "Please" node before the setter? Manners is important.
How do you know it doesn't switch your default pawn class? Maybe switching the default doesn't switch the pawn you're controlling?
Yeah, I realized that after some time. I used this approach I found on google and it worked
Hey everyone.
Im trying to get this code to check if my BP_Enemy is overlapping an actor with a collision box so I can retrieve information from the actor, but I can't get the "is overlapping actor" to recognise my AI overlapping it.
Anyone got any clues when Im doing wrong?
The blueprint is the BP_Enemy and the setting is for the box collision within the actor placed on the level
put a delay before it
Before which one?
after beginplay put a delay
That did it, thank you so much!
Can you explain why that was needed?
I'm not sure why but it doesn't recognize that the box is overlapping on beginplay, but putting a delay after it fixes it. I've had this sort of problem before aswell
Thanks for the help 🙂
I have a stamina system set up, so when u sprint and jump it consumes stamina, but when i SPRINT JUMP, itll regen after the jump even tho im still sprinting
@rancid zephyr What event are you running this on?