#blueprint
402296 messages ยท Page 890 of 403
Player is fine that way but widgets... kind of hate input
so this may be ridiculous but...
write your own input handler for UI?
then you could fire events for right left etc and the currewnt active UI could handle that logic
but yea thats a mess
I mean if I had more time i'd do that lol. For now I'll just do the jankiest way I guess
hey actually man
check the documentation, they might have some prime number silly math going on
it might be a simple in-line calc to get the button
random question, anyone know why when i add an event, it spawns so far away from everything else? the bottom left one is something i just added
no, and there doesn't seem to be any decent fix
@formal parcel I'm currently looking through my character bp and thinking about what would better fit into the controller we made. Would all the character's individual cameras be better placed within the controller as a "one main camera for all" type of thing? I have a toggle between first person and third person perspective as well as a line trace off of those cameras that change crosshair color depending on if I can interact with the actor that I'm looking at. Is that something better placed in the controller? (Also if I'm bothersome, please let me know and I'll stop! ๐ )
nah you're fine man, the cameras I would keep on the character itself, but the activation of said cameras should be in the PC
but you're getting the idea, just think about what "domain" actually owns functionality
the cameras are owned by the characters IMO because their positioning and angles and such are determined by that character
i'd imagine a goldfish would have a different camera config than a helicopter
and those cameras would be anchored to different components and such... so its smarter to have the player controller request a certain camera, and the character itself implements that
So the toggle between first and third person should be within the player controller right?
As a function that I can call I assume
yep
well really the PC would prolly get the raw input event
and then decide what to do with it
lemme do a paint for you so its clear
In the event graph: Press hotkey -> function?
Hmm, that would apply that to literally every character tho
@red grail
I mean what's wrong with handling pawn-specific input on pawn GTA Style?
because its not pawn specific, read more
sorry for rudeness :/
my b
this is just general good OOP design
In case of the toggle between first and third person, if I'd want that on literally every playable character, I'd then put it in the controller, but if I for example didn't want it on one of them, I'd be better of with putting it in the characters right?
How would I exclude that one character?
you may have all sorts of conditions
you could do it by type
just make a simple function "canUseThirsPerson" or whatever
then when they hit the input for switching, you run whatever logic you need to determine if they can, and if they can then you dispatch it
and if not, you dont
then you dont need to write camera permission checking code in every character
DRY principle - dont repeat yourself
Would interfaces be a good use of that?
Like, put a thirdperson interface on the ones that I want to use it on
or just a check in whatever interface on each character .. "canUseThirdPerson"
then your PC can just call the interface on the pawn
and then you can do much more complex logic on the pawn as well to determine if it can use third person
but then on those that straight deny it just "return false"
This is so difficult to wrap my head around
software engineering aint easy
its easy to write bad code
its hard to write maintainable code
but proper architecture goes a long way to avoid spaghetti
Yeah, earlier today I ripped out a huge chunk of horrible code that got replaced with a simple interface lmao
but yea
interfaces are really the key to this type of thing
you have similar functionality but implemented differently between different type... textbook case for an interface
So you would do GTA style walking / driving mechanics by handling input in the PlayerController vs in the pawn? That sounds ass backwards. If the pawn is being switched around in gameplay I just put the common inputs in PC like Pause.
well I'd have a manager for sure, and then prolly delegate to vehicle and pedestrian controllers based on the situation
That's what the input stack already gives you.
i'm not gonna argue withj you adriel
It probably doesn't matter for smaller projects with an easily manageable amount of characters, but I'd imagine the more complex things get, the better it is to use the controller
you dont even know what we're really talking about or the context of the last 2 hours
@red grail correct, which is why I wasn't going to bring up interfaces in the first place... practical vs ideal and all that
but as a purely educational thing i explained it a little deeper
Well I had to use interfaces already so I have a rough idea, I'm just really surprised that I managed to connect atleast that somehow lol
well, you stumbled into the right solution ๐
but yea, just in general any time you're going to make a handler or something, give it a thought to what really owns it, and where does this code really belong in my heirarchy
save you from massive headaches and bugs down the line
Is this right? Basically do the function only if X interface is equipped
within the controller
well the rule about interfaces used in logic like this is they must be implemented
so its not so much about does my pawn implement this interface, all pawns will implement it and all methods in it
the move input action doesnt really matter if its in pc or character
here we go again
unless you need to check whether you can move or no
its 10 seconds right?
yes
You talking about the resuming movement after pressing resume?
As in, I could have done that with a function within my character, completely ignoring the whole player controller stuff?
Or idk, I'm not sure what you mean
any idea only one target point works for spawning?
menu inputs should be still in player controller
since it has nothing to do with character specific
I don't think I get this part
all the pawns will implement the interface and the method in it "canUseThirdPerson"
so the check isn't "does implement interface", its just... call that method from the interface
as they must implement it, thats the point of an interface
But why do all implement it? If I only put it in one of the character's bp and not the others?
think of an interface as a contract, implementing an interface is saying "i promise I will implement all methods within that interface"
Yeah, but if I have character1 BP with interface and character2 BP without interface, why do both implement it?
you're not understanding
Or are you putting the interfaces on the controller itself?
interfaces are separate concepts
they are their own entities
they dont go ON anything
they are defined, and classes can implement them
the situation we're discussing is that the characters can all implement this interface
We are talking about this right?
we're talking about the basic OOP programming concept called an interface ๐
not just that dropdown
Oh ok, I was specifically talking about these interfaces
those are the same, yes
so interfaces are entities
paint to the rescue, one moment
haha okay ๐
Hey! Im trying to turn render custom depth on and of when entering a triggerbox. Nothing seems to happen. Can anyone take a look and see what ive done wrong potentially?
if I disable/enable the boolean manually prior to starting it does show/hide
Hi. I have an issue with building light of an procedural generated location. I have two similar projects, in the first project I test, then export to the main one. When I tried to build light in test project, the following error appeared. But at the same time there are no errors in the main project with the same geometry. All meshes & light in movable mode. How to fix this?
thanks in advance.
@red grail notice in the implementation we dont care about the type, we're calling functionality by the interface... this way every pawn we have can determine in their own way, and this same technique can be used for any functionality that is similar between different types of objects
without having to repeat a bunch of code
and you also then dont need to check a bunch of object types all the time
what function is this?
Just a blank interface
its an output
Called it CameraSupportInterface
perfect
you dont need inputs for this so dont put em
its just one bool output
so the method signature is: bool Name();
the character will IMPLEMENT the interface
but for UE i guess thats putting it "in" the character
Idk, to me it looks like I'm assigning the interface to the character I want
yes
you should be able to assign the same interface to multiple characters
(all of them)
Yeah, but whats the point of putting it on a character that doesnt support the toggle?
so that you can call it in the implementation without checking the type
see the highlighted part of my image?
lets go private channel
Hi guys, how i can make a painting system like this?
Check out the ArtStation post! https://www.artstation.com/community/projects/PmAP53/
Hey, anyone that would be able to spare 5 mins of their time to help me? I'm running out of ideas. A system that made logical sense to me is somehow not working and I'm not sure what else to try.
I have a global anim system for movement with added weapon pose layer blend on finger bones to simulate grip from weapon anim but to retain global movement.
Since we've had an issue with consistency and transition out of montages, I decided it would be big brain for me to just get hand_r transform both on global idle and custom idle , and from that calculate the fabrik IK offset I need for my weapon blueprint.
My first attempt
Inside AnimBP I print string and copy transform of hand_r on default global animation, then save that and get a transform of hand_r on custom animations. Then I simply custom transform (loc,rot) - global transform (loc,rot) = Anim Offset for Hand_R
I obtain the bone transform using - Get Socket Transform (HandTrack) --- Break Transform --- Transform to Bone Space (root)
This worked okay, was able to add the offset and make one of my weapons work correctly. Then I noticed I need to do the same for my Weapon bone so I do the same.
This seemed to work reasonably ok, but it was messy and seemed to have some issues on other weapons.. so I tried this
Second Attempt
I made a blueprint with my rig to avoid having to use AnimBP.
To get my offset I do the following
Play Global > Get Transform > Set Pos and Rot as var > Play Custom anim > Set Pos and Rot as var > Calculate Difference = Offset.
Now, this seems to work perfectly for only one of my weapons, but doesn't work for the rest.
Can't wrap my head around this. Any idea why this shouldn't work? It's just basically getting the transform difference between anim A and anim B.. applying the difference as offset should make it work.
Sorry for the long message. โค๏ธ
First Attempt in Anim BP
Second attempt in BP Actor
i am having issues with some weird stuff.
to clarify:
-each vertice has a "node" and a scene component assigned to it
-if i click on a node a gizmo is created at its location.
-inside the gizmo i plan to create events that fire depending on how i drag it around, as of now i am experimenting with the Z part only
-i want to set the location of the underlying vertice and set it to that of the gizmo (to change it if i drag the gizmo around)
-the mesh is scaled down by a factor of N
now the result however is:
-blue marks the point where the gizmo is supposed to be, but for some reason it goes to the red arrow instead
does anyone here know of a unreal engine 4 book that can teach inventory systems.
Hey, what kind of inventory are you trying to make? There is a lot of resources on YouTube
is that name a reference to Generation Kill? ๐
The 1 system I have now is an object related inventory system, It all works. Just the guy that help me set it up screwed me on the last part of it. The On Drop. It's the only thing I can't get to work. and you tube is a joke on inventory systems. sense everyone tells me to stay away from them
Trying to use view target, and have it ignore the player actors, is there an easy way to do this?
@sleek kite Ah no it's not.
The reids channel one is actually pretty good. In general youtube tutorials aren't best practices, so you just need to look around
#animation might have better luck
What's your drop look like right now?
start the timer when you set the boolean true. Use set timer by event or set timer by function.
where do I put that
Im going back and forward in the event graph and in a fonction
Where vector * float pin went 
Isn't UE5 math nodes getting more universal?
Probably, but UX going worse for sure
You have to right click and convert vector pin to float manually
And if you plug the output pin to somewhere it becomes vector again
Was hoping widcard * wildcard untill something compatible was plugged in
It auto converts if you plug the pin in
noticing sometimes drag and drop widgets are set to not visible when the operation triggers 'On drag cancelled'. usually with just a small set of clicks within the panel which somehow doesn't register as a drag. Anyone encounter this?
When doing vector*real?
All math nodes convert float to double by default
But does it accept non-matching types like that?
Real type was removed after the preview
Double or not
Yeah
Then thats updated since i tried, oor i dragged the pin the wrong way ๐
Just connect the pins
Real was changed back to float after the preview version too
Now it just picks single or double precision
Sad, i prefer real :p
It's just confusing to make up a new type when float and double exist in c++
True that, im just more familiar with it from my dayjob :p
Plc programming
Real all the way
How would I go about making a line trace that ignores a bunch of actors of differing classes?
you could make an array of those actors and toss it into the ignore actors part of the line trace node
one example
doesnt work
What's the use case? Might be a better idea to have a custom channel for whatever tracing you're doing, depending.
how can I start a timer when a boolean is set to true?
as soon the bool is false the timer resets
talking about the hit boolean
I was unaware of this, would this be useful is say, the camera, and visibility of a spline mesh were set to no collide, would a custom channel be able to collide properly?
What are you trying to do or implement?
trying to make a reusable set of bp code that can take in any chosen actor via line trace (but that doesn't grab everything, so I've been messing with view target to no success)
anyone?
well any actor visible to the literal human player
Do you only want the one chosen actor to block the trace, everything else ignore?
I'd use the visibility channel for that, but you're still a bit unclear on what you're trying to do.
You have 2 channels out of the box, camera and visibility
You can add more if you want
I'm trying to grab only the first actor hit by the trace
Both seem incompatible with spline meshes without the person having to do some editing on their end, and I'd prefer it have an out of the box thing for the splines (which auto ignore those from what I can tell by default)
Does seem like this new channel thing might be worth checking out
can someone help me understand the diff bw a variable and a balckboard key ?
So why do you have to ignore things? You're still not saying what game mechanic you're trying to implement. Do you want to hit the spline mesh or not?
I am trying to have the player be able to select any object in the world with a widget button and have that be the selected actor which info is funneled into various other things
So why do you have to trace?
@undone surge a blackboard key basically is a variable. It's just assigned on the blackboard
Unless I am missing something it seemed the best way, well view target seems alright too but I am still working on learning more about the camera stuff
Is there a better way to get what actor the current player is looking at/what is in front of them?
That's the first time you've mentioned trying to do that, you said you're wanting to select with a widget button.
Do you mean you go into some select mode with a widget button? Like an RTS?
That was poor wording on my part, I just use the widget button to trigger the line trace to get the actor info I am looking for
OK so yeah I'd either use the visibility channel or make a custom channel, depending on how much selection and other visibility stuff your game is made up of
have stuff you want to be able to select / block selection block Visibility or your custom channel
Ahh thanks! I will check into these custom channels ๐
oof seems custom channels aren't out of the box friendly, might look more into view target
is it possible to somehow 'project' or simply show a a copy of a widget? idk how to explain. basically trying to do a dark souls type of inventory where your main hud shows your currently selected quickslot item but the quickslots themselves are separate
What do you mean not out of the box friendly?
Create a custom trace channel in project settings, set the collision on the actor, done
What does view target have to do with any of this?
Widget within a widget
can get the spline actors just fine, when it's not colliding with the player in some, though it doesn't have atleast an easy way to filter actors out of it
referring to the get view target node
OK please just spell out exactly what you're trying to do. You keep talking about spline actors and view targets and line traces and tracing in the players view direction but it just sounds like a mess.
I am just trying to find a way to get what is in front of the player, or what the player is looking at, that can pick up skeletal, static, and spline mesh actors
Not every game has their spline mesh actors set up to work with camera/visibility
so I was looking into get view target instead of line trace as it seems more consistent
Though it hits the player itself in some projects and unlike the line trace node, it does not have an ignore actors thing to plug into
I've never used "Get View Target" but "Set View Target" just tells the camera manager what actor to look at. "Get View Target" probably just returns your pawn.
You just want to do a line trace from your camera position to camera position + CameraForward x SomeNumber, and trace on whatever channel you care about. Or you can trace by object types or whatever.
Hey is there any way to check the hit object channel on a hit event?
I would use Visibility if it's meant to approximate what's visible
Like getting the "why" of a hit?
thanks I'll check this out, I think I was misunderstanding the get view target node
Yeah, instead of handling it through hit actors, I want to know which channel triggered the hit
nvm found it you can do it like this
Right now im using the line trace to place down actors in the world, but I only want the line trace to hit "ground" and not any other actor
Does Z vary or no?
these two bascially do the same thing right ? except for the extra options
Guys, I wanted to ask you, is it necessary to do a clear and invalidate timer by handle if the timer is triggered only once? He's not looping
If it's a one off shot, then it might not be bad, unless you needed to call it again
Trying to get some text to switch between two options, i've got a function for this already that's working fine on my 'Create Lobby' widget, this toggles between LAN/Steam without issue.
Yet once I'm on my lobby menu, the text to switch between Deer/Hunter is just blank and doesn't show anything... Any tips on where the issue may lie?
Function is exactly the same, the variable is set as a boolean in my game instance, the function get's this variable and sets it to branch between deer/hunter then return it and this is then set within the lobby widget graph.
I've no idea why the text is just refusing to show though during tests?
how could I set a lobby of 10 players to be on 2 teams
Can you show the code that is calling "Toggle Deer / Hunter P1"?
Should I just set 1-5 to blue and 6-10 to red?
Also, Game Instance and its variables don't replicate, so may not be the best place to store that value if you want it replicated.
Isn't that GameMode?
Er nvm
GameMode too ๐
I was thinking GameState
I managed to get it working, Although I'm not 100% certain what the fix was.
It seems somehow I managed to create a different... type of function? Somehow?
The functions at the bottom of this list are the ones that didn't work.
After I copied my LAN/Steam function from my other widget and changed it over to the correct variables then set this new function as the binding, it's now working fine.
I'm not sure why those bottom 2 functions are a different colour, but it meant they weren't working
If this is the case, where would be best to store this variable so it can replicate properly for both players in my lobby?
Sorry I'm still really new to use and trying to learn from other tutorials
Typically playerstate would be the place to replicate information about a specific player.
As far as why the text isn't updating, that looks like you're using function binds which is fine. So long as you've made sure that you've selected the appropriate function for the field, then it should theoretically be working.
Ok I'll take a look into the Playertstae and getting it working with this, thank you ๐
As for the binding, I'm really not sure why those 2 functions are different colours to the others, I created them the same way I always do, yet the binding just caused my text to not appear...
Either way, it's working for now, I appreciate the help!
@wild jettyIf this is a game mode where one player is a deer and another is the hunter, just have on GameState something like bool Player1IsDeer or Playerstate Hunter or some other SINGLE source of truth as to who's who.
If there's one Hunter and many Deer, just have a Playerstate variable on GameState called CurrentHunter or whatever.
From where?
Just set it to 0,0,0
i did so but it didnt work
Show your entire logic chain
Thanks Adriel, I'll give this a look!
Trying to work it all out from fresh to slow going.
Thinking on this though... Would I be able to do as you mention and STILL give players the choice as to who plays what? ๐ค
I then use simple ai move to but when the player is running (fp) he is looking to his side and not the direction he is running to
What's the setup, is it 1 vs many, many vs many, what?
So far, just 1v1 until I can get more comfortable and know that it works 100%
Then I'll add more as time goes on
But I mean how does the team setup work, is it like tag where there's 1 person of interest, or is it just like any other pvp game where there's 2 roughtly equal teams, or what?
2 equal teams, i may add in a 2v1/4v1 mode down the line, but for now, just the 2 teams, 1v1
Oh ok then either store some team state on each playerstate, or in gamestate have 2 team lists
Thanks ๐ I'll take a look to see what info I can find on specifics on how to go about doing that
I'd start by just slapping a boolean on the PlayerStates bIsHunter
Recommend 2 different player states? (I'm really unsure if just 1 is ok or not ๐ )
No, just a variable on your PlayerState
The State of the Player is whether or not they are a Hunter
or rather, whether or not a Player is a Hunter is a part of that Player's State
Player XxX420Sephiroth68xXx is a Hunter
Old Xbox 360 username? ๐
Ok boolean added, I'll swap things around in the functions to pull from the playerstate instead to decide who's hunter/deer
Hey all! I am having a super big problem as I am creating an endless runner game following UE tutorial, I am trying to get the game to restart when the player dies but I keep getting this error : TravelFailure: ClientTravelFailure, Reason for Failure: 'Failed to load package '/Game/ThirdPerson/Maps/UEDPIE_0_ThirdPersonMap''. Shutting down PIE.
What does it mean? I have gone on multiple forums and am still super stuck ๐ฅฒ
how do i unroll an rotator while keeping the yaw/pitch point in the same direction?
Sounds like when you're respawning it's trying to load a map that may not exist? Check your maps folder to see if it's there
there is a map called ThirdPersonMap , I dont know why the error says UEDPIE_0_ThirdPersonMap though?!
what is UEDPIE_0 haha - I am so confused
This may sound silly but should I change the map name to UEDPIE_0_ThirdPersonMap
Unsure on UEDPIE_0 but PIE is when you're using the engine itself to test the game. Maybe try launching as a separate application?
under the Modes try your PC name, or 'Standalone Game'
@brazen spearYou got some dangling redirectors hanging around? Fix up redirectors in the content folder.
Unsure, with my own game I always have to run it as a standalone game or via my PC being in the list because of running Steam, I'm not sure in your case though
I did try this but it doesn't seem to change much! I just don't understand why on the Standalone it works !?
Eudiepie
hahaha don't judge! I would try anything at that point!!
i'm still learning ๐
Oh don't worry my gif was in reaction to Adriel over there making very bad puns ๐
thank you so much though!!! I was getting really stressed haha
@brazen spearShow how you're restarting
ahh few hahaha
The blueprint?
No worries at all! I'm just glad my own issues over the last 2 weeks have meant I could help someone else ^_^
ya how are you restarting the level
I really appreciate it!!!
one second I will sent the Blueprint
Learn.unreal ๐
In UE5 how do I change the Inputs/Outputs of a Blueprint Interface? As soon as I add an output everything is grayed out and i can't change the name or type of the ouput or inputs?
Nevermind i found that I must select the function name from the right panel....
edit: guess more of a c++ thing so I'm moving it
Guys, can I return values from function what i call from timer? If no, which way can i use?
No. Ground might but I don't want to stack actors
Then just have the terrain or whatever block the trace channel and nothing else.
Or if it's totally flat you can just use a line plane intersection
Is it possible to use the camera shake blueprint to drive the transform of any scene object instead of the camera?
I'm trying to get a satisfying shake on the cockpit of a mech every time it takes a footstep
Hey... This Begin Overlap node is firing every single frame that the 2 components are overlapping, and not just when they begin overlapping. What's the dealio with this?
It's also firing the end overlap node every single frame as well.
But it's literally just one component inside of another component. Nothing complex. Nothing ridiculous going on. Just... All there is to it.
How can I fix stretched textures which are scaled
Uv unwrap properly
I meant when scaling in ue5
Ah i take it you are using static mesh cubes or smthn as walls
Yeah
Yeah try to use a wall mesh
Can probably do somethin g with world aligned materials
Ir if its a prototype dont worry about textures
Is there an event that triggers for when a widget's button gains keyboard focus?
like on hovered with mouse
I think that is an override, look at the function overrides
So should I put stuff like player experience in the game instance, and health since I want those to carry over between levels
is there a way to know if a blueprint struct has another blueprint struct as a parent?
That could work, but it would not save anything between games. You can use save game objects
just have ti save from the game instance as well
i am using a timeline to drive add local rotation to make the ship tilt left and right a bit, tho it oddly always tilts stronger to one side than the other
i already looked at the values and it should tilt equally on all sides
Hey, I am making a game with a level editor. to save both the blocks and race times from each level I'm making a new save slot for that level. Is this a foolhardy path fraught with peril?
Is there a way to interrupt SetViewTargetwithBlend? I'm using it to transition from one camera to the next, but I'd like to interrupt it in some cases.
Calling SetViewTargetwithBlend again with no blend time does not seem to snap the camera to the new target.
I noticed I can do some things on construction. So I used to have my material apply on play for my display model (apply from parameter/variable).
Now though I put it on construction and it does it in the editor, however setting the opacity doesn't seem to change in construction. Is that a begin play exclusion or something?
How do I know if something can be done in construction or if it has to be on play
(Hope this is an appropriate channel. Please correct me if not)
Anyone feel like helping with maths lol? I've gotten this far but alas my brian has turned into mush trying to figure out how to solve this.
https://blueprintue.com/blueprint/ye34vyll/
Context: I'm using this to control 2D eyes via a material, this makes the eyes follow the player. I'm projecting a vector through a plane and finding the intersection point, then doing some calculations to convert the point to a 0 -> 1 range, with 0 being the left-hand edge of the plane, and 1 being the right-hand edge of the plane.
The issue is, the object has to be rotated between 0 - 180 on the z axis in world space for this to function properly. If I rotate it anywhere beyond that, my 0 -> 1 range becomes flipped so the x location of the eyes become reversed.
Math logic isn't my strong suit lmfao. Can someone by chance help me figure this one out?
Is it possible to create something like an "instance" of an Object blueprint with certain values for the blueprint's variables before runtime?
Similar to how you can create Texture "instances" and assign these to blueprints with Texture variables.
You can set variables within the blueprint to instance-editable, would this work?
Not entirely
For reference I'm trying to make something like a texture but with some extra functions/variables
But if I then give a different blueprint such a class I don't have a default variable to assign to it
And you can't define an instance in places like this
For a simple effect I think you could just project a unit vector from the position of the eye to the position of the viewtarget onto the plane of the 2D eye (centered at the position of the eye). Then clamp it to the bounds of the eye and scale it with some factor
This projection is then this:
https://www.maplesoft.com/support/help/maple/view.aspx?path=MathApps%2FProjectionOfVectorOntoPlane
With the normal vector of the eye for n and u the (normalised) vector from the eye to the target
Pppf yup theres no way I'm not overcomplicating this. This sounds like a much simpler approach, thank you! I'll give it a shot
like saving and loading
wtf why isnt this working, the timeline is no magic, yet it cant for the life of it create a uniform tilting , it always tilts more on side
it shouldnt be able to do that, why
seems to me it would be a issue with either the ship object origin or object relative rotation vs world rotation
so I'm trying combine all of my UI widgets into a singular HUD and everything seems to be working except the HP bar, the current/max health values in the same BP show up just not the progress bar, any ideas what I'm missing?
show code or rather BP
Right, so one way I could do this is to make the Object "instances" child blueprints of the original blueprint with different default values.
Then in the blueprint which has the an Object variable you'd add a second variable with a class reference which references these child blueprints.
The Object variable can then be instantiated from one of the child blueprints.
That seems rather convoluted. Surely it must be possible to create multiple instances of a class?
this is the health ui widget, it works fine in itself but when added to the hud ui as usercreated widget, only the set text portion is working the progress bar is non existent
you can see placeholder text but the progress bar doesn't carry over
@quiet abyss why not use dot product?
and now I feel dumb, increasing the size of that box a lot fixes it but not sure why the text worked right out of the gate
Can anyone in here help me out with saving to a .txt file in game? I'm wanting to have a bunch of functions that can actively update files to be accessed via another program, but there doesn't seem to be any native features for writing .txt files.
does anyone know how to merge all these materials into 1 for a character skeleton mesh???
Good question. Mostly because math isn't my strong suit ๐
I did solve my issue though! Instead of using world-space coords, I'm using local space.
I'll look into dot products though, chances are it'll simplify what I'm doing even further!
@quiet abyss I use dot products to determine angle and rotate in response until it is around a value of 1
@pine trellis export mesh into Maya and redo the UV mapping into an atlas
@elder ruin I thought there was a plug in like that in the marketplace
There are native features for doing this. I'm just not sure if they're exposed to BPs
I grabbed EasyFileManager, which was supposed to; but as of yet I've only been able to append files, not rewrite them.
Any clue if it's possible to expose them to BP?
yes of course
in a blueprintFunctionLibrary, you can save a string in a txt file like this: .h #include "Engine.h" ... UFUNCTION(BlueprintCallable, Category = "Save") static bool FileSaveString(FString SaveTextB, FString FileNameB); UFUNCTION(BlueprintPure, Category = "Save") static bool FileLoadString(FString FileNameA, FString& SaveTextA); .cpp boo...
Thanks!
Also Rama's Victory plugin
Yeah I was hoping to find a solution without Rama's if I could.
I don't blame you ๐
do we have something like "get character as number" but vice versa? like "int to character"
How would I shrink my capsule component for a crouch without the player getting pushed into the ground?
Have you considered using the Crouch function that's already in Character/CharacterMovementComponent?
Right- I have a workaround for it which just lerps the camera :D But if you want to do it manually just copy what it does, which is moving the appropriate components up/down
dang. i was hoping thered be some way without coding lmao but thanks ๐
trying to get this to work, the start game function works fine in its original blueprint but when I try to reference it in the playercharacter I get this error and I'm not sure why
You mean something like this?
This is a variable and you need to populate it with a reference to the actual instance of whatever the variable type is.
"make literal ..." just lets you input some value without creating a variable
so... no, not what I'm looking for
its currently set to the main menu ui BP which is allowing me to get the play button, or is it something else I need to do?
The important bit is the thing converting the int to the string.
That isn't setting the value in the variable, all you've done is set the variable type, not what is contained in the variable.
Eg. I can have a variable called "Integer" but its default value is always 0. Your "MainMenu Widget Ref" will always have a default value of "None" unless you set it.
it just converts int to string
I want to do stuff like 1=a, 2=b, 24=z
Ah.
Does the function "Get Bose Poses for Frame" actually exist? It doesn't seem to be accessible anywhere.
Don't need the literal int thing there... you can feed in whatever integer directly into the select.
and... I need to specify every case
latin, cyrillic, hieroglyphs, numbers, special symbols...
theres a perfect solution
but I dont know cpp...
https://www.techiedelight.com/convert-int-to-char-in-cpp/
okay I understand you now, yeah I forgot to set the variable after creating the widget.. thanks mate!
hello, is they a way to change interpolation method of already imported curve table?
why aren't we allowed to put delay nodes in functions?
Because delay is a latent operation, while BP function is not. BP function's expected to go all the way at once.
hello! tryign to script an editor utility widget to disable/enable collision on level actors (static meshes), nothing i do seems to actually change the collision when viewed via the "layer collisions" view mode, any thoughts?
a good way to think about a function is that the output of the function, ie whatever it is supposed to do, is going to happen all at once, and the result is what is useful, not how it gets there.
if you are using a delay in a function you are probably trying to "tidy" a blueprint or you should be using a macro if you want to re-use some code
Ah okay.
Use Simple Collision As Complex
This means that if a complex query is requested, the engine will still query against simple shapes; basically ignoring the trimesh. This helps save memory since we don't need to bake the trimesh and can improve performance if the collision geometry is simpler.
Use Complex Collision As Simple
This means that if a simple query is requested, the engine will query against complex shapes; basically ignoring the simple collision. This allows us to use the trimesh for the physics simulation collision. Note that if you are using UseComplexAsSimple you cannot simulate the object, but you can use it to collide with other simulated (simple) objects.
Hi guys, how to toggle between them from blueprint in real time?
What is layer collisions view mode 0o?
sorry i meant "player collision".
i foudn the solution, just worded weirdly in blueprint nodes, "Set Collision Profile Name" set to NoCollision or Default works, then you just have to toggle visibility of the actor to get the viewmode to update, beep boop unreal gloop
Oh, you wanted to hide the actor and turn off the collision, I see
ah no, just disable the collision, but have it update in the collision viewmode like this:
but this works:
looking to make an interact prompt when near an actor, was hoping to have the prompt built into the hud and just hidden until near npc/invisible when away from npc, but even though the overlap events work fine I can't get the prompt to be set to invisible, and I don't think I should be creating the hud in the NPC blue print but I don't know how else to get and set the hud reference
would I be better off just creating and removing the widget separately from the hud?
have you checked what is failing? is the cast returning failed when ending overlap?
the checks are definitely working, but the set visibility nodes aren't doing anything at all
@unreal marten Where is the code from your image located?
You are casting to BP PlayerBase which sounds like you are in the interactable?
set array is working like clear and populate ye?
inside BP_NPCBase, it seems to work fine if I stick to just the prompt UI and add to viewport/remove from parent as needed, but not the hud visibility
Yes, it fully overrides whatever values were in it before
Why are you creating the PlayerHUD widget in your NPC
That creates one per NPC and all of them are different instances
Interaction systems make more sense the other way round
Interface on the Interactable Actor. Some custom Collision Channel on some Sphere.
Handling the overlap in the PlayerCharacter and not the NPC
Getting all required data for the Interaction via the Interface functions
And then accessing the HUD from the PlayerCharacter or its Controller directly (wherever you create the HUD)
I'm partially following you, I got the interact/prompt working now but I should move the interact function (HUD is already in BP_PlayerBase) to the player instead of the NPC?
okay it's moved out of NPC to Player, works well now thank you! how do I ensure it only triggers when overlapping with a specific actor type like BP_NPCBase? does it have to be cast at them?
Yeah the only thing in your NPC should be the interface and the implemented functions of it
No, theoretically all your Interactable Actors should have the same Interface applied to them
That's what you use to get the interaction type, like press, hold key or instant (e.g. pickup on the floor), as well as duration, name, if it's Interactable atm (maybe it's turned off or has any other requirement)
And lastly the functions to actually interact
Such as OnInteract which you call when you press your button
Each Interactable implements this function (as well as the others) and does whatever it should when interacting
E.g. a door opening, an NPC starting a dialog, a lever playing an animation and opening something
@surreal peak so if I had say BP_Actor1 and BP_Actor2, how would I set EventActorBeginOverlap to only trigger when overlapping with BP_Actor1?
how would i reference a variable from my main 3rdpersonBP into my behaviour tree
add some mechanism in your bp that listens to the interface call that blocks new requests until the old one is removed
I believe it has to be present on the blackboard
Hey! Is it possible to sample a vector field volume at a given location in space?
Is there a way to have some kind of failsafe or cancelling async load assets? Say, if the asset somehow took too long to load because of user's storage I/O is getting clogged for some reason
Anyone know if there is a way to do something like the following in blueprints?
if (WarpyThingOne){
DoWarpyStuff(input, WarpyNumber)
}elseif(WarpyThingTwo){
DoOtherWarpyStuff(input, WarpyNumber)
}
}
//Case One, Does both
SomeFunction(Input, 5, WarpTarget, ADifferentWarpTarget);
//Case Two, Does WarpyThingOne
SomeFunction(Input, 5, WarpTarget, NULL);
//Case Three, Does WarpyThingTwo
SomeFunction(Input, 5, NULL, ADifferentWarpTarget);
Yepp definitely. Exactly how you wrote it. Make a function with the inputs then use a branch node for if and use isValid node for the branch input
Oh, perfect! Thanks!
i need to convert a vector in blueprint to do this setMag thing of p5.js:
https://p5js.org/reference/#/p5.Vector/setMag
How do i do this?
p5.js a JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing.
It seems like it scales it up
source code of p5.js
return this.normalize().mult(n);
};```
looks like you want to normalize it and then multiply
@fiery glen So this is a setMeg(20);
yep
hey, ty for the reply. I got it though, I didn't need camera clamping after all
can line traces trigger on begin overlap events?
yes, if you tell them to?
Whats the best way to organize a voxel grid in terms of data?
sparsely
In my 1st person game, how would i go about creating an effect of closing eyelids? Use the UMG somehow? or create physical "eyelids" that cover the camera?
How can I make it so that the lines do not repeat and there is only one?
Texture size Y or X can be different, so 64xY and then have to adjust it to the width
But assuming this will be a road, World Aligned might not be what you are looking for tbh
probably a Post Process material that is like the vignette effect except it can interpolate the height of the vignette
you can utilize a postprocessing material for that
ie. a texture (grayscale) showing the progress of eye closing progress
and in your bp / camera modifier you interpolate to close / open
how do i return the opposite value of a random float? (i.e positive -> negative, negative ->positive)
zero minus float should do it, right?
I just want it to repeat on one axis
yeah then its fine with WordlAligned
if you have curves you won't be happy
Instead of doing a scalar to **TextureSize **either plug in a **vector **directly or two scalar with an append
that's what i thought but the float could be positive or negative and i don't know which one. i need it to return the opposite value of whatever the value is
- -1 ?
oh ya that might work
If it is a special "opposite" aka 0.6 should be -0.4
Use a Sign node and filter that way?
Set the texture wrapping to clamp, though FWIW might as well not doing it with world aligned mapping
any idea why this would happen when changing a character's anim blueprint? trying to make the dragon 'fly'. Nothing is wrong with the flying blendspace cause i can used it for 'walking' or 'jumping' just fine but when i want to swap movement mode to flying the dragon gets bent as if it decided to try out every pose in kamasutra at once
this is also a child of a 'template' anim blueprint, i have other flying creatures that work just fine
Call it the KS state.
Okay, just kidding.
Any reason for the flying not to be in the same animBP with different state?
lol. what you mean its all in the same anim blueprint sorta
anim blueprints are my bane i swear
the blendspace should work fine as far as i can tell
This is a place where we can ask for help with the blueprints yes?
Ask away
Lemme get my screenshots
So i am doing a project for school and im trying to make a small LAN multiplayer game in Unreal Engine with this
It used to work just fine on 2 laptops but now it no longer finds/joins the hosted server
And when looking at logs the return I get is
Warning: Script Msg: Attempted to access index 0 from array 'Temp_struct_Variable' of length 0
And I dont understand why
It works perfectly fine when connecting from 1 computer just when its 2 separate ones it doesnt work
Okay so, sparse voxel octree, but, how do I store those things?
As in, should each voxel store its whole tree?
how do I probe a single voxel and find out which branch it exists in?
Each voxel is stored inside the octree
Octree is just an optimization for spatial subdivisions, so if there are no voxels in a larger area, you can get away with a pretty lowres octree bound
So you have an octree storing where voxels are
meaning here TL,BL,BR are 0-level octree sections
TR is subdivided 2 times where 3/4 are empty but TR,TL has elements in it
usually 0-level is also called 0 Depth, where subdivision is also called x-Depth
octree only helps you to early out of rendering / searches, so you don't have to sample everything which is empty
Right but like, in practice, how are they stored
like are we talking structs here?
is there some custom data type for octrees?
There is an octree implementation in source, I would highly advise against implementing octree in BP
But yeah each cell is a struct
Thanks very much!
I have a camera system with mouse and keyboard but I want to disable them if the focus of the window is lost. How can I do that ?
I added c++ code like that : #pragma once #include "Engine/GameViewportClient.h" #include "MyGameViewportClient.generated.h" DECLARE_DYNAMIC_MULTICAST_DELEGATE(FLostFocusSignature); /** * UMyGameViewportClient class. */ UCLASS() class GAME_API UMyGameViewportClient : public UGameViewportClient { GENERATED_BODY() public: // Lost focus...
You can create a custom event for window focus loss and disable input on that event
is that only possible with c++ ?
How do I make this to toggle instead of hold?
@warm sand last I checked yeah. I also had to steal some c++ code to tackle a similar issue a few months back (pause the game on focus lost).
ok thanks
How would you make character movement a condition for a branch? I want it so that you can only zoom in the camera as long as the character isn't moving I got the character movement out of the cast to third person node but not sure how to turn that into a condition
thx
I've never used the third person template, so in lieu of someone giving you an informed answer... Is "character movement" a component? Does this component provide velocity data?
If so, you can check if velocity (vector length) is under some threshold to determine if the character is meaningfully moving or not
you can use similar way of calculating speed like it's used in animation blueprints. calculate speed . if speed is 0 = not moving. There's quite a bunch of tutorials on how to calculate speed on youtube
Get velocity, get vector length, vector length == 0
True will let you zoom only while idle
yes it is a component so take that to vector and vector to bool?
do you mean sampler source = clamp?
ahhhhh just read MWs
Looking for someone experienced with expertise on IK and UE4 anim systems. Have an issue with how my global locomotion / weapon anim system works at the moment and I've ran out of ideas.
Don't need you to code it for me, but if you are able to help me and figure out a system that works, I'll be happy to compensate you for your time within reason.
DM me for more details.
Posted the above also in #animation , just trying my luck here
Please do not crosspost unless redirected.
also who has some free time I still have issues with my inventory system not working across levels so if you are willing to spend some time with me to help that'd be awesome as I keep trying and i just hit a wall everytime lol
It'd be either #volunteer-projects or #freelance-jobs
and how can you not be attached to the world?
hi everyone!
I'm creating a multiplayer game and I have a problem, I don't know how to change the location of the AI โโfor first person view, I want the AI โโto be a bit further from the camera for the first person view, when the AI โโis close to the character is completely enters character for FP view. Third person view is ok, only this first person view is troublesome; /
sorry for english
hope you can understand it ;p
any ways?
need to add a copy of the AI โโmesh to BP_AI which will be used for the first person view?
I don't see any other choice
sorry no that's stupid i don't know how to do it ๐
that would work for the player, but not for the AI
when the player sees another player next to the AI, it should look like in third person view
I don't know if anyone understands me ๐
Anyone know If I can change a variable of an actor from the viewport? Similar to how you would do it in Unity
Hey, trying to keep a actor or paste it's values between scenes but unsure how. The setup is that there's a PatchEntry level that will pull .paks and once complete will load a level, however there's a actor in this level that reads Unity launch parameters (json) for the 2nd level and it has to keep those when switching.
if you're answering my question I understood about 0 things in that sentence haha
You can mark variables as "Exposed on Spawn" and "Instance Editable" which will allow you to set their values when they are placed in the world.
Where you define the details about the variable within the blueprint.
Yeah thanks!
Instance editable will make it show in the details panel
Expose on spawn will add the variable to the construct node as an input pin
So on on my Level Transition blueprint I want to make sure the data of my Inventory is stored across levels.
This is how my blueprint is setup:
https://blueprintue.com/blueprint/xicdz1z4/
Now the issue is that I can't open my inventory window anymore and it tells me this error three times:
Blueprint Runtime Error: "Accessed None trying to read property InventoryComponent". Blueprint: ThirdPersonCharacter Function: Execute Ubergraph Third Person Character Graph: EventGraph Node: Toggle Inventory
Obviously is trying to access my Inventory Component in that particular Toggle Inventory toggle which looks like this In my Third Person Character:
https://blueprintue.com/blueprint/w_ujl6xh/
I really need to get this fixed guys, I don't know what else to do, I really want to keep developing my game but the lack of knowledge is getting to me, its been 4 months guys and I don't know what else to do, help pl0x
Hello guys
Can u Help me with this
I did this to make the AI look at the player . But the problem that the rotation is not updated , the AI look only at the start position of the player but when i move the player the rotation doesnt update
And thank you guys
I'm looking for a function, that disables all events / input within a widget (i.e.: Hovering over buttons etc)
You can set "not hit testable self and children" on the canvas
Then it won't register the cursor or touches trying to interact with it
I used that for the cursor, but I've got custom events (arrow keys) to navigate a menu. I want to temporary disable those too. Is there a build in function or variables that can be switched or do I need to reconsider my approach?
Add a bool and just check before you allow the interaction
that's what I currently have and it works but I was wondering if I missed some inbuilt functionality
Guess I'll stick with the boolean approach for now, thanks for the help
How can you set actor = actor.persistenlevel in a blueprint?
You mean reference the level?
Afaik you can't reference the level blueprint directly. The level bp references other things and uses event dispatchers to listen for calls
Hello! I was wondering if it is possible to have a UserWidget placed on a world position without it being managed by a blueprint (through a WidgetComponent for example). So basically, given a position in the widget construct event, is it possible to put it at that world location without any external management?
hmmm
If its not in a component it will be in screenspace
You could go advanced and make it update depwensing on player vs widget world position,
i mean then i'll just do it via an extra blueprint class
And project that relative location to the screen when entering its proximity etc etc
how does one make an online highscore for mobile games ?
it shouldn't give any problems spawning an actor
thanks anyway ๐ the alternative is indeed maybe a bit too janky/complicated for no benefit
Yepp ๐
you could spawn an actor of class actor and create the component and attach it to it?!
yeah that's what i'm doing now, but i wanted to see if i could do it with just the widget (if you are talking to me :D)
yea i do, and i don't think that it's possible
as the component needs some "home" :>
yup ๐
all the static mesh on the levels are made like that anyway
actor to house a component
hi is there a way to get an reference to currently using camera ? i bought a kit where is character got 9 differenct camera components and i want to get a ref to current camera at run time
not sure if this is specific to my project, but 'get player camera manager' is the node that always returns the right camera for me
how can I get EventActorBegin/EndOverlap to only trigger when overlapping specific things? for example its triggering when overlapping power ups but I only want it to trigger when overlapping an npc
you can adjust the collision behaviour
alternatively you can check when overlapping with what you are overlapping and choose to do or not do something with it (but this is probably a worse implementation since the collision still triggers)
how can i change ue5 character for a mixamo
well I need to be able to overlap with either 1, but have different outcomes based on what im overlapping with which is where I get lost, for example here I can print string to see what's overlapping but I don't think class/display name will be helpful I need like parent blueprint or something? basically check for BP_Interactable vs BP_NPCBase
you can use 'cast to ...' nodes to check which type the actor you bump into is
if the cast fails that means it either was invalid in the first place, or that it isn't of that type
so you can do 'Cast To BP_Pickup', and if that succeeds you know it is a pickup
casting actually gets used for filtering like this all of the time
Thats why my suggestion wasnt really a good one. Would be overly complicated for very little gain :p
so if I needed a check for say pickup vs npc vs enemy would I cast them in a sequence?
I'm trying to deploy the same app to multiple platforms, desktop, mobile, vr. What is the best way to spawn a different player pawn depending on the deployment platform. Right now I have an enumerator, one value for each platform I intend to deploy to. I'm guessing I can spawn a different pawn from the player controller? Maybe the level blueprint? What's the best way to do this? Is there an established practice?
Override the spawn event in the gamemode, selecting class to spawn based on your enum
Killer, thanks fam
kinda, not a sequence node, but more like a chain
like this
with a sequence node, you'd execute all casts even if you have already found what you needed
got you so chaining them from each other will skip the other checks instead of checking everything even if it passes on the first check?
yes
I want to add here that as soon as you have to do what warre posted, you are probably doing someting wrong
Cause that is usually where you have a simple Interface call
Casting to every possible option is in 99% of the cases bad coding
AttachTo: /Game/UEDPIE_0_TheHorizonMap.TheHorizonMap:PersistentLevel.TPC_C_0.CollisionCylinder' is not static (in blueprint "TPC"), cannot attach '/Game/UEDPIE_0_TheHorizonMap.TheHorizonMap:PersistentLevel.TPC_C_0.SpringArm' which is static to it. Aborting.
It kinda tells you what is wrong
SpringArm is movable
And if I set "CollisionCylinder" to static, the character wouldn't move.
Wait no, SpringArm is static
i figured ๐
I think that's what you mentioned yesterday but I wasn't able to follow along, so I would check if the actor im overlapping can create an interface (like a shop or something?) and if it can then it shows/hides the widget? and if not then I don't need the widget to appear anyways
So?
yeah I am interested now, how are you supposed to do it then? I was taught to do it this way
An Interface is not a UI
An Interface is a programming concept
an abstract class
And Interface declares functions. You can add the Interface to a class, which then can implement those functions
Yes, but not because it's abstract.
On the caller side, you don't have to care who implements the interface
You simply call the interface function on the Actor/Object, and if that Actor/Object has the interface AND implements the function, it will execute it
That removes the need of casting to each possible option
yeah i don't have a lot of experience in blueprints, i learned C++ but overriding and so on is sometimes weird/bad/impossible in blueprints so i don't use it as much as i should in blueprints
An example would be:
-
BPI_Noise (Blueprint Interface)
-- Has function "MakeNoise" -
BP_Car
-- Implements Interface
-- Overrides "MakeNoise" Function and plays "Honk" sound -
BP_Dog
-- Implements Interface
-- Overrides "MakeNoise" Function and plays "Woof" sound -
BP_Player
-- Traces for Actors
-- When hitting an Actor, calls "MakeNoise" on the Actor
BP_Car and BP_Dog do not share a custom Parent Class, only Actor, so without the Interface you would need to cast to either of them
Which can quickly grow out of proportion
You basically have two options:
- When you have a lot of Actors that share the same custom Parent Class (e.g. BP_Animal) and you only need to call functions on those, but each Child should do something else, then add the function to the Parent (BP_Animal) and override it in the Child (BP_Dog). When tracing you can cast to BP_Animal and call the function.
- When you have a lot of Actors that DO NOT share the same custom Parent Class, add an Interface to bridge this.
A Combination of this obviously also works. BP_Animal can implement the Interface in addition
For Interaction Systems I usually have an Interaction Interface. Whichs allows me to get the Name, Duration, InteractionType, as well as calling OnInteract etc.
I have a base BP_Interactable Actor which implements the Interface and is used for every Interactable that only needs to be a simple Actor. Convenience.
The Interface can then also be added to Actors that can't be simple Actor children, like a Character, which can't inherit from BP_Interactable.
So your NPC for example (unless your NPC is a stationary Actor and not actually a Character, but overall using Interfaces allows you to not worry about this. Your PlayerCharacter will just call the Interface functions and it's up to the receiving end to implement them).
Hope that clears it somewhat up. Otherwise it might be time to google/youtube this (:
it definitely helped a lot, I understand the concept at least but yeah youtube time to see visually how this is all created thank you!
๐
how can i change ue5 character for a mixamo character????
Are any anims in the blendspace additive? Normally that deforms meshes like that
do variables pass by const reference automatically in blueprint functions? i want to pass a struct to a function but i am not sure if i should force it to pass by reference for performance reasons or if it goes by const reference automatically
The same way you'd do it in ue4. There are many tutorials out there
I don't think BPs have a concept of const?
I mean, they do kinda, but not sure if per param
Ref would save you a copy of course
I have managed to fix the issue.
ill need to checkk
i mean i don't really care if the parameter is const or not, i just don't want it to be copied for obvious performance impact reasons. But i wanted to know if a parameter is automatically passed by const ref (i assume it is but i am not sure)
it might as well be passed by copy automatically but that would surprise me
how do i make it so if the player interacts with one BP, another BP does something?
there's a multitude of ways... https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScripting/Blueprints/UserGuide/BlueprintCommsUsage/
Overview of when to use different methods of Blueprint Communications.
Thank you. :)
a multitude of ways to make blueprints aware of each other (collision, tracing, spawning each other, "get actor of class", etc.), and then a multitude of ways for them to communicate
get actor of class sounds useful.
usually a quick and dirty approach but it does work
line tracing like when there's line that hits the object, right?
yeah. Stuff hitting stuff whether directly through collision or indirectly with various traces are common ways for two BPs to become aware of each other
your player character might collide or overlap with another BP, or it might do a linetrace in some direction and find stuff
Ahh, I'll have to look into all of them and see what one would work best for me. Thank you! :)
yeah, it's all very situational
Is there any way to get the current focused widget?
I see Unreal has "HasUserFocus" but it doesn't tell me which widget is being focused
you could try an array that contains potential widgets that could have the focus and loop through it to find the one that actually has the focus. Maybe there's an easier way for that which I don't know yet
another approach would probably be to make sure that your last performed action determines which widget to focus next
There's an OnFocusRecieved so you can just hook into that to update some variable.
how would i get the distance between my character and an AI character
Length(Location - Location)
AActor->DistanceTo(OtherActor)
Doesn't matter, just use what you want.
alright
DistanceTo is prolly faster because it's c++ native but it's literally a zero.
ok thank you
Won't matter unless you're doing like 100 a frame or whatever but moving your system to C++ will get you a 100x speedup
You can prolly do 100,000 sqrt distance checks in C++ per frame no problem.
if i wanted to change an AIs speed based on the distance between it and me would i put the distance to node with tick ? or is there a better way to check and update the speed based on distanceto
You'd do some sort of test somewhere. Tick or a timer is fine for now, you'd probably want some sort of service later, or some sort of other trigger
i want to do it in a behaviour tree but im new to BTs how would i set the conditions
Hey, how weird is that, after converting my singleplayer functionality to multiplayer, the UI works perfectly in client (mp) but not in listen server or singleplayer? ๐
What doesn't work about it?
You probably have some gate on if it's server that's screwing you upt
When using drag and drop, for instance, the inventory slots are not updating in real time, but the inventory array itself (both server and client) are
All the UI functionality is set to client only (widgets can't be used in server as far as I know)
Opening and closing the inventory shows the items that are there
You're probably checking IsServer to do something and that's breaking it
or Authority
since a listen server and standalone are both authority (not sure if both are considered server or just listen)
I don't remember doing that, but I'll give it a look, thanks! ๐
Are you trying to do predictive inventory stuff? Like a drag and drop is instant in client's view?
Hey, anyone here experienced with AnimBP and IK that could spare a few minutes of their time? Thanks in advance
No one can help you if you don't just ask your question
Hello guys. I want to develop an application (that will be running using pixel streaming) in which users can buy real products. anyone of you know if it's possible to set up in-game purchases?
.
.
Why are you spamming dots... just ask the question and in the right channel
It's a link to my previous post in this channel
so what's the equivalent of just a generic class in blueprints? like I just want to build a state manager that is its own entity, what parent would that be in the lil create blueprint thing
Ah didnt realise it was a different message lol
An actor
An actor is just a blank template pretty much
so an actor doesn't imply any physical body or anything?
Actor, Component, or whatever else base class you want
alright cool
It implies a location but that doesn't matter really.
so effectively actor == class ?
Just beware you cant do singletons in bp
Unreal heirarchy goes like UObject -> AActor -> billion other things
An actor is a class yes
no i've been holding references to things in game instance for a pseduo singleton - does that work cuppatea?
An actor does physically exist in the world (with a transform), but it's no big to just drop or spawn actors into the level as manager classes
Ye that works
A component on GameInstance is alright, but you might be looking for Subsystems.
er, idk if GameInstance can have components but GameState is where I've done some singleton stuff before switching to Subsystems.
like lets say I was making a game director thats going to monitor everything and adjust gameplay stuff - that would be an actor with a ref held in game instance?
Actor is fine, it's good enough for Epic
gotcha, thanks for the help
will also look into subsystems and components
just to understand these building blocks
If you don't know what components are yet, just go over the framework again.
i mean i think i do
i meant more the technical implications of them
trying not to prematurely optimize or anything but also trying not to do things the wildly incorrect way
I've got an issue with key input events in two different widgets.
When a submenu is removed from the main menu widget the events from the removed widget (like arrow key navigation) still persist and carry over to the main menu navigation. How can this be avoided?
So mhh, i try to update an Old Quest System from, Ue4.23 to Ue5, looks like its not Working on 4.26 anymore too, not only on 5, was there any changes from Structs?
You can think of Minecraft, when the player starts dragging the item, it should create a visual slot that is dragged by the mouse (which again, works perfectly on clients but not in sp/listen server), and when they drop it, the slot where it has been dropped updates with the item that was being dragged
Internally everything works, and client's UI is updated, but listen server and sp UI's (just the UI's, the variables work just fine) fail to update in real time
You have to close and open the inventory again to see it updated
not sure if this is the right place to ask, but im currently trying to implement dynamic puddles onto my landscape when it rains. I've created the puddles, and when I set my parameter to the desired number, the puddles appear on my landscape, so all is well in that department. My issue is that I'm trying to add them dynamically when it rains, so the longer it rains the puddles gradually appear and get larger. I've instantiated a dynamic material instance in the constructor script, and set the scalar parameter value which gets updated via a timeline, but for some reason the puddles do not appear, any advice would be greatly appreciated
Did you assign the dynamic material or just create it
would anyone know how I can access a float I define in C++ in BP without having to call "Get FloatDefinedInCPP" or something
BP always uses a getter when retrieving a property.
rip, thanks
??? Where. I just see you making it and assigning it to a variable.
Raining should be a parameter in your current material though. I wouldn't swap materials for a rain mechanic
I've misunderstood the question then I think
@finite gazelleYou want this
https://docs.unrealengine.com/4.27/en-US/RenderingAndGraphics/Materials/ParameterCollections/
thank you, will take a look now
Is there no way to copy placed static meshes into a blueprint and keep location?
quick question. is there a way for me to invert orient rotation to movement? i don't want to animate the character strafing left and right but i want the character to walk backwards when it gets a negative forward axis input
Drive the rotation yourself
Is it possible to hide certain variables from direct access by child blueprints?
Private variables
You mean the eye-closed? I tried that, they have access.
No
Private is a different check box
Makes it read only outside the original BP class
oh got it, I see it now, thank you so much!
was really getting annoyed with dynamic materials getting exposed directly to children
with the AI sight config is there any node where i can move the ai to my characters last seen position ?
and then how do i set it to go to the last seen location
There should be an event that you can connect to from the component about a sense occurring. In there, I believe there is a field for the location of the sense. Can save that and use it.
can i do that in a task in behaviour tree ?
Do it in the pawn (or controller, wherever you have the sensing stuff) and have it update a value in the blackboard.
alright thnx
Hello ๐ how could I get the scale of something and change its scale based on a percentage, eg: get scale and increase by 10%
I have created a timer(elapsed time) UI by adding 1 integer per 1 second delay. i am currently attempting to pause the timer after i hit a triggerbox or actor with a box collider but i cannot get it to work unfortunately.
this is what i have so far
if anyone could potentially help me find a solution i would highly appreciate it
Why not use timer by event and clear handle, as I think event construct acts like begin play and ONLY fires ONCE!
i am unfamiliar with how to do it like that
event construst fires once here! adds 1 second then ends, You need a actual node that repeates like TICK OR EVEN BETTER
FROM CONSTRUCT TYPE TIMER BY EVENT
Setting the scale of an object is always in relation to its original size. If you add .1 to the scale it'll be 10% bigger
i appreciate the help AlphaWolf, but i am not so sure. i see that setting it to event tick might help me find the solution though
YES but I have set a map variable for certain actors to have custom scale to fit in a location. so each will have different relative scales
dont use tick. its expensive. you only use that when no other choice
I have always heard that it is.
Its overkill in most situations but not inherently bad
i cant find those nodes
"Get game time in seconds" and "make timespan"
I still think set timer by event and having the looping box ticked. and set the time to 1 second is better.
and when you want to stop the timer use clear and invalidate timer
im not sure id be able to show it by the ui the same way as i have it now?
Timer still runs on tick
or like this
id like the timer to pause on WIN so the player can see what time they got
i dont want it to clear
You're fine. If you ever don't know what a node does or how to use it Mathew Wadstein has youtube videos on all of them
thanks for the suggestion
im just trying to get this done for an assignment of mine due soon
there are tons of tutorials on youtube to do a timer
Id take the 5 mins and look up the suggested nodes. Makes it easier to do the work if you understand what you're doing
Timer by function or event or the game time and timespan
Either will work
How can i make my flashlight be off when the game starts^???
this is the blueprint
set active to none on begin play
i think im just avoiding re-doing the entire thing
Set the light component visibility to false
@tawdry surge@manic vesselwhen i look up a timer, its always a countdown never elapsed time
the only tutorial for elapsed time is what i did with the integers
What is the Get Game Time in Seconds Node in Unreal Engine 4.
Game Time in Seconds are the seconds of game time since the project starts that IS affected by Pausing and IS affected by Dilation.
Source Files: https://github.com/MWadstein/wtf-hdi-files
if its not too much to ask for, id love it if you guys could point me in the right direction
how
i will watch it, thanks
This is why I asked about scale in %. as hard coded scale is causing issues because some actor's have different scales.
Why does this blueprint crash my engine when I try to place it in the scene?
Its on an editor actor. I'm trying to spawn a random actor when I place it in the level. The variants are all regular actors.
Is there anything like event hit that returns when the actor is not hitting something? I notice event hit only seems to fire when it is colliding with something.
did you try in event graph and not construction script too?
I did not. What event would I use? Begin play? I want the BP to run when i put in in the level in the editor, not in play mode.
I had issues with spawn actor in construction script once
I'm trying to simplify my level building by having the engine randomly pick an actor instead of me having to.
IE one of the 6 walls I have
iirc all you gotta do is put your offset in the vector + vector node on the bottom of the screen and plug that in b
Use an editor bp instead
If you want actor spawning at a location
Thats editor utility
You can tell I was thinking this before I asked. I was so close ๐ will give this a try
ah you are right, I picked utility. I'll give it a whirl.
sorry to bother you but
do you know how to get these variables
i am very unfamiliar with them
Is there a way to set the terminal velocity of a Character?
Or more specifically, the maximum fall speed for it?
Just drag it from the list into the graph.
thats not my screenshot. its from a tutorial video
i do not have that option sadly
do you know the exact class name, by chance? I can only find the EditorUtilityActor one.
Might want an editor utility widget i think
Ah. Them being there means that it's not something that you GET, it's a variable that you need to add yourself by pressing the + button next to the variables list header.
But an editor utility actor should work
editor utility actor is what is currently crashing
uhm.. editor utility widget seems to be meant for some sort of UI? I dont see a blueprint section
Is there any other thing that spawn actor
In the editor utility actor there is a section for assets try looking there
Theres a section for editor utility soecific actions
Id hazard a guess that it will be in there
https://www.youtube.com/watch?v=RQx5ctXGQO0
I Have this problem in flashlight
if i dont have the y pitch the flashlight is good and follows camera, but dont replicate y axis movement
if i have it replicates the y axis movment , but it doesnt stick to camera it just goes
can someone help me pls
I mean there are nodes for manipulating assets in the content drawer. Like checkout asset, delete asset, etc. But they take asset paths, not classes to spawn? ๐ค
spawn actor from object seems to work!
I guess it doesnt like spawning from class for some reason
if i am stuck in this node does that mean the current one is nver done executing or that it cant go to the next one
does anyone know what these variables are within a widget
this is what im trying to do
but i have no idea how to make the variable
text boxes?
because the BP is setting text values, and the TB prefix makes sense for it to be a text box
im unable to make them into variables
how do i convey to other clients in an online game that player X's head is turned based on their third or first person camera? the camera components exist only on the locally controlled client so im wondering how to go about it
Bump
Tick is variable on the text in the designer
thank you so much
no problem
now i wonder if i would be able to do a >= 60 to make a minute counter
but its not an integer so im not sure if its possible
just truncate it
for minutes you only wanna show 1 minute even if the real time is 1.793 minutes
could you explain that further? or direct me a little. i am very unsure what a truncate is
truncate chops off the decimal point, both 1.32435 and 1.4589 would become 1 when truncated
also conveniently there is a node called truncate
so if you divide that by 60 it should give you the minutes, e.g. 390 seconds, would be 6.5 minutes, and then truncate it so you only have 6 minutes
if im understanding game time in seconds
which i think i am
How would I shrink a capsule collider from the top first?
Like say if I had a character I wanted to crouch and shrink their hitbox.
would that only work if i made my timer with + 1 integer every 1 second
Shrink and move mesh at the same time
no
you have game time
that gives you the seconds accumulating
so if you also divide that by 60 and truncate it, it converts it to minutes
i appreciate your attempt to explain it further. i just cant bring myself to understand what you are saying and i cant picture how to incorporate this solution
i have given you the nodes
you want to display minutes and seconds, r just count minutes?
the code i have currently counts up the ingame seconds with milliseconds, but it climbs past 60 and continues to increase
was wondering if i could reset seconds to 0 as it hits 60, then add 1 to my minute
not sure if you can manually set game time
but you could always manually subtract 60 - whatever amount of minutes
so until you hit the first 60 it would be game time - 60 * 0 which is just the game time
then after that it would be 60* 1 etc
i think i might just keep it the way it is
Are you adding numbers together to get game time?
i have created 2 different widgets now with different ways to get time and im so lost
I retargeted a mesh to another and made a new animation BP and all works in the game, but only the line trace won't hit the new mesh.
What could be the problem?
i just want the timer to stop when i hit a triggerbox that shows my WIN widget
If you're trying to time something, just store game time in a variable StartTime, then GameTime - StartTime will be your elapsed time. Do math on it for formatting if you want.
thats what i was tryina explain
And probably store ElapsedTime as a variable somewhere so you're not calculating it twice
Game instance or game state or player state or wherever.
i genuinely cant wrap my head around what you guys are saying
Can you wrap your head around the concept of storing time as a float? It's just the number of seconds
this is one of the ways i have done it
it works perfectly fine
and the way i want it
but i cant get the timer to pause completely when i hit a trigger box
which is why i am in this mess
What is this for some sort of a lap timer?
the only tutorials i can find is from someone named Mathew Wadstein but they are extremely unhelpful
poor mathew
Those are the best tutorials, succinct and to the point, and don't hold your hand.
we have given ya the nodes ya need you just need to plug em in
im making a game where i need to platform from start to finish. timer starts on spawn and id like the timer to pause/stop once i finish/win the level
The UI should have nothing to do with controlling the time, all it does is report the news, it doesn't make it.
Put all the time handling stuff in game state or your Pawn or some actor or whatever.
I would probably make an actor for the finish line and have that handle the time.
but then how do i show the time handling through the UI
After all, that's the actor that's going to handle detecting a finish
Your UI gets the time from that actor
i created an actor blueprint that acts as a trigger box
the time tracking isnt done in the ui, they are just getting game time
oh
Okay, put all the time stuff there.
they have got time tracking they just need to format it
Event begin play, set start time. On the trigger, set end time. Event tick, set current time
If they are doing gameplay stuff in UI then shits already fucked, just do it right the first time
Do this on your trigger actor
I mean that can sort of work but it's pretty bad. Number one it relies on game time being the elapsed time, so no such thing as a start countdown or anything else. Also, it breaks when you want to register the finish time.
set start time end time current time
new variables?
yes
all integers too?
nah youll want floats
Yes make those three floats
You understand what I'm getting at here or you just going through the motions?
im so sorry to both of you for the inconvenience. my first time doing something like this
thank you for all the help nonetheless i really appreciate your time
a bit of both i think
i understand youd want to set the end time as current time once the end of the level is triggered
but start time would need to be triggered via another actor?
And CurrentTime = GameTime-StartTime
Begin play
Later you can do it different if you want (starting countdown or whatever)
i think i understand it but im not sure how to integrate it right now
give me a second and ill show my attempt
First check that it's working. Print CurrentTime when you set it and make sure it's going up
@lone eagle
Begin Play -> Set StartTime = GameTime
You want to set the value of StartTime to be whatever GameTimeSeconds is at BeginPlay. It will be 0 or close to it but later you might want to start timing a different way
Then on Tick
Tick -> Set CurrentTime = GameTimeSeconds - StartTime
So every tick, CurrentTime will be equal to GameTimeSeconds - StartTime. This will usually be the same as GameTimeSeconds but might be different if you started later than Begin Play.
Whenever the end level trigger is hit
Event Begin Overlap -> Check to make sure it was the player -> Set EndTime = GameTimeSeconds.
