#blueprint
402296 messages · Page 954 of 403
repetitive code calls for function/macro
@gentle urchin so this (in menu pawn) takes my StartGame function from said pawn and binds it to the click event of the button within the widget
Correct
and I don't need to make my own dispatcher
Correct x2
brilliant
or right click on the variable and chose convert to validation...
I was mainly unsure about the Create Event, but I presume it lets you convert an existing function into an event thing that can be messed with using the delegate pin
honestly there is so little useful information on delegates
at least for beginners
ok thanks i try
You also gotta make sure that the event signature matches the dispatcher
how so
So if you added something like a float to the dispatcher, you'd also need the float in the function for it to show up on the list of events
yes
or else the function gets given arguments it didn't ask for
👍
You can create the event (and signature) directly in the event graph aswell if you like ofc,
which varible
i find that messy after a while, and the red wires going criss cross haunts my OCD to this day
yeah but using functions gives me the happy chemical
Interfaces are nothing more than the ability to call the same function in multiple classes. You can have the same identical thing with inheriting functions. So in a code base where you can insert that function low enough, interfaces are pointless. In a code base like Unreal, where we have stuff like InventoryItems as UObjects, and then InventoryItems as actors, and light switches as actors, etc that all require the same "Interact" or "Use" function, we have to create an interface and implement it into those hierarchies to use it. Meanwhile imagine being able to just open up UObject's file and add the function you want, then any Actor, or UObject base could just implement it.
one that may turn out to be empty or not valid under some circumstances
so technically, I can use the Set Timer by Event with the Create Event
and I don't have to mess around with strings
yepp
i dont have variable
s
noice
use is valid macro then. its similar
@fiery swallowTo also put this into perspective. I've been working professionally for over a year now. I've touched one single interface at work, we have a little thing in the bottom right of the screen that spawns widgets that display timers and stuff. Most of these are UObject base, but a couple of them are from UActorComponent. We use some other interfaces in Gameplay code, but I've never once had to use them.
what is the best way to make a random object to be part of a chunk, so for example whenever I hide that chunk in game, the random object will hide with it.
I see so its not necessarily a bad thing, it's just more steps involved to do what you want? I have learned the most efficient way to do things in UE is by using parents. But I thought that was just programming in general. Or maybe I just am not at the level to be able to fully understand the problem
Bound to the chunks dispatcher *
right and how can I use it
Didnt we just have this conversation 4 comments ago 😛
I dont think we did
look up in chat
we others did 😛
uh
squiz and I did
sec
thanks
here
i tested it with a valid macro but it is still like that
but i have is valid
I gotta actor move to loction or action function in a interface that is called when the actor is selected and another condition is met.
This executes but I have another exe I want to happen after the actor is arrived a the location rather than exe it straight away is there any way to do this other than the delay?
Get all actors of class is very expensive node, especially if using in a cycle
it doesn't matter, it goes through absolutely all the actors in the world until it finds the right one
but its still fails
Target is the target class. Your component inherits from scene component where this function was specified.
oh okey
Hello, i have a nametag widget attached to my character and i am using screen space. Is there any way to control the size of the widget when using screenspace? It gets too big when players are far away from each other. I tried adding a size box but it seems to have no effect
Custom code for handling it
Scale by distance
perhaps it could be done in the material
I made a userwidget and widgetcomponent class combo a while ago, I should add that functionality to it. I originally made it to offset widgets to better point at objects in screenspace. Like widgets hovering over something with an arrow, default implementations don't always point correctly, it requires some slight offset math in the widget. The userwidget was a base class that other widgets could inherit from. The component would pass itself to the widget when spawning the widget too, which meant there was no random requirement to set state from the actor that the component was in. Made it very easy to create nice widgets that could access their actor and have zero references to the widget from the actor itself by doing nothing but dropping the component on and setting a widget class.
i think i'm bad @ googling but is there a built-in way to do exec pin a, exec pin b -> bool?
Are you looking for an exec input pin to toggle a boolean?
@ivory light It's hard to suggest anything without a use case
if the graph was inside a function that had a boolean output, you could have two return nodes e.g. with differently set bools
If it's in an event graph, I guess you can set a boolean variable?
but it's an abstract question either way
i have two events that both call a function with a single bool arg, event a calls the function and passes true, b calls it but passes false. it's obviously not mission critical but made me wonder if ue had a way to do this lol @tight schooner
does anyone know how to make the control points of a InterpToMovementComponent visible? Like in this tutorial, only one that I found showing the feature, but neither my testing in various engine versions nor with other tutorials I was able to confirm its existence.
https://youtu.be/TNkX3DdwhQw?t=199
you want Show 3d widget checked in your vector variable
so i could move my artylly up and down with s and w
and i made this https://www.youtube.com/watch?v=TAnzmz2AviY
i can move up and down intil i press f and shoot i can only shoot after i have press f i can not controll the up and down anymore
Hey guys, in today's video I'm going to be showing you how to create a system where the player can see a predicted path for the trajectory of the grenade that they are throwing.
You may want to experiment with the final delay values for spawning and deleting the trajectory line. Lower-end PCs may need it to be slower as it could cause lag. You'...
Thank you!
anyone know how i can have root motion actually move my character?
Whenever i play a rootmotion animation, the player mesh only moves, the capsule collision stays in its original spot
by default root motion animations only move the character in montages, if you want to change that you'll have to set this in the animation bp
also #animation is a better place to get help for this
Im animating my soldiers in several places in my event graph. For this im now using a Timeline called Global_Lerp.
However, im having trouble going back to where the Global_Lerp was called from, after the timeline is finished.
Instead what is happening is, the Lerp happens and the rest of the nodes run at the same time.
So how can i only resume the nodes after the lerp is finished?
See this rotate to front node calls a timeline that lerps my units. But it doesnt wait, it goes straight to the Get Actor of Class
Why are you back to the timeline approach?
i was never out of it 🙂
I considered the set timer. but timeline was better you said 🙂
tick as you suggested would be great if moving 40.000 units
im moving the units inside my squads only sporadically
when reforming
attacking
its not at every tick. its hard to describe this
queue of actions
cant find anything
this is how i solved this in the past
it doesnt look like something a pro would do
it would need a new switch for every place i could potentially call the global lerp from
and an event to follow up
inventory system has to be the biggest headache ive delt with
if inventory system gives u headache already ure in for a world of hurt lol
IDK man I've been telling you to make this continuous on tick for like a week now.
I am trying to detect whether the Android device the game is running on is a touchscreen device like a phone or tablet, or controlled by a gamepad or remote control like the Fire Stick
However, GetPlatformName only returns "Android" without being more specific.
is it worth moving that stuff to the player controller?
What does your menu pawn do?
at the moment it creates the widgets and has functions bound to the widget buttons
So you're spawning it in the world to get your menu to display?
So unless your menu is being represented in the world, I'd recommend you move it over to your player controller.
If your menu uses the viewport, like slate and UMG do, then the menu exists in the viewport and not in the world. Therefore it is better to not make it dependent on a thing that might not exist off and on during gameplay (pawn) instead of something that usually exists regardless of whether it is possessing a pawn (playercontroller)
perfect answer, thanks
This still makes sense even if your are using a menu.that exists in the world like a widget component on an actor.
I may end up making a diegetic (?) menu which presumably would require a menu pawn to contain the camera
Because your pawn could die while the controller is still alive (but maybe you want a menu that loses contact when the pawn dies...?)
this is just a main menu
Ok.
the player pawn shouldn't die ever since it's a turn-based game
Why do you need your pawn to exist at all
What events are bound to it in the menu?
I was following a tutorial
Hence my name
and I'm trying to de-tutorialise it
originally the widgets were created in the level blueprint
thinking about it, if I put the main menu logic in the player controller then it sticks around for the entire game, is that a bad thing?
I don't seem to be able to switch player controllers and I don't know if I should want to
Try to put as much menu logic into the menus themselves. Make classes handle their own stuff without having to know how other classes work.
Event delegates are a good way to say " if anything out there needs to know when I do something, then just listen for me to call this delegate. I dont care who or what you are, you will get the signal if you are listening for it."
Personally speaking. UI should absolutely never be referenced by any actors or gameplay classes what-so-ever except for the HUD.
I always stick it on the controller
Hud class I almost never touch
"They have latency (aka will finish before continuing)"
Here its not working. It is not finishing.
@tawdry surge This is my macro. Its setting up a rotation to my instances. Then starts a Timeline. I need it to only go to the output after the timeline is done.
Hi! I appear to be having an issue when dragging and dropping an inventory item over another item, it completely overlaps it and I guess deletes the already existing item, is there a way that I can get rid of this issue? below is my On Drop and Slot Swap functions.
Thanks!
And it doesn't finish? @cyan bone
I mean it finishes before the timeline finishes. Which means the Timeline animation will be overlapped by the next nodes after the macro
for context
can you even put timelines into a macro?
new macro 0 is calling a timeline inside it with Play from Start
but its working 🙂
i mean its not working because it has the issue
but u said its not finishing
i mean its finishing before the timeline.
im trying to make the timeline finish and only then move on to the next node
yeah because the timeline finishes instantly
It's called architecture. Rejecting architecture, more specifically. Everything goes in 1 BP, makes it easier to keep track of it all.
Hey Guys
hey
How could go about making a block placement System like Minecraft
1 Make a block.
2 Make the code to output a position from your pawns position and look direction etc etc. You probably want a sphere trace.
3 Put a block there.
Input -> Sphere trace in aim direction -> Round the hit location to your grid -> spawn actor there.
What is the ideal approach in fixing situation where characters are loaded before level is? Because currently they will just fall through the floor that isn't there yet.
World Composition?
using the gamemode
Aren't world composition better fit for large maps or I it's good to use them even in small scale maps?
What happens when you start up your Unreal Engine game? This video is a guided tour of the Engine's initialization process: along the way, we'll glimpse the high-level structure of the Engine (modules, game instances, local players, and viewports) and we'll see how all the different parts of the Game Framework (game modes, game states, player co...
Well currently the whole game begins with GameMode OnBeginPlay event, but that makes the server fall through the floor meanwhile clients are fine
World Composition is for larger scale maps. I'm asking that because there is a fix for WorldComp loading late, but I don't know about manual level streaming.
oh i see
in bp I have a single enemy, and I want to have it so the player can provide their own models and stuff, so that when that enemy is spawned, using random chance it will replace the mesh/materials with the chosen one, but how would I go about having the models it pulls from be dynamic?
say they have them in a specific folder structure I provide in a specific location for example
wouldn’t you just have an array of possible options and randomly get one from that
in what sense?
how would I have the possible options be automatically updated when they place a new mesh for example is my problem
idrk what you’re using this for but you can add to arrays if needed
by making a grid and having it snap to that grid
so i want to make it when the player walks then this knife model i have in the BP_FirstPersonCharacter kind of moves around a little bit because it feels a bit to static and i was thinking maybe i can do this in blueprint but i don't know how i would implement it
thats a really good question, i want to do something similar for my wisps
poor wording on my part, when I said place mesh, I meant, add a cooked mesh pak to their game install
ohh i confused u with that minecraft dude then sorry for the ping
nw
basically u just need to keep an array of models in your gamemode or something
and when a new model is loaded you add it to that array
how do I set the array of models to correspond to a folders contents?
so if it has 3 or 4 meshes it still adds them to the array
good question, someone mentioned a plugin
so probably need c++ then ig
yeah there’s uh damn I can’t remember the name but a built in plugin for file tools
I needed it to get save files from a folder without using a specific name
ahh I think I can just set naming conventions and use match wildcard string with get actors of class to get what I want roundaboutly unless I am mistaken
I was lmao
Is there an input method to detect mobile device orientation or shaking?
who's gonna tell them 💀
This is embarassing but i cannot for the life of me figure out how to make a gun actor that my character can hold. I cant figure out how to create such an actor, and then put it in my characters "hands", (not with animations or snapping to a hand mesh i just want it to float)
Anyone got a guide to that kind of thing?
If anyone recognizes me from other recent questions, this isnt about what i was trying to make then, Ill get back to that. This is for practice
I may be a relatively early computer science major in any case, but for some reason im struggling pretty bad to understand how unreal engine communicates between all its pieces, like how i make all these systems available to me talk to eachother ToT
When I try to make my interface into an event this happens why?
Can you trace with an infinite distance?
I am following the Epic created Your First Game in Unreal 5. I have created my Character BP, Player controller etc and it all works just like the tutorial. Following that the tutorial has you drop instances of the character into the level and assign an AI controller with a simple AIMoveTo node in it.
I have dropped characters in the level and assigned the AI controller, have created the Nav mesh, and Print Strings in the AI controller show me the Move to Note is firing. but when I play the game they never do move. Is there another detail I am missing????
Like in fortnite how are you supposed to make sure the trace hits something
That will lag like heck
What if the bullet needs to cover crazy distance
Like in fortnite long shots
you can set distance to insane distancess
but if infinite you can shoot at sky and cause a infint loop
which = CTD
Unity has that option
well maybe I am wrong then
I thought you can only set positions not distances?
¯_(ツ)_/¯
When I try to make my interface into an event this happens does anyone know why?
how often is event hit? every frame?
But then how do games like fortnite trace bullets?
https://www.youtube.com/watch?v=yOoFUOiZEKQ&t=340s has what I think your after he sets up a trace using vectors in first half of tut
In this video we go over adding a simple teleport ability and also add a cool zoom in/out effect to really complete the ability.
If you have any questions or comments please let us know. If you like the video and want to see more, go ahead and subscribe. Or consider supporting us on patreon https://www.patreon.com/titanicgames for more great tu...
@trim matrix no you cannot. You can trace to the max float limit
So what would you do for a bullet trace?
Which distance would you use?
Are you using a projectile or an on trace hit deal damage?
Trace hit
When my char gets hit I want this to knock the char away what nodes would I use for this
Add impulse
@trim matrix use a high float number like 999999. Most games fudge it with a range limit on weapons
Infinite cannot exist in computers since computers are finite
that can only be used on the current actor not cast to pawn
I could cast to a specified actor but I want to make it so players can choose dif chars
You should only need to cast if needed. General actor properties don't need casting.
needs a specified actor
What this image is telling you is that if you want to "Add Impulse" you need to specify a "Primitive Component". A "Pawn" type does not inherit from "Primitive Component".
ok then how do I get it to move my currently controlled pawn
You'd have to cast to something higher than pawn as pawns do not have any primitive components by default.
If you're using Character as a base for all your characters, you can cast to character and get its Capsule Component and then add impulse to that.
No my pawns have completely different animations and stats so I do not have a base chara like BP_Thirdpersonchar I have stuf like BP_YIN BP_JIN BP_ZIPY
Well then consider creating a base class for them that has a primitive component and make all your already created blueprints inherit from it.
ok that sound do able but I have no clue How I would do that
What I know of Interface massages cant do that
If you use interfaces then you'll basically be adding more work for yourself as you'd have to implement the event in each one of the blueprints you've made and any future ones. You're better off having a base class that has the functions and properties that are shared among all characters.
To create a base class, create a new blueprint based on pawn. Add something like a capsule component or some other form of collider that has physics enabled. Reparenting is done in the class settings of a blueprint:
ok now what?
Go into each of your classes that you want to add impulse to and set their parent class to your BaseActor class.
Looks like you might have trouble though as your "YinPlayerCharacter" looks as though it's already a Character class which is higher than pawn.
If you're using a Character class, then all you need to do is cast to Character and get the Capsule Component from it.
Yea
Like I said I have many of them
can't just cast to one
and re parenting broke it but good
glade I made a copy before I did that or man that be hell
O well I am going to bed I'll have to try and figure out something els later
Thanks for the help
Add impulse at location
So you can’t reference the rigidbody of the object the ray hit??
Make a base character
Or get component by class primitivecomponent and apply impulse
Although if you have actual Characters, they can already recieve an impulse
is there a good way to scan my project for issues like this
A non existing variable? No
unfortunate. it's annoying that refactoring leaves little "suprises" like this instead of refusing to compile
Doesnt it give you any warnings?
Nope. I found this little gem after a couple hours of debugging
it wouldn't because the variable that doesn't exist isn't in scope, and an array can be empty without giving an error as well
Would it then be an issue at all, beyond the visual existence ?
Doest look like something that would need debugging
Not for the purpose of finding that atleast :p debugging why the array was empty, sure
hello, new to procedural mesh. Is there a possible reason why generated mesh not displaying textures correctly?
sometimes but not always, normal/roughness map not displayed
@foggy sundial fwiw you can mark functions, variables etc as deprecated and that can help track stuff down before removing it because the compiler will give warnings. There's also some "search in all blueprints" tool
I try to resolve all those dependencies before removing stuff
That sounds like a good tip
It also helps wrapping this into functions
"GetInventory" etc
how do i link the change of editable text on a textbox in a different blueprint
Regular bp communication methods
ohhh
Hey, this is my solution for custom gravity with the standard charactermovementcomponent, but it doesnt seem to replicate smoothly, anyone got an idea to make the velocity increase more interpolated?
Nothing you do with the CMC outside of it, especially in BPs will be smooth tbh
If you want this smooth, CPP is the needed solution
The replicated gravity from the GameState is also a factor that will cause corrections
It doesn't guarantee that server and client use the same value in the same move
during the duration of my testing, that gravity variable didnt change, so that was persistent across clients, but damn i dont know how to use unreal c++ for shit xD
btw, when opening a c++ file from blueprints, it only brings up the .h file, where do u find the source file?
It should open the cpp file
What exactly are you trying to open?
Just go to the explorer of the header they are in the same folder if you are talking about an actor
@strong turtle
Gonna try after work today but it always opens just the header file when i open character.h for the cmc, and in the solution explorer in visual studio there's nothing
Did you create the character yourself?
Tried right clicking and go to definition?
Nah, the first person template character movement
Gonna have to try this, didnt think of it xd
Hello everyone!
Interface/Architecture question:
I have a pawn that is being moved by forces.
I have another actor that is applying external force to everyone who implements a certain interface (think of a bounce pad).
I want to temporarily disable the ability to use force to move the pawn while the pawn is being bounced, but since I am using an interface I don't want to explicitly cast to the pawn and toggle some bool or something.
Is there an elegant way to do this without casting to the specific pawn?
On bounce -> set bool true
On tick -> check velocity or whatever to figure out if it should be set false again?
Hard to say without knowing some context 😅
Are they all vertical bounces?
When can it be applied again? On Landed?
Or when z velocity goes below 0?
Hello team. I need to do a large number of automated hi res pretty promo screenshots. It is a static scene.
Is there any benefit of using Sequencer over doing it in blueprints via the TakeHiResScreenshot node with a CineCameraActor plugged into it?
HighResShot breaks many screen effects
Like post process effects?
Stuff like TAA, motion blur, and others, yes.
Is there a way to take screenshots from blueprints that doesn't break screen effects?
Why not doing it with Sequencer and render one frame out of it?
Because the logic of setting up each character (with lots of different armor combos) is happening in blueprints.
For context: I need to produce a large number of promotional/pro best quality images with a large number of possible hero/armor combos.
If I were you I'd just stage it in Sequencer
As long as the animations are the same, it shouldn't matter much
There are no animations, all still poses
is placing actors in a level a valid way to avoid some of the performance hit when spawning at runtime? i'm developing for mobile and i get a lag spike when spawning some things for the first time. i do have Async Loading Thread Enabled checked but it hasn't helped much. i feel like there should be a better way than having them all at 0,0,0 hidden or something
Doesn't matter much, assuming your poses are one frame anim sequences
Do you know whether it's possible to initiate a sequencer screenshot from blueprints?
@burnt rover instanced static meshes will help with draw calls. If the creation is killing your frame rate, you could try pooling objects as well and instead of destroying things and spawning new ones you just change visibility and move them around
Also, just enabling an async thread won't actually cause things to load async. It just enables the ability to load things Async. You still have to do that by correctly using softrefs and loading the class Async to then spawn it.
Also, loading an actor class Async won't help if you either have a huge actor class and are spawning several hundreds/thousands in a single frame. Or if your actor class has a lot of heavy sounds/textures which get blocking loaded from softrefs.
@icy dragon or anyone else that understands rendering/screenshots/Sequencer:
From a conceptual/high level PoV, how would I go about setting up a sequencer camera and telling it to take a screenshot in blueprints? (as an alternative to the TakeHiResScreenshot node)
Well theres a manager assigned to it, in which you can trigger events 🤷♂️
could you elaborate please?
Youd add event notifiers to the sequence which would trigger an event in the manager, providing a reference to the scene actor. There youd set up one function call on the actor to an armor set/combo, then trigger a highres screenshot
Repeat for the nunber of screenshots you want?
If its all static except the armor im not sure id sequence it
Havnt used the highres screenshot node before tho, is it slow?
Like, latent ?
Doesnt look to be
The highres screenshot is a little laggy on my computer if I bump the resolution up to around 8K (poor thing only got a 1060), but in this case that's actually not a problem. As I'm also able to detect in blueprints when it's done. So can just wait for it to finish.
In other words, speed isn't important here.
This is a potential concern with the node though.
Got no good suggestion for that im afraid
Hi everyone I am trying to reach references of other components attached to an actor from a component how can I do that?
By Mangaer, do you mean my logic in the level blueprint (that's setting up the characters and armor and things)?
No. I mean something along the lines of a master sequence manager, or whatever the class was called
Cool, thanks for your feedback so far. Seems like Sequencer may be an option if this doesn't do what we need it to then... Just need to look into blueprint-sequencer communication specifically.
i feel like its so easy to change text with variables but it doesnt do it
@cobalt bluff components are meant to be independent of one another, and ideally the thing they are attached to.
If you need multiple components to communicate with each other, id rethink my approach
Cmc uses capsule :p
I see so maybe I should inherit from the component I want to communicate
Scene capture component 2d
For the purpose of?
I will add some actors to hidden actors automatically
but there different classes that has scene capture component2d
so I was thinking of creating component and add it to wherever I want
For example in character bp character movement has the reference of capsule right? How can I achieve that?
GetOwner->GetComponentOfClass
is there a way to do that in blueprint?
ok thats perfect thank you
