#blueprint
1 messages ยท Page 238 of 1
Yeah somewhere in there, thats a mess lol
Think in terms of rules
right now your rule is "When triggered, find a door with a matching tag, and do stuff to it"
in this system, your rule would be "When triggered, tell MySwitchableComponentRef to do its thing"
doesn't care if the final thing is a door or a P block or whatever, all it does is talk to the component that it cares about
the component tells its owning actor through that dispatcher, and the owning actor does whatever
is this better
A bit better. All the state (is pressed, reset delay, etc) can live in the switch or the switchable component, your choice
Either way, the switchablecomponent has to know when it's been activated and deactivated (by resetting)
so what do i do next then
I'd probably lose the OnSwitchActivated interface call and just put the logic inline
when it activates, tell the component
when it deactivates, tell the component
so add the interactable component to the switch's blueprint?
no, to the thing the switch controls
just like interaction
the switch BP should have a REFERENCE to an interactablecomponent
which you can set when you place it in the world
so it knows which component to talk to
Out of interest if I modify bones in the anim instance is that more or less expensive then just having an animation doing it ?
Probably more
whether or not that matters, depends
Hmmm it's cause to easy my workload some skeletal meshes I'm not animation and instead just modifying bones in the specific times needed
Like I have a door for example that literally goes up and down and rather then animating it I'm just using modify bone in anim instance to interp it to a new relative location and when it's reached it stopping modifying bone
The perf hit is probably just from doing stuff in BP and from doing it on game thread
But until it's a problem, it isn't
nevermind my code was out of order
Would it be on game thread if the logic is running on anim instance ?
do you mean in AnimBP
what do you mean by running "on anim instance"
Yeah haha sorry been casting to anim instance today so that's in my head
Anim bp is what I would mean though
might be on anim thread if it's not warning you and you're not doing anything outside of animation
ok so call an event on that component ref when the switch is triggered
how do i do that
Didn't appear it was giving any warnings
Drag it in and right click
the same way you do anything to anything
no i mean where in the nodes do i put it
Is there a way for force it to run on another thread other than game thread?
Just thinking further down line if I have to do anything to change things
AFAIK stuff in the anim BP runs on the animation thread assuming you don't make it not
and assuming you use the correct events etc
I believe so
Is there even a way to do that
Yeah, just move a component or do anything else that modifies the world
I recall it warning you if you were doing stuff to force it to run on game thread
But I don't really do animation so not sure
drag off the blue pin and poke around
That's the event you want to call
Sure, if a cast is enough info to press the button
put it wherever you want to tell the thing that the button got pressed
but you should have made a ButtonActivation component, idk why you're reusing your InteractionComponent here
so what am i doing ๐ญ
You presumably don't want to walk up to a switched thing and press E and have it act like the switch got pressed
make a ButtonActivationComponent
inside the switch blueprtin?
ok
I mean you could just reuse InteractionCOmponent and give it a bool like ShouldUseSwitch or something but that's too complicated for now
I was talking you through Interaction as a simpler system that is very similar
Sure now just do the same thing as the interaction component. It's all the same, the only difference is how the component gets told to trigger
the InteractionComponent gets told to trigger by the player pressing E and figuring out what InteractionCOmponent it wants to talk to
the ButtonActivatableComponent gets told to trigger by a switch being stepped on and telling the ButtonAtivatableComponent that it cares about to do its thing
thats it
the rest is the same
so call the button component in the switch blueprint?
yes the switch BP will call an event on its ButtonComponentRef
it does not own or have a buttoncomponent, it has a reference to one elsewhere. the ThingBeingControlledBySwitch owns the buttoncomponent, the switch can just talk to it
so reference the buttoncomponent then setup the event?
sure go for it
so i make another event inside the buttoncomp one? then set it upo like that in the switch blueprint?
Yes
I'd have named it something different but you do you
ok now put a button component on some BP, and drag a button and that bp into the world
so add the buttoncomponent to the switch or thr thing i want to control
I am in a bit of a tangle with an issue. I am trying to modify a struct boolean which is inside an array, inside of another struct inside of a map. I use Set Array Element for this, but for some reason the change is never applied. What could I be doing wrong?
Am I correctly understanding that Actor Components' BeginPlay will always run before their parent actor's BeginPlay?
Thoughts on how best to implement -> I want the player to only be able to check one of the available boxes (the ones already checked cannot be unchecked)
I can probably just have each one set a bool on check and set the rest to uncheckable if the bool is active - seems the simplest
Anybody got an idea on what might be wrong with this?
I am currently working on a VR project where I'm trying to dynamically deform a mesh inward along a spline. The spline is attached to an object, and I want to either deform or remove the section of the mesh near the spline points. However, Iโm having trouble identifying the vertices that are close to the spline and applying the deformation or removal effect.
Could anyone guide me on how to achieve this? Any help would be greatly appreciated!
No, since components cannot exist without the actor.
They will fire before an override though
So if you're putting logic onto your begin play in blueprints, your components will have begun play
Is this true of blueprints as well? The reason why I bring it up is that I have a player controller BP with a UI manager BP type of class as its actor component.
For some reason the UI manager's BeginPlay always fires before the player controller's BeginPlay when I put a breakpoint on both in my BPs, even though the player controller is its owner.
You appear to be getting a copy of the struct there initially, so the changes won't be reflected back to the map
As mentioned, components will receive their begin play before actors in blueprints. C++ muddies the waters a bit.
Though, a little tip, the engine has a nice UI manager for you built into the framework already, the HUD class. It used to be the only way of drawing to the screen but now functions as a nice local only place to keep your widgets.
Ok gotcha, thanks for confirming.
And thanks for that tip. I read in a few places online that the HUD Class was deprecated and was the old school way of doing things, but sounds like it's not actually the case? I'm not sure why we're not using it, instead triggering things from the controller.
No, it's definitely not deprecated. You'd get warnings for using it if it was. It's still a core part of Unreal's gameplay framework.
Essentially the HUD class is a class that only exists on clients, which makes it perfect for widgets, since they aren't replicated.
The whole "deprecation" thing is a bit of a misnomer, but stems from a lot of it's functionality which is old remnants that aren't super useful now with UMG. Some of it can be, but most of it gets ignored. The class itself is super handy though.
MyAactor->USphereComponent -> UStaticMeshComponent
How can I set velocity in unreal?
Mesh has physics
Need to make it so it doesn't move currently.
Equiv in C# Unity
Figured it out lol
BallMeshComponent->SetAllPhysicsLinearVelocity(FVector(0, 0, 0));
Unless someone here tells me that is wrong ๐
Wrong channel but yeah itโs probably fine
fasfas. Thought I was in CPP. My b neo ๐
guys, what is wrong with it? :/
read the error at the bottom
yeah, I see it, but it didn't change ๐ I didn't rebuild source, it's delegate from CPP. for some reason it doesn't like it when it has TArray in it, I remove TArray and it works just fine. Very strange
Make sure the TArray is const&
Do y'all prefer to receive inputs in the Controller or the Pawn? I'm trying to be less noobish with things like this and it seems like Controller is the more proper answer despite all the beginner tutorials teaching me to just slap it on the Character. Also seems like having it in the Controller is more scalable
I'm sure the proper answer is "it depends on the game" but I'm just making a pretty conventional singleplayer third person shooter, nothing weird at all
Iโm pretty sure slapping it all in the player blueprint is fine.
For large scale or multiplayer games I highly recommend using the controller as it just makes your life 100% easier. Learned it the hard way.
Thanks! Trying to save myself from the hard way haha. I think I'll do the Controller
yo guys I need some help, I tried a lot of thing, but the error "Blueprint Runtime Error: "Accessed None trying to read property FlashLightActor". Blueprint: BP_ThirdPersonCharacter Function:Execute BP Third Person Character: Event Graph Node: Toggle Light" It's making me a lot of headache. What's wrong with it?
Accessed None trying to read property ...
this error means that the object you are trying to reference is null. that means reference doesn't exist
probably because you didn't conenct this here
Happens to the best of us haha
in general, anytime you try to access an object, and it's value is null you're going to see that error. It's best to look around and determine why the value you expect to be valid is returning as invalid (null). usually these bugs are quick to solve ๐
hey guys I have a question. The generation loads in game every time you near the edge of the map. The problem is that when i pause the game to load the mesh. The meshes load fine but when it unpauses, it stutters for a few seconds. Can i move that stutter to when the game is paused?
How are you you loading this mesh, whatever that is
It checks for empty space around it by trace. If it hits something then it dosent spawn there and vise versa.
It stops spawning by distance and the game is paused for 10 secs to accomodate.
I see it loading the meshes just fine with no stutter. its only when it unpauses. it confuses me since the mesh is already there.
You didnโt answer the question
Blueprints
Are you just spawning it directly ?
yes
This is not a great way if the mesh is heavy perf wise
Use Async Load Asset first
Then when successful spawn it
its a plane. with 1024 texture
The texture
Whatever it is that youโre sync loading and pausing the game for 10 seconds for
im not familiar with a sync loading.
Additionally, you should do actual profiling to see what precisely is causing the hitch, cause for all you know it could be something else
I gave you the node name, itโs pretty straightforward
ill check it out
And ultimately if things take too long to load in bp, cpp is the way but yeah
Not sure doing cpp by itself will make stuff load faster ?
if most meshes spawned only share a handfull of materials, they're not gonna drag you down
Async loading is ofc still good practice . Pause in the game sounds pretty awkward from a player perspective
~~what about starting to spawn them preemtively? Without a game pause ~~
the world spawns as you move
so whats the pause for
clean up for meshes that are far and spawning new tiles
I figure just having to go through the vm slows you down a little but yeah it might not be noticeable
Guess there could be a theoretical gain. Generally the VM should just call some native function that handles all the spawning stuff
cant seem to be able to get the bounding box Extent of a 3d text
it just returns 0,0,0
is there a simple emote system (w audio) one can build, im not sure how to go about it
is it possible to change a mesh material at runtime?
im using the Set Material node, its being called but the material on the mesh is not changing
see in youtube about creating dynamic material instance and then setting the material .. this should work
RPC events should do, but i think in marketplace too, there are couple of assets maybe providing this
Start with the requirements. Write down how your Emote System should work, what it should all support.
How the Player will actually use it. Doesn't have to be technical at that point.
After you are sure about what you exactly want to happen, you can start looking into how you can get each part of your requirements into UE.
thanks, was just thinking the same thing too. going to start and break it down ๐
Yes, you should be able to simply call SetMaterial on the MeshComponent.
MAAAAN HOW I DIDN'T SEE THAT? Thank you so much my man!! ๐
You could try increasing the mass of the bike or lower the push force of the player on the character movmenet component. Possibly a combination of the two.
just figured out that the errors were caused by not having the parent call in begin play
I tried with the mass but it was still moving
the mobility options should work
what do you mean visible ? Like you have no static mesh in the property so that's why it's invisible in the 3D viewport.
That variable on the left, you can't press the eye icon, because that variable is generated for you because it's corresponding to the component you added.
So you can still use it in your blueprint graph to get a reference to it or set a static mesh to it.
Hi all, quick question how can I compare two different size array? Time Slot Array has more elements compared to Test Array. Thanks a lot
i removed a camera shake from a camera and it's still being applied to the camera itself. anyone know what's going on?
Design Theory question - two checkboxes come automatically checked (and set to not hit testable), the player can click one other checkbox. I'd like for ONLY one other box to be checked. How would you handle it, fine minds of hashtag Blueprint?
I feel like I ought to have made the checkboxes their own widget for casting purposes so I don't have to drag 6 options everywhere
Just have an array of them and identify each by their index in that array
oh good call
By far not the only solution tho
well, my solution was a LOT of logic code, and I identified it could be more concentrated, I just couldn't imagine how
For this, if theres always only one you can select, store their index in a var, then create a general update function that loops over that array I mentioned, and sets IsEnabled to whether or not the current array index equals the selected one saved to the var.
Click checkbox->store its id->update function
Hope it makes sense, typing from phone
(not isenabled, ischecked or whatever it was)
yeah, it does - I was going to do integers, but without the array it was the extra work
If later you make it a variable amount of shown options, you can always turn the array (with fixed indices) into a lookup map
I am for sure implementing this incorrectly (just kind of thinking out loud like I do) because I'm checking each box in the array to see if it is checked and two of them will be by default - unfortunately I can't just remove the default ones from the array because I'm using a switch on int to track which stats are checked
I guess I can make 3 int variables, set the default checked ones when I check them, then do a != on the 2 defaults
@stable birch can you explain it here please, I do not want to bloat the #cpp channel with blueprint topic
If you're not familiar with Sets (Ie the data-structure) do a brief readon them
Learn how to work with Sets in Blueprints.
^^UE docs for working with sets should explain everything
okay Thanks a lot!
i have a ladder bp set up and i can scale it on the z axis to add length, now that i have it setup i wanna make it actually climbable, when the player hits the collision box they can move up and down the ladder then when they exit the collsion they regain full movement
Hi! I'm working on a lock-on targeting system for my 2D game and want to rotate the player's aim by changing values between -1 and 1 on both the x and y axis (just like how movement is handled normally) since this makes it possible to re-use the same code for targeting as if the player was aiming manually. How can I translate the target rotation degrees into values between -1 and 1 och both x and y?
Anyone know what happening here, the target value is 85 yet for some reason it seems the value goes way past that
am i using the interp to constant correctly ?
I would have thought the door speed would simply speed up or down the interp rather then it pushing the target value just not right
Maybe you rather want a Lerp and not an interp?
Interp will try to reach Target while it's active. If your Current Value goes higher or lower from a different place, Interp won't magically stop.
so i've identified that the duration that the metasound is giving me is -1
not 1
Well or that
question is how would I get duration of the sound from metasound as even though it might not be cause of the issue it's a good thing to look at
Fixed Set of ints
Or array, with AddUnique
tbh I might have to retool the whole mf thing
๐
Combo boxes got me flustered so I figured I'd try it with checkboxes and that's almost worse
is it alwas 2 checkes, 1 free choise ?
Gues i'd just have a list of checks that follows the ancestry
well, the "ancestries" is, the "free" one is 2 free choices
which then are locked
while the others are from avaliable extras
(or mandatory extra, idk)
anyone ever used the Watch Output that Meta sounds provides ?
How do I get the actor hit to be knocked back awayfrom where they were hit.
This only knocks them back dependent on where the player is attacking them from. sometimes they will just only move up and not away.
Geometry Script - Apply Displace from Texture Map issue
I'm having trouble figuring out this issue. First, I successfully save the image that the player draws using a widget BP to the local storage. Then, I use "Import File as Texture 2D" to load it as a textureโthe image loads successfully, and I can display it on a widget. However, the image does not apply correctly to the geometry script node. Any ideas?
maybe someone will know >> #multiplayer
This isn't doing anything can anyone help?
try connect "Started" and "Cancelled" to FlipFlop Input
both
or Started and Completed
hi i wanna move spline along Z with up and down arrows
this should be working but i get only movement +1 not -1 why is that? thanks
i get 0 when printing screen on Y
better but there is a strange delay
nvm just had to unlink cancelled
Hey Im using a flip flop to swap between two sequences I want to play out, but whenever the sequence is done I want it to reset to always starting with A and not B. Is there a way to do this or a different blueprint I should be using instead to get this result? any help is appreciated
so why use a flip flop if you only want A to play?
I want A to play, and then B, and then A again, and so on, but I want it to always start with A, its in a sort of looping sequence
and so when its first triggered I want it to always be A and not B
and then if I could reset it after its done looping
a simple way would be with a boolean/int and a select node
idk if flip flops have resetting capabilities.
but if you do it with a select node, you can just create a variable (int or bool. int is more extendable)
your var to the select node. and there you can select which sequences to play
when the sequence is done, set your variable to the opposite of what it is now.
if you do it with an int, then you have more control
0 -> play this sequnce
1 -> play this other sequence
2 -> play this third sequence
and you just increment the variable % #ofSequences once each sequence is complete
and whenever you're ready to restart the sequence playing, just reset the variable to 0
you can also dump the select node and instead just create an array of type sequence
alright I think I get what ur saying I will try this and see if it works
appreciate it
yep that got it to work, thanks again
Why is get anim instance writing random montages on get current montage?
is there a simple way to so this? i also wanna be able to copy the climbing when hitting the trigger to any other blueprint i wna make climbable
I made a scene in blueprint, some static mesh components and lights, no code. I found it very impractival and would like to move that BP content directly to map. Is there any way, so I don't need to redo all meshes and lights? To unwrap this out on blueprint?
you can either create a base actor ladder with a swappable static mesh, or you can create a component to allow any actor to do this
id like to do the second but idk where to start
look up any YT tutorial for making a ladder in unreal.
I don't know if there's a way of breaking down a bp automatically, but next time, you can do it with packed level actors or level instances
Yeah, I found out, but I need to fix this BS ๐
you can think of them similar to unity's prefab system
yup.. sorry I'm not sure.
you can definitely make a script to go through and fix that for you , but it'll likely take you longer than manually doing it yourself
how can i swap the player blueprint being used in a specific level to a duplicate i have
you can configure the default pawn class in the world settings for each level
I'm working on a component so I don't have access to a timeline, what's the right way to lerp a value? I want to lerp, but the change I'm doing happens in one frame.
Is this safe? I've got a latent function callback using an input variable to the macro call. It works as intended it just feels off...like I'm going to get to a packaged build and it's not going to work as intended anymore ๐
having some issues with gameplay system
I have an ability that deals a damage effect and applys a debuff effect
But tryActivateAbility doesnt allow me to specify a target
Is there a way to not use events for this? If i have 100s of abilities I dont want to create an event tag for every ability if i can avoid it
there is a node like this one 5.5 hehe
is there a way to add a lot of padding to a horizontal box, but only between the two middle children?
I ran into something similar a while back, but it was because the camera was not directly attached to the skeletal mesh.
might not be the issue since you are not giving a lot to work with. Make sure the camera is actually attached specifically to the thing thats rotating. When you wake up and at it again, if you still can't figure it out ask again in here with as much detail as possible and some code examples
why does my physics handle fling objects around like theres no weight to anything
"Use an Interface" - I don't like that part.
That's still a cast in the end, and I have seen too many projects where Interfaces are used ON MASS for classes that will only exist once in form of their class.
People using Interfaces to call Functions on the PlayerController, called BPI_PlayerController and sh*t like that.
Trying to avoid the "Not always loaded" via an Interface is, imo, not the right way.
I'm not even sure if the Reference Chain of the Interface doesn't load the implementing BPs too.
Also casting isn't that bad that one has to start comparing Classes and Tags to know the Type. It's totally fine to cast. If the main reason for the avoidance of the cast is to not load the class when opening the BP that contains the cast, then comparing Classes and SoftRefs is fine I guess.
I'm just really not a fan of people using Interfaces to avoid Casts. For someone who has no idea about this stuff, this is leading to over-usage of Interfaces.
This only really makes sense as a suggestion if Interfaces are fully explained alongside that.
If you feed widgets to a scroll box, will the scroll box auto scroll with the children by default or do you have to set it up that way
Anyone know?
Hello Unreal community,
Iโm trying to implement a smooth transition between standing and crouching using Blueprints in the Unreal Engine Ability System (GAS). I want to achieve a gradual animation of the camera and the player's capsule by interpolating (Lerp) the Alpha value for the transition. Iโve attempted to set up a custom ticking system to update the Alpha value using FInterp To, but this approach is not working as intended.
Additionally, I can't use a Timeline node because the ability is implemented as a UObject. I would appreciate any advice on how to properly achieve smooth interpolation between positions and capsule size while using Blueprints, ensuring a fluid transition even if the ability is interrupted. What is the best way to set up this interpolation in Blueprints?
Thank you in advance for your help!
hey guys im trying to build a time without event tick and being channeled by an event any help would be great!
What's wrong with event tick?
hook this to your custom event
this is for the cooldown of powers in the game and i need to make multiple and i dont think i can use just one event tick
well maybe with a few branches i could now that i think about it
it is currently hooked
I just want to add, what people often miss with interfaces is they too have to be loaded meaning anything the interface uses has to be loaded as well. If the interface is used in multiple places it can make it harder to control when said things are loaded. Granted you should probably avoid using class specific object refs in interfaces though.
As for the image, it's from Ari's myth busting post as part of unreal fest.
Yeah I figured that it would load stuff.
Ari's "bust" is more towards if casting is good or bad, not when to cast and when not.
A lot of peole just don't know that casting to a BP class adds a hard reference dependency between the Caster and the Casted.
The flow diagram I commented on is good, just the Interface part itches me the wrong way.
You should encapsulate the ability to an object. The timer can be a part of that object.
I would recommend just using GAS tho, such a nice system for abilities
Partially cause I looked at a Customer's Blueprints a few days ago, and one of their junior/intermediate programmers that isn't on the project anymore plugged interfaces for literally everything and now it's super hard to even find the callsights and implementations properly.
sorry but does that work in ue4?
Yea, the same. I would have possibly said something like consider using an interface with a *. I would probably opt for a base class or component over an interface.
I laugh because I did this when i first learned about interfaces and very quickly learned what about idea it was. Over using them just makes it so difficult to follow whats actually supposed to happen.
They are over and underused.
Funnily enough
If one goes a bit away from UE and its C++ tutorials, and looks a bit more into different Design Patterns for C++ and maybe even C#, then the usage of Interfaces becomes a lot different.
I currently have a bigger Building System which I'm annoyed of that I should have used Interfaces for. But not for Casting Reasons, or for "Multi Parent" stuff.
Mainly to disconnect the actual Implementations from the "Declaration".
I guess it falls into "Multi Parent" fwiw, but it's not a reason such as "I need to interface with Actors and Characters".
nvm looked up how to do it thanks for the help
But rather "I want to be able to make anything a BuildOperation and freely swap them out for Functional Tests etc."
@prime fulcrum 4.22 above I believed.
I guess that's hindsight. What you wanted changed after you were already too deep. I've been there a few times. What's you're building system like? I was thinking about starting one last night after watching Tiny Glade lol. (Probably don't have time though)
As a non GAS solution, if you need multiple, you could have an array of floats. (or possibly a map) The timer just takes all the values and decreases them by delta time every tick. When you need a new cooldown, you just add it to the list with the starting time. You could include event dispatchers that fire when a time reaches 0 and returns the index (or key) of the cooldown.
The timer would become stop if the array/map is empty. When you add a new one, if the timer isn't active, it'll start it.
I will attempt this if gas doesnโt work im kinda curious about this plugin
It's not very complex in theory. There are BuildModes that can be Activated and those have BuildOperations.
BuildOperations are the actual thing that manages the Building process (claiming tiles is a BuildOperation fwiw).
Reason it's split is to ensure some of the BuildModes can fall back to Claiming Tiles if the player hovers an unclaimed tile, while others are locked into their single BuildOperation.
The problem comes up when starting to split the Operation for Structures into different types of structures and then later noticing that Presets for this cause a DiamondShape ๐ฅฒ
Sounds pretty cool. Have you got any dev footage showing it in action?
If you have widgets in a horizontal box and clear children from that box. Is this effectively the same as removing the widget from parent?
Purely in terms of performance. I assume it does, but wanted to make sure.
so i have a signpost actor with a trigger and ive set it up to rigger the ui, but now im stuck, im trying to recreate the text boxes from mario 64/mario galaxy when reading a sign post, i want it to be customizable to have "pages" depending on how long the text is, using my interact input to move through them and then close the text box once the last page is read.
how would i set this up? what would be the best way to handle the text for each message as well
knowing how to work with array is a requirement here.
if you never used one, now is the time to start
i have i have the array set up, this is what i tried to do, but i am not sure lol
this make no sense and a sure mistake
you want to check the length of the message array
so if there's no more message to show, remove the widget else display the next one
and as a side note, having inputs in the Sign post blueprint is terrible
ok, i dont know what im doing lol
how do i check the length of the array?
drag from the array and type length
thats the widget blueprint the signpost one itself only has an overlap and add to viewport
that's also bad, normally you handle inputs from your controller
having inputs all over the place will be a debugging nightmare
so like this, ignoring the input
the rest of them are in one spot
well set it up then?
call next page on button click or w/e
you are the designer
Interact with Sign post -> Display Message
Interact On Page -> Set Next Page
i wanted it to be u hit the trigger, a widget pups up telling u to press the interact input to read it, then the text box pops up and freezes the player till the finish reading it all using the input to move through the text
what do you exactly struggle with? try to breakdown your problem one by one
how do i set the messages up to fit in the pages thp
right now just display the message and go to the next, don't worry about freezing the player
evrything after spawning the ui
i have been but ok, i have it set rn u walk up and the ui shows, i dont want that, i want u hit the trigger and it gives u a promt telling u what to press to read, then spawns the text box if they hit the input for it, how do i do that
You can shoot a linetrace from the camera from the player everytime it pressed a button (lets say for the sake of example, the E Key)
there's a lot of ways to communicate with what ever the trace hit. One being interface, the other component.
im so confused
well first, decide on how you want to interact with objects around your world
there are many ways to do it
you will need a solution that fit your requirement
you said you want to walk up and the ui shows, but how? you need to be more detailed
Eg If the camera look at the sign post, a UI show up.
Then you can shoot a line from the camera towards it's forward position and if it hit the sign post, you can show the U.I
Or another interaction on some games, people just walk up near the sign post and the U.I will show up
i have been i said, like mario 64/mario galaxy
Hey guys!
Is there functionality to use this liek Steam Sessions or something?
Or if not, any tips on how to acieve that? Or what it's called so I can google on it?
It's like the Friends activity ingame?
a bit unclear, when the U.I pop up, try to move the camera while keeping the player still. If the U.I still appear even after the sign post is not at the centre of the view, then it's region based, not line trace based
?
In a state machine how can I wait for an animation to finish before transitioning to the next state
actually since you just started, just dive in to make one. If it doesn't fit your requirement, you can also adjust.
Start with this https://www.youtube.com/watch?v=5-UJT4U-jeg&ab_channel=MattAspland
Hey guys, in today's video I'm going to be showing you how to create and use a blueprint interface. In this example, I will be creating one to interact with different blueprints as my player character.
#UE5 #UnrealEngine5 #UE5Tutorial
00:00 - Intro
00:19 - Overview
00:5...
Get Time Remaining Ratio
add that as one of the condition
i have one set up to press e to interact, do i need to add more?
look at the Third Person Template Jump condition if you need more pointer
So you already have interact set up? you are confusing me
do you even watch the video, I just posted it
i have an input set up thats what i have, w it being used to interact w a few blueprint actors i made already
Thanks for the reply - I've tried that but not sure how to get it to work
watch the video, in his example, whenever he press a button, it checks for overlaps.
So you can have this imaginary, sphere region around your player. When the player press E, it will gather all the actors that implement the interact interface and run interaction event on it.
you should check with something like <=
Also it's time remaining Ratio not the remaining time
So what you can say there is, if there are only 2% of the animation is left, we can move to the next state
is this is an animation bp for a transition ?
yes sir
you can just do auto
Where?
i think it's auto, but you want it to transition out when the animation is finished right ?
as long as your checking the same one you started
i'm compiling shaders, but i'll post it in a few
if you can interact with others, why not just use the same way ?
atleast to get it started
i tried they said having the input is terrible so i got rid of it
but maybe some arrays, where you can split the message up into sections of the array and just loop through the array and the end of the array is the end of the message
i think it was more where it was, you can try the same thing but put the input on the character or in the controller
one way to do interact is keep a variable of what you collide with using collision box, when you collide set the variable to the item your colliding with, then when you hit e check if the variable is valid, invalidate it when you leave collision
but probably some arrays would work, unfortunately you can't have array of arrays
but you could just have a variable on the item itself that you interact with
so a sign would have a variable like document or something that is an array of pages
you could also just have a long string and try to break up into pages automatically
that would be easier to maintain
and add/remove stuff change page size
i would definately try to break up a string, this way you have much more flexibility, a little more overhead because you need to translate it into a new array and break it up, but much better imo
where you would just say pageSize = amountOfCharacters
well i attempted to follow the tutorial and now i just get an erorr
whats it say ?
so the widget isn't popping up ?
no
show where you have the keypress
ok so that is the definition in the interface
but you need to implement it on the item
you don't
try right click, search interact
i do it, it errors then made a custom event instead
screen shoots the video where he add the interaction interface
if you found it, you should already have your answer
i followed along w the video
that's not what he does tho
Any idea on how to have a character be knocked back, away from the attacker when hit?
The second picture kind of works, but if the person about to be hit and knocked away is starting an action, they'll rubber band back towards the player.
I never need to restart unreal to add interface
congrats, i often need to restart it to fix node issues
just make sure the actor implements the interface, if it does, you can look on the override function, the list of interface functions
such as?
blueprint is pretty safe for the most part
things erroring for no reason
its happend before, or shit will freeze
i have this now
you will probably want to interrupt the montage, or at least don't enable root motion
just don't apply root motion on knocked back montage and nothing should be fighting it?
surely not because you restart
most likely just haven't hit compile
for the attacking animation I want root motion to be enabled as that allows attacks to move the player.
The player getting hit is getting their animation interrupted to a different animation.
compile, save, compile save, etc...
i did restart.... but ok
so now atleast the widget is showing ?
You simply haven't hit compile. Save your self sometime before praying restart fix things next time.
yea it shows now when i hit interact, and then stays on screen
Don't see any rubber band from the video
well only this logic is run when you interact with it
so before you get "pages" to work i just make it pop up a message that you can exit out of
so then you have a popup with a message, and you can work pages in there
first attack in the video. The enemy flies backwards than forwards.
how do i make it exitable
one way is to create the widget if a reference is invalid, and if the reference is valid remove it
so you create a variable and set it to the return value of create widget
if it's invalid
so make anew variable thats a reference to the widget and use that?
and run it on interact
so that if it's valid, you invalide it and remove it, this way the next interact
it will open up again
idk if remove from parent "deletes" it
or if your creating a bunch of widgets
put it before create widget or after?
wdym ?
replace the logic with your logic
just do the isvalid and remove set
and replace the create widget stuff with your create widget stuff
it's not really copy paste able, it was just a demo to show how you can do it
so this?
ya but your lines are wild, you should make them overlap less
oh wait you missed something
you need to set the variable after you create to the return value
and don't cross execution like that
it's usually not a good idea you can get some invalid values
try that
it goes away but dosnt let me read the sign again
because you set both
you only want it valid on one execution
the one where you create
you want it invalid after that so set it do nothing
when you remove
you set both to a valid state
oh ok
is there a way to improve performance in a huge blueprint? each time I connect/disconnect/swap something out, there's a 2-3 second stutter
its letting me now
so you can open and close it ?
is the placeholder text hard coded in the widget ?
now i would make a couple signs and see if they all work just because i like to test things lol
you can add a variable for the text
so that each sign has it's own variable set to a certain text
yea i kinda wnated it to have the widget be set with prewritten mesages and when i place a sign i can pick what message it will show to the player
adding multiple signs breaks it a little
after reading them in a row the widget no longer shows
even tho i have it to go away when they hit the input again, if u hit another sign when theres still naother one active neither will go away
make sure they are spaced out enough that your not overlapping two
so i don't know why thats doing that lol
but in any case what does update text page do ?
nothing rn, i didnt get that far
i would assume it would just switch considering the ref is a local variable to each sign
its not doing it now as long as u finish the text box u started at the same sign instead of interupting it w another
i can see what would happen you open one up, then leave, it's not in the overlaps anymore
so when you loop through your overlaps to interact when you press the button
it doesn't interact with the first one because it's not overlapping so it won't close
ah
probably if you interact then move out you can't close it
you need to be overlapping
well the freeze movement will fix that later once the messages are working
right, you can do that with pretty much a boolean
the freeze have a isreading bool?
do i need to setup the text and pages first?
any idea on how to trouble shoot this. root motion isnt on the hitstun animation.
possibly with a variable as a state, that transitions and runs the knockback in your anim bp @storm solar
i don't think it matters which order you do that in
so after the interact event set can move to false
and in your movement only actually move if canmove is true
where am i putting it tho im confused lol
put it on the character
just a boolean
do you know where your movement input is ?
and then plug into the overlap for the sign trigger?
character blueprint
first thing you need to do is actually have a boolean that can stop movement
you can just set it up and test it
by setting it to false and so you can't move
but inside you character bp, where you move
just use a branch on the execution
that only runs if canmove is true
like this
i can still move
if can move is false
and you can still move then it's not on the right execution
or you didn't compile and save everything
it works now
compile and save before you run
but you can set it to true so you can move
but now you know it works so you can figure out the way to implement it easier
without having to worry if that actually works or not
you need a reference to the player
are you going to have multiple players you can choose from ?
is it multiplayer or single player ?
single player but theres levels with different player blueprints, some levels are 2d sections, some are like super monkeyball but only the main platformer thirperson blueprint will be interacting w signs
so you need a reference to the player
in your sign, so you can set canmove
one way i do that is on begin play of the sign, get player character, cast to player, promote to variable
you'll need to cast
i like to do it once on begin play
but you could do it in the interact it just makes more sense imo not to
but ig it doesn't really matter
you need to cast
then promote to variable
i just fixed the text, i missed that part my fault
cast on begin play?
from the get player character return value
cast to your third person character
then promote to variable
so that you have that bp and can access it's variables
the second one
ok
now you have the character in a variable so you can set canmove
get the character ref, drag out set canmove
so i have a question if I have a wav that is 15.7 seconds long and I want the interp to constant to match then length in terms of it takes 15.7 seconds to get to it's target what math would I do
execute it after the charater ref or in the interact
so when you want to stop it is when you interact, and turn back on when your done right ?
yea
so just put it in the code in the proper places
I've tried doing door speed / The amount to travel and the other way around but I either get it being too quick or well too slow
ok
like on extreme to the other
yes you can use the same variable or make another one, just put it on the execution of the camera movement
anyone able to help with my issue please ??
now how would i setup the text, ik i could make the array but am i able to make it so i can select what text from the array each placed sign uses,
you could have an exposed variable something like selection that is the index
and when you begin play, load that index of the array
i'd probably put the array in game instance
how would i do that
did you start with a template ?
you can just create a new instance
it can be empty
then you set it as your instance in the project settings i think
create a new game instance class
i used the third person template
I love when chat gpt constantly tells you something that doesn't work at all, please anyone able to help
ok i did that
if you want over a period of time why you need interp, maybe a timeline or timer @narrow sentinel
i'm doing this in the Anim BP
you can't use timeline in their
now set the project game instance class to the one you created
I can use set timer by event but still how would that would cause I'd need to still ensure the door bone ends at right place
this is your instance ?
like a shrinkwrap
yea
now you can place variable in there as an example just make an array of strings
and populate a couple of messages
now at the bottom right add a couple brief messages
on your sign begin play
get game instance, cast to your instance
and promote to variable
now you have access to that array through that reference
you know in your widget where you hard coded the message ?
now you want to actually set it
luckily you already have a reference to the widget
so lets say I did it with a timer, how would I use that in my situaion cause I still somehow need to lerp or interp the current bone loc to it's target loc at the duration of the wav playing
i c so you want to open a door to the exact time of the wav sound ?
in your widget, mark the text box as a variable at the top right check box
and set the name to something you can remember
in here?
well thats a way to test it
but i wouldn't do each page is an element of the array
this would require a bunch of different arrays
and you would have to determine which one you want to use
thats what i originally had i can redo it for what is now made
i would make each message just an index in the array, and try to break the message up into pages later
get game instance, cast to your instance, then get the array
but since you already did this
just use the reference you made on begin play
yes from the instance
the reference you made on begin play
drag out and get array
oh
do it ther or in the widget
since the text box is a variable
and you have a reference to the widget
i would just do it on interact
load the proper message
since your using update text page then ig yes, you see where you have messages ?
and you where using that array ?
just switch it out with the array in game instance
wdym it won't let you ?
it dosnt let me get it, they dont connect
i did
and it shows the array ?
yea, then it dosnt connect
connect to what ?
it says is not compatible
Is it possible to call the completed delegate with auto blend out disabled?
I want to hold the last frame but also call a deligate that tells it's working
you should probably look into nodes and how there variables work, thats not what you want to do, i mentioned it a couple times you drag out from the instance and get the array
and i did that and thats all it did
delete those two nodes
drag the as game instance from the left onto the graph
what does that look like ?
u said to do it in the widget, the as game instance is in the sign
no not in the widget
in the sign
thats probably why it's fkd
the widget all you need to do is set the text box as variable
thats why i asked
in the sign you have all the refernces you need, and is where you interact
still wont let me
well thats how it works
you drag out from the game instance
and get the array
you shouldn't be connecting anything
you "drag out" and "get array"
it will auto connect it
and create the node
replace "array" with the name of your array
?
maybe make it instance editable but it shouldn't matter
thats weird what does the note say on the cast to your game instance ?
says i dont need to cast
you cast to game instance,
cast to "your" game instance
the one you created
should probably look into casting a bit as well
and how that works, because your probably going to use it a bit
there it is nice
i usually have only used casting to my character still learning
ya you want to cast from one thing to another, if you want the specific variables you need to cast to that specific class
should the elasped time of a timer jump back and forth from and two or simply increase with the time the timers is running ?
I'm trying to do this using a timer and thats whats happening
Does anyone know why my train blueprint lags my game down to 10 fps everytime i move it in the editor?
this is when i move it around
i have tick and everything disabled
static lights in it.
so after getting the string array what should i do
well you want to select the proper message so you need to pick an index, i would test it by hard coding an index
set the text, to the message at that index
getting it to do pages will be the most difficult part, just popping up messages isn't to difficult
im confused a little
but you'll need to build a function i won't walk you through that
so a set text node?
ya
drag out from the widget reference
get the text box that you set as variable
then set text
and pick an index
the index is where you may be able to set a variable on the sign
so each sign you can just say get index x
0,1, etc...
it wont let me set the text variable
you don't set a variable
you set text
drag out from the widget
get the text box
then drag out from that and do "set text"
i have, it wont let me
thats in the widget
with the widget ref
it's the same thing as if in you were in it
show what you have that isn't working
im using the widget ref, its not connecting to the set text node after i drag off the text in the widget
its the only one that comes up
so when you drag out of messagetext you only get one set text ?
Anyone able to give me any insight on how to do this as I tried with a timer and didn't work, the elasped time of the timer was jumping around and then I've tried with using delta time which seems to not work either the door seems to rush to the target then lerp correctly
This is for render component ..
thats what I was doing when I tried the Timer method
i only see one period
and thats what I was doing when trying the delta time method which was plugged in on left hand side on the +
Timer and delta (tick) would work equal here
Elapsed counts upwards aslong as you dont reset it
There we go
what ab it?
Different type compared yo engage, it seems.
its a reference to the text in the widget
idk none of the others would connect
Youd want the function if its a widget text block
well for one thing instead of dragging from the set of the third person character, just get the variable in the two places you need it, so your not crossing execution
but you have two paths, valid and not valid, when you create the widget, before you show it, set it's text
so that the text loads up when you load the widget
but don't use the reference, just drag straight out from the create
or set the reference first, and then use it
how do i select a specific one from the array?
how do i hook the array up to the set text?
look at the function you made update text, you get a value based on an index
is this bad for game performance
anyone know how to make a rope shoot from the player and connect to a walk but whatever length you shoot it at is the max length i tried using all sorts of things i used a line trace then get hit result i made that a variable called grapple point i even set up a cable to connect to look like a rope but now heres my problem i tried attaching a physics constraint to the impact point and character it didnt work i also tried connecting a spring arm and that didnt work i want it to be ablle to attatch anywhere the line trace hits while have a simulated physics falling and swing up like a pengelum
A high amount of nodes does not constitute a performance problem in itself, more how often it runs, and the complexity of the math inside it.
And thereโs probably a much better way to do whatever the hell that is
multiplying two 3x3 matrices
?
tbh if you really want to know how much the performance impact of your blueprint is at runtime, use the tools inside unreal hehe
they're there to be used, for sure
is there a matrix type built in?
yeah
just so u kno :
don't tick this lil mf off
or your character will start crouching in the ground and float
nvm earlier post
how often?
I am using a Controller -> AI Controller -> Character to move a guy around with AI Move To
However, for some items that the player can click to move to, if they are within an acceptance radius id rathert they just look at the thing than move to it
I can use LookAt + RInterp to etc but i was wondering if there is an easier way with the movement component to just turn my character in place
I dont think I want to use controller rotation because 90% of the time, I want movement to drive toration
without using controller rotation, no there is no easier way- assuming you are using BT i would make a BT task for Look At that does the rotation / interpolation and just call that after your Move To node
if you are using controller rotation, youd want to use SetFocus / SetFocalPoint
if i use controller rotation with focal point is there an easy way to still let the movement also control the rotation when moving?
youd have to toggle it on/off or something if you want that -- theres no trick of it
like once or twice per frame
ill just set the focal point on every move
ยฏ_(ใ)_/ยฏ
@sudden nimbus manually managing focal point is working great thank you
I mean it is what it is but move this to C++ if anything
You can do it super easy
After looking if there's a BP matrix multiplication first
what is that PhysicsComponent?
I have a very bizarre issue. I have a camera actor that follows the player, the camera position gets updated when movement input action is triggered. When it's triggered I start a "set timer by event" on a 0.001 loop so it updates when the player is moving. When the player stops moving, there is a 2 seconds delay after which the timer gets invalidated
However it looks like there's a 1-2 frame skip exactly when I let go of the movement keys
It's barely visible in the video, and I bet 99% of players wouldn't notice it but it's driving me nuts.
Why do all that
to avoid event tick
What's wrong with tick?
I'm trying to not use it whenever I can
first, learning experience, second, performance (somewhat)
You want your camera to be moved to the correct place each frame. Tick happens each frame. Put it on tick. If you're concerned about wasted work, first off, don't. Second off, you can turn tick on and off.
The timer is probably worse performance. You're running it many times per frame, maybe. I don't remember the specifics about setting a timer faster than tick is.
But putting the camera in a valid location on tick is 100% fine. That's how literally everybody does it. That's the correct way to do it.
even if it's inside of a player controller?
Sure
(don't know why it wouldn't be, but I'd rather ask)
but yeah I tested it with tick earlier and it worked just fine.. might as well..
Problems come from doing stupid or unnecessary stuff on tick. Moving your camera on tick is pretty necessary.
yeah.. it is ๐
by the way, do you know a way to "offset" the charecter directional movement? I'm trying to create an isometric environment and WASD doesn't quite represent UP/LEFT/DOWN/RIGHT, it's angled because the camera is angled
uhh
X = W - S
Y = D - A
I don't think I understand
Show your input nodes
Literally just turn that 2d vector into a 3d vector and feed it as the movement input vector
Drag the blue thing into the yellow thing and see what happens. Scale value should be a constant 1 in this case
did you mean this?
Probably not. What is that node, the dot product?
Oh okay cool. I'm guessing that float is the
In that case, just plug that directly into add movement input, set the scaling to one, and that's it.
it didn't really do anything
Show current code
Plug the output of that conversion node straight into the add movement input node
You can delete 75% of those nodes
yeah inputs are a bit difficult for me to understand
The input node is spitting out a vector 2. You want to convert it to a vector3 then feed it to add movement input. Then WS and AD will map to direct world directions. Press W, move in X
like this?
I got a small issue, everything is working perfectly, yet this referenced sound will not play, but if i play it once in the content browser, it will start to play at the given moment in runtime, until i restart the editor again.
My guess is that i have to async load some assets as the component gets active, but im still kind of curious why other sounds handled the same way is played normally without this issue.
I'm having trouble here. How do I create an Interface (in C++) callable from BP's?
I can't add BlueprintNativeEvent, BlueprintCallable with Virtual in front of it as "BlueprintNativeEvent shouldn't have virtual in front of it" but for me to update the value from my Character class it needs Virtual & Override on the character. Unless I just don't understand Interfaces in C++.
Well that didn't quite work, but thanks
Sorted it out, solution :
Add _Implementation to the function name within the actor calling it. Then include Virtual & override as normal.
how do i connect a physics constraint from my player to a impact point on a line trace im so lost,.
can any gameplay ability system wizards help answer my question in #gameplay-ability-system
Are you sure a physics constraint will do what you want it to do?
Grappling hook I'm guessing?
yeah i wanted it to be physics based
i assumed a physics contstraint would work
if i apply propper limits
Is your character already moving around physics based?
no but when i set my variable is grappling i make it so the movenment mode is falling and i add force based on a number of factors
i was hoping when i set my is grappling to true i could set it to be physics based and when im not then set back to regular movement
i have a simple line cast grapple point system but i want to stop falling when i reach the length of the max distance from my impact point
i tried applying small amounts of force to differnt location depending on variables
to counteract the speeding up
and falling dow
Why not make one of those factors how far you are from the grapple point?
i did
That should be enough to grapple
so what's the problem
when i hang
gotta dampen
is there anything in your settings that can give you air friction?
that's what you're aftyer
if not, just do it yourself
Force = ForceFromGrappling + Velocity * SomeNegativeNumber
so i could apply air friction would that stop me from going down after hanging
i want it to be so when i continue to hold the grapple button i fall into the wall or object im attatched to and dont move
and dangle
so if you had a rope attatched to a bar in the sky and you let it go
it would run out of momentum and stop swining
swinging
show a clip, I still don't know what it's doing vs what you want it to do
The problem is all in your force math
Tick -> calculate distance -> calculate speed (for damping, dot product of velocity and direction towards grapple) -> cook up spring strength (map range on Distance - RopeLength) -> cook up damping strength -> Force = DirectionTowardsGrapple * (Spring + Damping)
Bonus, to "reel in", you can just change RopeLength over time, that's it
why is world location involved?
Do you want the force to always blast you towards world origin?
Anyone know why even though they have 2 different values, they still the value of only one?
you're probably referencing the original in your code or only one
been looking at this on and off all day. Anybody know a concrete answer to this?
https://www.reddit.com/r/unrealengine/comments/1g21r0s/character_knock_back_rubberbands_them_if_there/
How do I reference them seperately?
well how did you refrence them in the first place
in your code for the text i assume you made the function for where it gets that number from
probably in the widget
bp
@inland walrus
Hey sorry my ue crashed and I was just recovering it all
Love unreal haha
Yup xD
click on that hero health node and set it to instance editable
the variable
idk if that wil do it but try it rq
it alr is nvm
yeah
idk it might be your reference
you got the class
you could try get all actors of class
or use cast to
then the name
on your even tick in the text render 2nd image
youre setting the health stats
try setting all the variables on the text renderer to instance editable
but on that event tick whats in that function why doesnt it need a refernece to the player
the text renderer isn't what I'm using that was just a tester, Im using a widget
I am unsure
then why is it a variable being used in the player
you might need to go into the function and change its inputs
to the widget
It was just a test one
so wheres the current new one
uhhh
im sorry thats a premade function mb
Alright
bump
Would you reccomend using a forced movement on a character instead of Motion Warping in order to not rely on root motion added onto animations?
Of course, it's not hard at all to edit a root motion value in Unreal, but I would prefer to control those things with code rather than animation data.
does it make sense to dynamically change between use control rotation and orient rotation to movement if i need to turn in place for some actions, and for movement i want to use the movement rotation
added an example, when in attack range i use set focal point to aim at the character so i can turn in place using character movement component
But when hes walking around trying to get to a location to auto attack i dont want him pointed at the character i want him to move normally, also if just doing more complex pathing I dont want him just staring where he wants to go, but where hes going
Hello, I am making the portal gun from rick and morty, and to test out the teleportation I am making the player character teleport to the random coordinate I input, but the character wont teleport for some reason. Another thing thats not working is my character wont physically interact with the portal. Any help would be so awesome.
You are teleporting the controler, NOT the actual actor of your player
You want to get the actor either with Get Player Pawn, or getting the overlapped actor to teleport that.
Ideally you wanna filter out what type of actor you telepor though, otherwise anything can be affected by it.
I just plugged in Get Player Pawn and nothing changed, and I made sure to see if the BP_Character was actually colliding with the portal by printing a string, and the string didn't appear, which means these two actors (Portal and character) aren't colliding. The Portal's collision is set to "trigger" and the character's collision is set to "character". Any more ideas?
Always show updated code
also, I've seen Teleport have some issues. You can just use SetActorLocation though