#blueprint
1 messages ยท Page 252 of 1
No its neither
But you need to be aware that normally you can't reactivate an ability that has not ended
So if you delay the end of the ability
You are also delaying how quickly you can activate it again
Yes, I know. But even when the ability has ended, the issue remains.
Eh I'm on my phone and in bed now ๐
But I'm quite sure your problem is there
Yes. Well everything you do after end ability won't be executed but yea this should work
One second, I'm testing.
It did not fix the issue, actually.
I still have to press it multiple times.
You're judging this based on how many actors you are spawning? Try to add a print string in the ability and see if that is printed consistently
I still have to press in rapid succession like here. But when I do, the ability fires off again on every second press in rapid succession.
I also find it very confusing.
I think the issue is the mouse button press that is required.
I smell instancing policy
If the print string on the input is not printing, then something else is consuming input.
I just did this on activate ability.
And then it bugged again.
Or well, got inconsistent and required a rapid double press.
Yea that was weird indeed but then he confirmed that removing the activate ability the print was consistent
It still shouldnt be tho
Like it should not change a thing
Can you show how you are granting the ability and if you have any other bindings for input within the ability?
Yes, one sec.
This is in the player character.
This is a component attached to the player character.
All good.
Basically the ability is stored in a variable.
And this variable is set through the interface via the component.
Are you using anything like what GASDocumentation shows for input binding using enums?
I don't think so? How does that work?
It's a bit convoluted. But still i can't see how this could cause the issue
What happens if you change the input to a keypress instead of the mouse?
The thing is that I have the same set-up for Q E and R buttons and I don't have the issue there.
In general it sounds like your ability is swallowing input somehow
They work just fine.
I do that with other abilities. And they work without issues.
But what about this one specifically.
One thing you could do is start with a bare bone scenario where you have a clean, new ability assigned to that same input with a print string in it and nothing else. And confirm that this works. Then gradually port more functionality until you can isolate the issue
What about the same IA, but the IA itself is bound to a key input and not the mouse?
I'll try it, one moment.
Changing it to a different button on the keyboard also resolves this issue.
I set it to T for testing.
I did that by ending the ability as soon as I activated it without any other logic. The issue remained.
I think the problem is an interaction between Input Actions and Mouse Buttons?
Oof... This seems like its becoming a mouse hardware problem.... Are you able to test your clicking on some external application? Like https://www.clickspeedtester.com/kohi-click-test/
OR even setting that IA to use RMB instead?
How about using "Started" insted of "Triggered" on the IA event?
I've tried that too, has the same issue.
If this is true, the ability is doing something fishy
I don't think so. The ability is consistent as soon as I changed the binding from a mouse button to a keyboard press.
This is the only thing that has consistently worked so far.
Anyways, thank you guys for all your help so far!
Can you show what your details panel looks like in the ability?
This could be interfering
Btw just for testing purposes, I used a different mouse and had the same issue occur.
I'll try to figure out a solution tomorrow or saturday and if I find something, or figure out what causes the issue, I can give y'all an update.
Thank you two for all your input, it helped alot!
Anyone know why the villager doesn't move to the 3D widget?
show your code
for how they know to go there
That's my bad, I thought I put it in the video
Sorry
Draw a debug sphere for a few seconds at that location when the order is given
like this?
Sure, give it a duration tho
just to make sure the spot you're telling it to move to makes sense at the exact time you're telling them to move there
From a conceptual standpoint, I have 2 dancing animations for the male and female dancers. However the meshes are not to size, meaning one is shorter than the reference animation. When retargeting, they are off.
What would be a better idea? Adding 2 bone ik and trying to fix the positioning or just use sequencer and either correct and redo it all?
I haven't used sequencer extensively but using blueprint to constantly correct animations has become tedious.
Your walking speed is not sync with animations
How would I make it so the camera will move in or move out based on the distance between the two fighters?
Right now it justs follows them currently and stays between them
Maybe if you had a spring arm attached to the camera and adjust its length based on the distance between the two fighters
Ah, I never thought of using a spring arm
Depends on your desired rule but a distance of 1.5x the distance between the fighters is a good start
Would I change the actual Y position of the spring arm?
When I try changing the target arm length value itself while playing, it just kinda skips to the left and is off from where the desired default location should be
use trig
using an equilateral triangle as a base or 2 right sided triangle, adjust the camera angle based on the distance + offset of your fighters
@frail pilot
no need
if you want a constant position on screen of the characters then just use a constant distance multiplier
well he needs to change the field of view angle no?
I don't think changing the FOV is necessary?
Because in the UFC/Fight Night titles, it seems like the camera just moves closer or farther depending on where the two fighters are
And I'm trying to achieve that effect for my mma project
camera offset being a multiple of distance between fighters will keep the angle between fighters constant
Alright
So would I or would I not use boom arm on camera still?
Because imo, the boom arm is really weird
You could but I only would for the smoothing purposes here
I'm not worried about smoothing tbh
ok then don't
Alright
Is there a way of getting all of the options of an Enum in a blueprint? I'm a bit of a smoothie and can't figure out how
What is it you're trying to do with them all?
I'm trying to fill out a right click context menu with buttons like in Runescape. When the player right clicks I get an interface that checks how many states an actor has and fills out the right click menu with whichever states the actor currently allows (like right click > open chest/close chest/search chest/blow up chest/etc).
I was thinking I could use an enum to list all the states and pass those off as a string or somethign to the button widget but I can't figure it out
There's a foreach for enums. There should be one for any custom one you made as well.
Yea I tried that, but it returns 0 every time I run it
or at least as empty
Or is For Each loop different
For Each Loop is different
That's exactly what I'm looking for lmao thank you!!
It feels like it's always something easy that I'm over complicating or missing lol
this new ? ๐ฎ
cant recall seeing that
Hello, I'm trying to make player character look at his target every time he attacks. My Look At Target function is working if I call it in event tick but not when I call it in attack event. Does anybody know what why and how to fix it?
RInterp requires tick
this was like before 4.26 , dunnow hen it was released
If you dont want the tick, you'd need to set the final rotation directly
but ye it's oooold
guess that just means im older , rip
haha you're old ๐ซต
Thanks ๐
Been around for quite some time
damn. guess i've just never had the need for it then
Same but good to know itโs there
So say I wanted to create a ring that's safe on the inside and outside but damages the player if they touch it. How would you go about making a ring shaped collision? Or would you just build it out of smaller primitive shapes?
Still haven't figured this out and idk why
Ik it's not that hard but I just can't think of how to do it
I've tried ways but it's not happening
Idk maybe I'm just overthinking it due to this being my first day of UE4
distance
if overlapping and > innerradius
or 2 overlapping spheres
if overlapping 1 but not the inner
I'm not sure where else to put this question: I'm working with an Xbox Series gamepad and have noticed that while play testing, in the background it appears to interact with the Unreal Editor, closing tabs, which I then have to re-open manually. any way to prevent interaction with the Editor?
launch in standalone ?
that's how I playtest, yes
cant recall seeing anything like that tbh
hmm, the gamepad just appears to be interacting with the Windows API. just now, while playing it switched the active tab from the StandAlone Viewport to VisualStudio
using some plugin or something?
no
RawInput or whatever it's called ? ok
and there appears to be no interaction when there's no game instance active
it most commonly happens when I use the facebuttons (in my case the X, which in a way sounds plausible for closing tabs?)
When doing a line trace for objects, I only want it to detect the door component, but not the collision boxes (they are only used to detect if the player is inside or outside).
I'm failing to set up collision response properly. Is this possible?
Or do I have to check the hit result and ignore it if it is a Box or sth like that?
You'd need to change the "Object" collision responses on the colliders themselves to not respond to the type of object trace you're hoping to use.
Thank you! I honestly hadn't considered that yet
Distance. Find the center of both fighters, get the distance between the two fighters, the further the fighters are away from eachother, the further the camera should be "zoom out"
as the fighters got closer, the camera would essentially "zoom in"
there's a node to get the center of an array of locations but I don't remember the name
there's multiple ways to get the center of two vectors though
nvm found it
I believe this will also get you the center if it's just two actors
I would have the camera on a spring arm. That way you would move the spring arm location so it's in the center of the two targets but you can then adjust the spring arm length as well.
I have this really weird issue where suddenly a variable wouldnt save/load properly. After hours of debugging it seems that variable stopped working. I created a new one just like the old one and it works! I hate stuff like this....how can i know when it will happen again?
This is the savegame actor:
The test bool is the new one that works and the desrtintrotext is old one and doesnt save
The variables are identical in my savegame blueprint:
What is the best way to have a base actor that can be either a skeletal or static mesh. Currently I have one for each and thought I would try to combine it on to a single base actor, It works But I noticed the root is not the mesh ๐ฆ and any other additions in the child actors wont be attached to it.
how can i make sure my player doesn t fall threw the map when respawning
fixed it dunno if this is the correvt way tho
Setroot?
Cant you do that dynamically?
Nope cant be done in BP. I talked it out with GPT and decided to abandon this method.
Bypass it and spawn replacement actors of the same class ๐
how can i set the die location but at the same time reload the world ? so the dead enemies come back
Can someone help me with doing a line trace?
you can specifcy component attachment tho
I'm trying to do a line trace with a 3rd person character and from my AI so I can't use the camera
And honestly I'm clueless how to do a line trace in the right place
Like in front of the character
GetActorLocation + GetActorForwardVector
Tried
Oh.
you want to multiply the entire direction with a length unit
So I just split it?
But wouldn't it now multiply xyz
Yes
What should I go from? I don't have a camera
Oh yeah true
Fortunately nicotine exists
Yup
before multiplying
Multiply 500
StartTrace, StartTrace + Camera->GetForwardVector() * 500.f
const FVector StartTrace = Camera->GetComponentLocation();```
LOL
This is what I use for my cpp
Wait what
yees
multiply the direction with a distance
FINALLY
you're eyes are sharper than mine
didnt even consider it being a + xD
๐ Been staring at a lot of vector code lately. Been messing with geometry script stuff.
Yeahh neither did I
Thanks a lot tho
Now I just have a question
Is tracing a valid option for npcs detecting obstacles? Or is there some other system?
I wanna detect moving things so line trace works but I thought AI could have some built in mechanic for it
Obstacles for what?
I mean like if my npc is walking and then another character goes in front of it
I want the npc to stop
Unsure on the stopping part. Most times to have AI avoid each other you'll use the detour crowd control and they'll just steer around each other.
Is that a plugin or some built in thing?
There is no inbuilt tool for this afaik . But a trace should work
I mean yeah avoiding would be smarter tbh
But this is a prototype
I'm tired of being a perfectionist
Still I wonder if line trace is a viable option
I haven't used it much but it's engine default. If memory serves it's mostly making their ai controller a detour controller maybe. There are a bunch of guides on it though, it's pretty common.
Detour is for avoidance. And you need a lot of manual tweaking to get it to work right. If you want to stop and repath a trace is good enough in my experience
You can try asking in #gameplay-ai though
So it should be a viable option too?
If you want your agents to avoid each other while continuing their original path yes
If you want them to stop when they face an obstacle then not
I know that it is for avoidance. I literally said that.
Unsure on the stopping part. Most times to have AI avoid each other you'll use the detour crowd control and they'll just steer around each other.
I ment that is tracing a good option for that
Sorry man I missed it
If you want them to just stop moving if something is in front of them traces are fine. But it's a complex issue. What happens when two things walk in front of each other at the same time, facing each other? Which one moves out of the way to avoid a standstill? You also add on code to maintain a state machine of stopping and moving.
With avoidance you simply set it up, and let them go
If you would like avoidance more, it's less work. If you want the stopping, there are a lot of issues to solve.
Oh yeah true
I could stop the movement then add a delay and re enable it again and choose a different path
Like in GTA V
Npcs usually stop for a while then they change path
Or run you over...
if i move too far from where the player starts i get this error... anyone can help with this?
share ze code
Can someone help me understand why is this not working?
I want the npc to move to a new location if it hits something and then continue moving to it's original destination
so, i'm using Openland for landscape deformation this is where the code seems to break
where are you calling this function?
here, its used to move a render target
it runs just fine, but when i get too far from the start location it breaks, if i go back it runs again, its confusing :/
i dont understand your setup. where is this function running? on the player? on another actor? need context
is it called on tick? on a specific event?
its called on tick, i didnt make this, i just took it from the Openland plugin, its open source, this is the link for the plugin
https://github.com/GDi4K/unreal-openland
i'm using it to make footprints in the desert and i honestly don't know how it works exactly but it uses a render target and it moves it with the player i think
and this is the effect i get from it
For some reason, this doesn't work. I set WorldStatic, WorldDynamic and Pawn to Ignore, but it still responds...
Also, this breaks the component begin overlap, which I need.
So I'd like to detect an overlap of my character, but it should not respond to a line trace from the character. Is that even possible?
the only thing that comes to mind is something related to world partition and getting to a point where somehow the cameramanager is despawned (even if i dont even know if that is possible). Are you using world parition?
i think so, since i'm starting with the open world map just changed the landscape isn't by default enabled? but if the camera manager is despawned why i still play normally? it just stops making footprints
but the map isn't large its only 2km
as said, to me is quite weird that camera manager despawns because it should be always relevant. but, you could try increasing the loading range and see if that makes a difference
also check that the camera manager moves with your player while playing
how can i check if it moves with the player?
if for some reason it is detached from the player and stays in one place, then perhaps it is picked up by WP and destroyed
i was watching the coordinates for the camera manager and they change while i move, so it is moving
play the game in editor, move around a bit, shift+F1 to get mouse control and check in the outliner that the position of player and camera manager are the same
ah ok good
then i dont know ๐
do you think Hlods have anything to do with this maybe?
the numbers don't seem to match, did we find the culprit?
Why would they match? Also controller doesn't really exist physically. Sure you can specify location on controller, but they kinda meaningless
WP = world position?
if you want to check the position of your player then get the player's physical representation. Normally a pawn.
partition ๐
WP for world partition maybe
now how can i disable it, and check if this is the cause?
i think it would be easier to just increas the loading range a lot if it is just to debug
hold on
world setting tab (Window->WorldSetting if its not visible already)
okay its working!!
now you can see i didnt activate windows....
i increased the loading range to cover the whole landscape and it works
yep good, then the camera manager can be despawned by world partition
somehow you got a big offset between player position and the camera
won't this hit performance hard after i populate the world though?
lol i don't know how to do that
well something is causing it. try to look into your character setup, other possible bps or code in general that is setting camera position
you gotta dig in
aside from all this, what other alternatives should i look for, to make footprints?
@shy matrix also thank you very much for the help
wouldnt know. I remember a plugin from prismatica that mmmaybe could do for you but honestly not my cup of tea
no worries!
i'll check that out thanks!
actually, its not the camera manager that gets despawned, its the blueprint that moves everything together, so i just need to figure out a way to make it follow the player ๐
ha, it sounded weird that the camera manager would be setup to be spatially loaded by default indeed
is there anyway i can check an actor to be persistent no matter what?
that did not fix it unfortunately
you mean the bp is still loaded but the issue persists?
aaanyway, id focus more on that offset between camera and player
it cant be good, unless you mean to have it
its the default unreal 3rd person blueprint i doubt its a mistake
why won t you make a behaviour tree?
Can behavior tree avoid dynamic obstacles?
And also this is a task on my behavior tree
yeah
Mind telling me how?
it detetcs the objects and move around them in a nav bounds volume
Yeah but how
can hardly show have i have done it since it is quite some code lol
yeah but you kinda need a task for a behavior tree
I'm doing my code in a task for the bt
Alright Iโll try it out
Hey guys, been playing around with translucent sort priority in a top-down 2D game and having trouble with tile maps. I have a map with translucent material, and I feel like I should be able to set each map layer's sort priority...but the setting isn't there. So, my player character is always in front of everything on the map. USUALLY that's what I want, except when, for example, the player walks under an arch that's "above" him. Can this not be done? Do I need to take those elements out of the map and make them regular sprites instead in order to control their sort order?
How to get the blue dot position in order to adjust the "Narrator:" top padding?
Alright this achieved the same effect as my normal code, so I'll just try messing around and seeing what'll happen to get the desired effect
Why does this print "Blueprint" and not the assets actual class like Character for example?
do you guys see any problem in trying to save the location wanna spawn the player there when he dies
Are you sure open level doesn't kill this object?
your code might end right there
You should do that in gamemode, there's a function to select where to spawn the players pawn at
override that
Even if your current code works, it's just moving the playercontroller. Probably not enough
but how should i do that then simply don t understand why it can t get the vetcor when it is saved and how does gamemode then work?
Loading the level probably gets rid of everything, including WBP_DeadScreen which is trying to do stuff after loading the level
either that, or your code works, which only moves the playercontroller. PlayerController is not Pawn
yeah it removes the deadscreen that is true but how does gamemode then work cuz been trying this for the whole day๐
do you have a custom gamemode class?
probably not
Do that first and set it to be used in Project Settings. in the gamemode class you can choose what pawn players should have and theres functions for choosing where to start etc
then you won't need the pawn on the map, you can place a start spot
gamemode is what spawns the pawn for a player. By default it spawns them at a PlayerStart actor
now upen that Gamemode BP up and look at the functions you can override
click the spot where it says override
You need C++ to get font sizings which you then need to convert with the widget's scale if any. That way you can get the pixel height of a single row, based on it's largest font sizing by iterating over the charcters and their styles before the wrapping break. It's not fun, and it's really prone to issues.
That said. What I recommend instead is simply using same font and sizing for name and text so that it lines up anyhow. You'll get a lot of UX issues with multiple font sizes. It's much easier for people with vision or reading disabilities to follow along with same font sizes even if they're bolded in some parts, or different colored than it is to follow different sizes. And there are several cases for aesthetics as well.
I've tried by working with FSlateFontMeasure but I guess I will go for the second option
Yeah, you would need to get every decorator that the text in your rich text is using. Then you would need to iterate the rich text block's datatable of styles for those decorators to pull their FSlateFontInfo. Then iterate through those font infos to get the largest measure.
This will mostly work, except for the text wrapping. You need to filter any decorating styles that characters ONLY on the top line are using.
Yea it will be very expensive in a performance sight
Thank you for helping me figure it out
https://youtu.be/6xOTYojAjG4?si=5bzD0Wj-2sN82rUS
Anyone have a theory as to why modifying data for my interactable actors would work on cubes and wouldn't on a door?
First thing that comes to mind is construction script, or runtime added components on the door.
idk but ironically i just made a functional door lastnight
Doors are such interesting things in gameplay code when you also add multiplayer. They're so.. simple. Yet so much complexity issues arise from them in networking code.
how do i get RenderTexture2D on my landscape?
Construction script is empty, there is no code inside the actor
Techinacally after a bit of testing i came to a conclusion that this is happening on all components that are added via blueprint vieport, like inside blueprint. If i add a component via level viewport, it works just fine
I think your best bet is the visual logger
Hi everyone,
I'm new here and running into a strange problem with Unreal Engine's Animation Blueprint. During runtime, my state transitions seem to skip the set durations entirely, but they still transition to the correct state. Iโve been scratching my head trying to figure this out.
Iโm not sure if this is a bug or something I might have missed in my setup. Iโve linked a video showing the issue in action. Any insights or suggestions would be greatly appreciated!
Wdym visual logger
Probably because you did animation select
Because you're using a soft object reference which means you're referencing the blueprint asset. You want to use a soft object class reference
It's a built in tool to debug various systems. It captures a lot of logs and show them in a friendly way. You can enable/disable categories to filter for what you're looking for (eg. Pathing and NavSys). Just google it. It there is an issue with moveto node some warning is most likely logged there
Friendly I mean visually, for most things. But you also can check written logs of all sorts thete
Ok, you see how it says "Object Type" "World Dynamic"? That's the type of object and influences how the object will respond to "Object Type" traces. If you're tracing for objects of type "World Dynamic" then this object would respond to it.
well you can see it switches correctly it just doesn't do the duration. there is no way for it to actually switch to and from walking without that state machine. should i not be using an int to set the name and then using the name to switch the state?
it also seems to work fine with my other animation blueprint for a bike to spawn and its referencing the same exact variable but that one does the animation duration blend when switching which is the weird part
Are timelines not useable in widgets? (sry, not sure if this is BP or UI related...)
No. Timelines are actor components.
Oh, I see, is that why I couldn't use them in functions?
or is that a different reason? Oh and thank you for the fast response.
I see ^^ thank you so much guys!
I do not understand. If a variable equals "false", you set it to "false"
Also, do you really need that boolean if you have the Event "On See Pawn" already?
If "he" is not sensing the player, the event is not fired? Did you check that? And who is calling this event btw?
Also you should avoid using Tick for whatever you are trying to do
Try to do things Event based that only should happen once a certain time
Also donโt use pawn sensing, use ai perception
Anyone ran into problems with meta sounds and sound mix class override? The sounds turn off, dont turn back on though.
Ah, thanks for pointing me
what would be a simple way to establish whether or not a wall is climbable?
Currently my character can climb everything and I'd like to be able to mark objects climbable or not.
I tried box colliders but they mess with the mantling system. Is there a simpler way to mark if an object/wall can be interacted with?
You can use tags, or PhysicalMaterials (basically letting you define materials as climbable)
You can use the widget designer timeline
If you need alternative. It does the same job.
Hey everyone! Did anyone encountered a weird bug (?) in UE5 where connections get randomly removed in a file you didn't even touch? For example today after restarting the computer, on the next UE5 editor launch, all the windows that were open in the previous session were closed. All the code stopped working as intended. After investigation I found that in one of the functions in a static library blueprint had some connections removed (including the execution), so I had to restore them. I look at the git history of the file and no changes were made for like 2 weeks to that file, so it definitely wasn't me.
thanks for the explaination
have you been using live coding at all?
nope, don't really have the need for it
Excuse me, can I ask for some help?
Im doing a character select BP
3 characters to choose from
The chosen var is 0 by def until I choose
My Game Mode BP which changes the def pawn (currently none)
And my widget buttons bp
The thing is that despite clicking Paladi or Elf (not Wizard) it will always think I chose Wizard
Basically, Chose var never changes from 0
Calling "Open Level" essentially removes every object you may have loaded, including your gamemode.
Game mode isn't surviving the open level
Simplest approach to what you're doing is to put the char selection data in GameInstance. That persists.
All right thanks!
wait, I just noticed that all editor settings were reset, so live coding got enabled. Is it the reason?
not unless you're using it
if you dont do any c++ it has no use
i wouldnt disable it regardless
why's that?
disabling live coding enables hot reload which is infinitely worse
I disabled it because I feel like without it after compilation of my code, I know there won't be any weird glitches
you close the editor to compile right?
I mean, I noticed that if I change anything in my headers I usually have to restart the editor
if you don't you either are using live coding or hot reload
hot reload is known to corrupt blueprints
wow, I didn't know that
live coding can if you have reinstancing enabled and arent careful
if you disable reinstancing, live coding is pretty safe for changing minute things to test them
still have to close editor to properly compile though
OK, I'll give live coding a go
I'd handle combat controls and playing the animations in the third person BP correct?
Alrighty
Thanks
thanks for the info. Although I'm surprised that live coding is the preferred methond of compiling
I kinda got an impression that its' purpose was to make compilation time lower
which is not really an issue for me, since the project compiles fast enough with the hot reload
why would a dynamic multicast delegate not be hit in blueprints even though it's being called in C++?
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCharacterDied, ABastionCharacter*, DeadCharacter);
UPROPERTY(BlueprintAssignable)
FCharacterDied OnCharacterDied;
UFUNCTION(NetMulticast, Reliable)
void Multicast_JustDied();
void ABastionCharacter::Multicast_JustDied_Implementation()
{
OnCharacterDied.Broadcast(this);
}
when i put my breakpoint on OnCharacterDied, there's nothing assigned to it. it's like the BindEvent is not happening, but I've confirmed it's being hit in BP
Gain monthsโ worth of Unreal C++ experience in a single article.
Is the delegate binded in the target machine?
Probably much to do with the networking logic
@proven loom try binding and broadcast without multiplayer?
Then you will know if the delegate simply wasn't binded into target machine
it's standalone
i made it a function and a BlueprintImplementableEvent and now the issue is gone ๐
not sure why the delegate was not being bound
What would I do to make it wait for the animation length before allowing other animations to play on button press as well as going back to the idle animation instead of freezing at the end of the animations and no longer playing the idle and walk animations?
That == check looks sus.
it was getting hit ๐คทโโ๏ธ
The == or the code after it?
after
You have the same check in the BIE? What's it checking against?
Cause in the above image, It's asking if something == nothing.
So unless you passed the bottom pin a null pointer, it can't run true.
๐ฎ
i don't know how i missed that! thank you! i'm using a BlueprintImplementableEvent now and dont' feel like going back but i'll keep it in mind for next time!!
Yeah. ๐ BIEs are nice. But do be careful using them. They can very quickly be anti patterns.
for sure! makes sense. i really only used it this time to get over this problem and move on
A good example is, you need a widget, the character, some manager, etc all to do something when the character dies. Using a BIE, the character has to know about all of those things rather than those things being able to simply bind the delegate from the character.
You need some sort of state machine or variable, or ability system. GAS for instance could run an ability with inputs that would play the animation and finish the ability when done, you can't rerun it until it finishes and other things could interrupt it using tags and such. You could also make a state machine that enters that area when you start an anim and won't allow you to leave or enter it until it's done. Or last you could maintain a simple boolean of something like "is playing animation" and check it before allowing another, and unset it on anim finished.
Ok, so would I put my animations (the boxing ones) into the same state machine as the movement state machine?
Wait nvm I'm using an animation BP for the movement
Not a state machine
State machine isn't always animations specifically. It's just a tree of logic that allows you to enter a different state based on conditions.
can you not use plane cut on models? I made a cut but when i exit modeling mode the cut is no longer there. When I go back into plane cut it seems to remember where I cut it. Am I missing something?
You essentially forfeit your anim blueprint when you use the play animation node.
Look into montages instead for animation like firing or slashing
Hit accept changes before you exit it
You are probably talking about fracture tool and you only view the representation of the model when it's fractured.
I did hit accept. And I'm talking about the plane cut feature in modeling mode
Also make sure if you select keep inputs that you move the old version away
Beyond that I would just restart UE ๐
I have ๐ซค. It should be working. like when i got back into modeling mode the cut is there. i try to cut again, accept again and exit back out and there is no cut.
its as if the engine knows I made a cut but is not applying it
Or at the very least the cut is there, but it only shows that its cut in modeling mode.
Is there a way to measure distance between 2 seperate mesh component sockets. So for example a gun with a socket on its iron sight, then on a separate red dot mesh with a socket on its red dot. Measuring the distance between the socket on the red dot and the socket on the gun iron sight. This is so I can adjust the gun from looking down irons to looking down the sight with a simple offset
cannot use world space either
why not?
Math totally not my thing, but maybe you can just subtract the 2 component location then get it;'s length
try using the result to offset your view
Cant use world space because changing the direction im looking impacts the point of measurement for some reason. Meaning the slight changes make the sight not centred.
Ill see what your suggestion reveals
Im assuming you mean world location?
The issue i have mainly if i dont constantly tick its offset, is that the offset is a tiny bit different if i look up vs down vs straight ahead.
Ah ok
I fully dont understand why this isnt a common problem for fps games. I have no idea how they dynamically sdjust based on sight
Did you maybe cut an engine shape/mesh?
Is it possible to do something like a "named reroute" on this? I basically want to clean up my code from this node without explicitly creating a variable
not a reroute but something that's functionally similar to a named variable
@frosty heron Result is the same as what I had previous. I should elaborate as well now I think about it. The issue is that I have the adjustment on tick to account for the slight differences in offset for a more accurate position, but alongside a procedural recoil plugin, the tick adjustment is causing issues for the procedural recoil. So Im mainly wondering how I can have the sight offset not happen on tick
never heard of anything like a named reroute but why does it have to be messy like that?
Make more reroute node to clean up
If you don't have any latent actions that need to be in the Event Graph -- just make a local variable.
It's what they're for.
Named reroutes in other graphs end up being pretty much the same thing, the overhead is 0.
Hello, I'm trying to make like a circular fade in and out transition using widgets, except I want to use my own mask. The issue I'm currently facing is that I created the material and the opacity mask is working to the shape I wanted, and is controllable with a parameter, but when scaling down the image it scales to the top left rather than center wise.
this is the material
and this is how it appears at full scale
scaling it down goes to the top left rather than center, help?
I'm not exactly an expert with materials but I believe from past experience the centre point will be the width and height halved. If you're using 0,0 that might explain why it's going to the top left (I believe that's considered the origin)
Yeah, I already done that
Hi guys! Does anybody know how to render to different stencils at the same time?
Hello! How do I find out the volume of each sound in a scene in Unreal Engine?
is there a way to clean 100+ bps nodes all at once have depricated movement in there from the free enmies pack for ue5
Use this console command au.3dVisualize.Enabled 1
I mean in blueprint at runtime.
how come i cant do this compared to the other picture?
Hello,
I have created a Widget for my Archviz Project
I would like when i click on one button to apply a trigger volume to hide others objects.
I would like to know how to set my trigger volume.
In the second ScreenCapture i duplicated an already existing event. The things is the section view in this case is depending on a box (poi selected). What i would like is to avoid chosing a POI and assign an existant trigger volume in my viewport
Any suggestion/help?
thanks
figured it out
So you want to hide and unhide objects in the level when selecting a button?
exactly actually its working
poi needs to be set on POI Filter then following instruction once you clicked on the POI you can activate section view mask
i'll try it,
in case my meshes are bigger than the size on a floor (exterior structure) i guess then all the mesh will be ihidden?
that's the actual event when i click on the image for section view.
I thought creating a new poi called POI_section
Once you select this type of poi you only have to choose the trigger volume and then may be just add a not visible material in game but once you click on the widget it calls the trigger volume and mask all the object inside the trigger volume
(trigger volume is linked with a MPC_SEctionMask material set on all my object)
Yes, it will hide all actors and mesh components together
Using a material is another solution, the solution that I suggested is much simpler and hide the objects immediately
So in that solution you select the level 1 button for example, you get all actors with Level1 tag and unhide them after that you get all actors with Level2 tag and hide them, same for Level3 and Level4
perfect, i'll try it asap, and come back to you, thanks!
Hey y'all! Is there an easy way, not using tick, to run one node (an animation thing, using paperzd), until the character movement is no longer falling, and THEN run the other node? Without a timer, something that I can put in there to temporarily watch it until it changes, then stop watching?
This is for an enemy: I want it to not implement the "HasDied" logic until it finishes the animation that pushes it across the screen
why on earth would you do that in the first place?
hard coded asset paths are prone to cause issues at some point
debug
you can just pick the class from the dropdown?!
mod
or promote the softclass to a variable
is that for your own game or another game?
another
then i would bug them about providing a decent modding API
because they clearly don't
I have been working on an equip function for my character and for the life of me I can not figure what is wrong. When I press my equip key, the anim montage twitches and then cycles through its animation but is in the corect position once its played through its cycle. my character changnges animations properly as well to idle with weapon, walk with weapon or no weapon etc. Its just the equip and unequip anim montages that are the issue. I put this together based on some tutorials and forum posts, so I am sure that's the reason why its so jank. Any words of wisdom would be appreciated
following up on this: yeah BlueprintAssignable is now starting to break randomly in other blueprints. i started a new project and wanted to lean heavier into blueprints but i'm going to pivot back to cpp since it's more reliable. i made sure that the comparison was correct in this case and the blueprints were still not getting hit with BlueprintAssignable. so that's that
I would maybe check up on that. In the years I've done this, I use delegates a ton. I'm heavily against BIEs for a lot of things unless it's specifically only a hook for the child class. But I do a lot of UI work, so it most often is necessary to have a delegate. If your delegates are not running then simply put they are not bound to the object broadcasting them. Either you bound to the wrong object, broadcast on the wrong object, or you unbound the delegate somehow on accident such as an UnbindAllEvents call.
I have been trying to create an inventory system for my game for some time now. I have created a structure to hold all of my variables. in my inventory system I can double click on the slot to equip the item if equip able. I can alos pick up enemies by clicking a button and creating a line trace. When I equip a wepon I attach it to my character. But I dont want to be able to pickup an item thats already in my inventory and equiped. I need to know if I can set a variable from my struct in the slot widget to do this. I can post more pics if needed
using bool like that is pretty nasty imo
a sword or weapon can be reference and you can just check if it's null to deem that something is equiped or not
Also if you don't want to pick up an item that is already in your inventory or equipped, then just a function for that.
IsItemEquipped or IsItemInInventory.
@dense schooner works wonderful thank you very much, you legend
I would refactor what you have atm. Sword, potion and shield should not be a bool.
Im kinda new so how would I would I check if this instance is in my inventory for the funciton
pretty sure everyone would use component as well for inventory. Make it more generic so it works beyond the player character like that. No casting should be needed
anyone should be able to use the inventory so don't tied the code with the player character
well you wouldn't just have 1 item in your game right? So you will need a list (array) of items.
hello I'm completely new to unreal engine or game engines entirely I've been watching a lot of videos and I'm trying to make a "building" mechanic. the goal is to just place basic objects but for some reason every tutorial that i watch i seem to always mess up the line tracing (most recent) and the object mesh wont spawn in general or if i does its off in neverland clipping. any advise would be amazing.
Fun fact of the day!
Did you know that if you create a function with a Struct input variable inside of a BP, create a child of that BP, and then try and override that function in the child you will essentially lock that particular struct from being edited (adding, removing, renaming or changing the types of variables), causing the editor to instantly crash out whenever you try and make changes in that struct? I found out the hard way.
Anyone else ever had that issue? Or is my setup just broken?
ALSO, did you know that Unreal do NOT like it when you try and dabble with arrays of text? I also found that out the hard way.
Until next time!
Don't use blueprint struct if you do, they are broken and will stay that way
as for arrays of strings, I have no issue with them
not that I used it anywhere right now but in my old project, things work as is
Broken in which way? The structs work flawlessly for what I use them for and never had any issues, EXCEPT for that scenario with an override...
I misspoke, it was supposed to be arrays of text hehe. I had to redo like 3 days of work to utilize strings instead of text.. Was troubleshooting for like 2 days straight before I found the issue, UE 5.4 didn't want to add anything to the text arrays, so they always turned out empty
Blueprint structs broke in many way. It's flawless to unsuspecting victim until they stop working. You can just look up search history in this discord and type blueprint struct.
One of the most common error is unknown struct error, and some error leads all the struct values to be defaulted. Things break easily especially when you add or remove a variable from your bp struct definition.
The best way to use struct is to declare them in C++, they don't come as a minefield. I was a victim of bp struct my self and had to re-do a lot of my work.
Switched to struct declared in cpp and I never have to look back.
yeah i'm unsure why they're breaking. to be clear, i've also used them extensively in my previous project with a client/server infra. this new project is a standalone project.
interestingly, completely by chance not intended, i happened to fix one of the broken cases with this code:
AsyncTask(ENamedThreads::GameThread, [this]()
{
OnCharacterDied.Broadcast(this);
});
so maybe the issue is that the broadcasts are not executing on the game thread... for some weird f'ing reason
why the gun not attach to the hand when i disable simulate physic? i already use AttachComponentToCOmponent
if i diasble physic from obejct detail the gun attached fine
Ok I've made two iterations of how to make a movement system by changing a string name then increasing the max acceleration but none of them seem to work. It only prints a single string and doesn't go through them. Am I overcomplicating this?
don't do this
How come?
using string is a terrible idea
Ideally this would be for a boxing game, so I wanted to have three different movement options
Oh ok
I mean I am starting to see that currently
GameplayTags or Enum
is there a node for spawning in a static mesh?
You want to spawn a static mesh component or a static mesh actor that has a static mesh component?
idk. just a straight up static mesh. i've realized that i can prolly make an actor BP, add the mesh to the BP and spawn that though
if you don't need anything custom, just use the SpawnActorNode and spawn a static mesh actor
if you want to spawn a static mesh component from an actor , you can use the add static mesh component node
Yea, I tried that at first and the mesh wasn't showing up. It's fine though, like i said I just made an actor BP with the mesh.
hey guys i have a question
Ask away, someone may be able to answer.
how do you make a charecter chase you for my horror game
BRO I JUST DID THAT
i been using unreal for like 2 weeks lol
so you can use AIMoveTo
and you need to put your shit in a NavMesh
thanks
what am I doing wrong?? 3 days ive been trialing and erroring aim down sights. I have fps arms with an aim animation that lines up the irons to the center of the screen, all I need is to lower the animation based on an attachment. But it needs to be dynamic because the same sight could go on multiple weapons and the system has to apply to those multiple weapons. It should be as simple as measuring the distance between a socket on my sight and a socket on my iron sights and offsetting by that amount. But it causes issues.
If not performed on tick to constantly adjust, small offset changes apply based on look direction so the sight no longer centers itself.
measuring between sockets of different meshes is something I cant do or am doing wrong. if done in world space, the value is too large.
is it something to do with my arms rig? could that impact things?
I feel like it must be something sooo basic Im not acknowledging. Or the world is gatekeeping fps aiming from me ๐
Ok, I'm having problems with this idea. I'm trying to use gameplay tags and watched Matthew Wadstein's tutorial on them but it never covered how to change it like this dynamically
Is anyone here very knowledgeable/ experienced in creating complex systems? If so and youโre interested can you drop me a message and Iโll pay you to guide me. (Iโll show you my code and you tell me where Iโve messed up)
Just drop what you have and see if anyone willing to review it first.
For free ๐ค
Itโs going to be too much to drop on here - Iโm looking for someone that can half monitor the progress
Then you can try #hire-a-freelancer
I think it cost $60 usd an hour for most of them
curious what type of system it is in the first place
We are actively looking for a programmer with blueprint skills to join our team, please contact me if interested, Thank You
self promotion is againts the rule, if we allow this kind of advertisement, the channels would be littered with ads
look at the links above to hire
I'm watching a yt tutorial on inventory system (Native Coder) and it seems that the actor won't get destroyed when i play as client. i kept rewatching the video and cannot find any missteps.
no one can say without knowing what the interface does
but in any case, that code will destroy the actor where that blueprint reside
I believe that's not intentional
what do you mean by not intentional?
Read your own code and tell me if that make sense
If the input is in the player controller, then you are killing your own brain.
If the input is in the character then you are killing your character.
Not the item
the code is written in the item with input enabled and did set ownership to the player
Oof, if that's what the tutorial do, I will be damn
Imo there are a lot of things to unlearn from youtube. Especially when it comes to multiplayer bp tutorials
- Don't handle input in the item
- Don't use legacy input.
This is pinnacle of shit code, no offence. There are soo many ways to do interaction in mp and this one take the worse possible approach imaginable.
yeah, i did have a feeling that it was not the best way to do it
That's legit the worse way possible.
You don't want to give ownership most of the time. Only edge cases because this is vulnerability.
Interaction can be kept simple.
If you don't care about cheating and you trust the client, then let the client trace locally, then server rpc the object it hit.
Then server can run the interact logic. With the passed actor. Such as, giving item to the player and destroying the item actor.
Hello, i want to make an double jump behaviour like in ghost n goblins, but i dont archive it exactly. First i let the player jump like normal, then with a flip flop, the second time the character gets launched. Works so far, but either the character only jumps up or to the direction i moved before, basicly i cant switch direction on the second jump. Can anyone help me?
I take it you're not aware that CMC has double jump integrated
does it work for material parameters?
Hello everyone, this is the noobest math person in this forum ๐ I want to check if a variable is increasing or decreasing over a period of time. I did the coding for getting if the value goes up or down but I'm have no idea how to check it if the value is increasing in a period of 2 seconds. I want to trigger an event if the value goes up for 2 seconds and another event if the value goes down for 2 seconds. Is there a tutorial or if you could spark an idea that will be awesome. Thanks.
Not entirely clear on what you want. You have a float that is changed constantly, and you want to know if it goes up for two seconds, and stop the time if it starts going down, and then start a time for it going down for two seconds. And if it manages to go in either direction for two full seconds, trigger an event?
Hey thank you for responding. I have an gravity/physics moving object. If the object is falling, my variable value is decreasing and If the object goes up, my value is increasing. I want to trigger an event if my value is increasing in a timespan of minimum 2 seconds, if so, the trigger is activated. Same, if the object falls for minimum of 2 seconds, another trigger is activated.
What is the object in question and where do you need the event to trigger? Also how many objects in general?
Initial thought is to just get it's velocity each tick and track a LastFrameVelocity of your own.
If current frame velocity Z is near zero, set a float to current game time. You'll use this float to track when the object started to go up or down. CurrentGameTime minus this float gives a value of how many seconds passed since this object started moving in a direction that you'll set when it starts going one way or the other.
For directions you'll need to track last frame's velocity. At least it's Z value. You'll Sign this to current frame's velocity Z value and the last frame's Z value. If they're both the same then it has been going in the same direction. If it's not then you set the float you use to track time. If the object's velocity is moving, then you don't do anything. If it is moving then check that time float against current game time to see if it's > 2. If it is then trigger your event.
Thank you for this Authaer!
Level streaming not working while in spectator mode. Do I need any extra setup ?
hello everybody ! i'm trying to do a simple system in which the enemies are spawned then they start following the player but even if they spawn (and despite having a navmesh in my level), they never start following the player, does somebody can help me ? here are the screens of my code : (since those screens at tried firing the chase player on begin play of enemy & target actor is now get player character)
you have to debug the ai move to.
Do they move to player if they are spawned by the event, or put in the level scene?
What debug info is in the move to data?
https://youtu.be/ma2BtPOVN-g?list=PLNBX4kIrA68lz8GSxTQKX_0B23tHP6Bl9 this playlist has a lot of info about AI and tracking.
This is the series to watch if you want to create a role playing game in Unreal engine with rich, deep RPG systems and advanced functionality.
In this episode we will be creating logic to switch between states for the AI.
Beginner tutorial series: https://www.youtube.com/playlist?list=PLNBX4kIrA68nyGfIKgyizftebllhKc4ZX
Creating game systems: ...
hey i'm starting to like the draw debug stuff aesthetically.. if i get rid of the Development Only mode of the node they will work in the packaged exec, correct?
i guess i can rebuild similar stuff using GUI
i don't know the gui editor well enough and I'm having trouble placing it properly in space
They're relatively slow once you reach a certain amount
yeah the debug stuff tanks frames.
Put it this way, drawing a persistant line trace each frame for a couple of minutes slowed me down considerably with noticable stutter.
are there ways to switch between orthographic and perspective? and like interpolates the views?
I,m using cine camera and it doesn't have ortho
Hello! Iโm facing a rather specific issue:
I want a name above my characterโs head in my game, so far so good, but:
If I set the widget component to screen space instead of world space, it doesnโt display on certain clients (whereas in world space, everything works fine).
To be more precise: everything works fine for the clientsโ they all see the nametags โbut the server doesnโt see the clientsโ nametags.
Is there a way to switch between a static or skeletal mesh in the heirarchy?
My issue is I have skeletal frames for things like bi-peds, but then I have static meshes for the tank bodies.
Add 2 components, 1 static and 1 skeletal.
From memory, you can get the value of the timeline, so you can use the float for anything including setting float material param
To be specific, you're using a Listen Server host and the Host is unable to see Client name tags?
A component on a vehicle is not working properly after possessing the vehicle with a character. What could be the reason for this?
exacrly
whereas when i use ยซย world spaceย ยป everyone can see every single nametags
the problem seems to be with screen space
Nu uh, I use screen space for nametag and no issue with client or listen server
Yeah, I tried that method, but then I have to duplicate each of those children starting at the static/skeltal split. No worries, I just cheated and eliminated the static meshes that I have for movement components. ๐
reparented the BP back to character, and will move forward from there, no need to be fancy at this point in the game ๐
@keen crystal yeah I agree with @frosty heron with what I've heard so far, i can't think of any inherent problem with screen space that would prevent it from showing on ListenServer host.
Do you have any screenshots of logic for your widgets?
Widget is local anyway, how you display it got nothing to do with networking. Only attaining the data is part of networking.
I'm trying to get the game to know where the mouse cursor is clicking on the landscape, I am using a Texture where each RGB color is a tile. (In my database)
debug, actually find out what's missing
it's most likely something that you do imo
well as i said i didnโt change anything, it started not working when i switched to 5.5
@keen crystal find out what's missing in the first place?
check if the server getting the data it need
see if the client's name reach the server and is stored somewhere then check if its being displayed
at this point you are just deducing instead of figuring
90% of the case people complained about engine bug ends turns out to be their own doing, just saying.
i tested with no names or else, just a default widget with a text in it that displays ยซย Textย ยปย and still its invisible for the server
ill try to look deeper but i tried everything
I mean the client and server both using the same engine version
and the node they are running is the same
it really has nothing to do with server vs client tbh
it's probably what you do in the server instance. Check if the component is visible for the server
Event tick -> Has Auth -> Get Name Widget -> Get vissibility, get hidden in game, etc
anyway gotta to work, gl
and maybe post what you got in #multiplayer
2 issues:
- why is the cast failing?
- the line trace doesnt collide with the enemy
it worked before i changed the mesh of the enemy
Take better res screenshots and also it means whatever you hit is not the right actor so figure out what comes through
Hey guys, apologies if this is either the wrong section or just a really stupid question but im trying to make a first person character that sits inside of a rocket, it needs to be able to rotate on any axis while the player camera is also able to look around while keeping whatever rotation the rocket is in. So far i can either get the camera to lock onto whatever rotation the rocket has however its stuck in place, or i can get the camera to free look but it doesn't follow the rotation of the rocket. I've tried pretty much every combination of settings with spring arms, use pawn rotation on/off, inherit pitch/yaw/roll etc, if anyone has any ideas i'd be much appreciated (lemme know if you need screenshots of the blueprint)
like this?
Yes
where do i check?
where exactly
looks like this in the blueprint
if it matters i changed it from a static mesh to a skeletal
got it working. set collisionpreset to blockall
Hello!
"Trace Under Mouse" doesnt work with Multiplayer.
I think its because i have many controllers.
I have added: Branch is locally controlled, but that did not fix it.
ah i see i have to post this in multiplayer, sorry.
Has anyone had issues with getting SetText in UMG to work in 5.5? Mine refuses to update the text but works in previous versions.
We haven't moved to 5.5. I tried to update but ended up getting some critical check crashes in AI nav code. But I don't see anything changed in Textblock code that would affect that for the 5.5 release. :/
i'm trying to spawn instances and remove them shortly after.. but doing this crash the editor.. i must not be doing it properly..
i need about 10 of them.. maybe I can just toggle visibility and move them around instead of creating/deleting?
Anybody knows a way to use different geometries for a Widget Component? I want to make some sort of warp
Can someone tell me why my character juust keeps floting up when i press F please ?
Its almost like the Stop Jumping doesnt trigger and make the character fall back to the ground again
What's your Movement Mode and gravity settings?
I figured out it was due to some settings on the Character Movement Compoennt ๐ thank you for the reply! ๐
i'm spawning planes where my line hits.. but I want to rotate them to be perpendicular to the normal.. not sure how
i tried addig 90 but somehow i can't use that node
Can you store BP logic inside of components? For example, when equipping a weapon, add/remove that logic as needed. Feels weird having all this empty weapon logic in each of my characters.
I want modularity
That's what actor components are. Logic you can attach to an actor.
Hi everyone. Not sure if this is the right place to post but I have a game where the player character sticks shelved with items at the end of their shift and I was wondering how I would go about doing this? I already have an interaction blueprint system I just need to know how to build the shelf system and item storing.
Can you add and remove at runtime? Im concerned with memory use as well
It's kinda of long video but if any one help me with this bug I greatly appreciate it. (Idk if first upload work so please don't count it as spam)
Yes, but I wouldn't be too concerned with the memory footprint of actor components. Assets like audio, meshes, etc. are 99% of the time going to be larger than any single blueprint class in memory and there's a different means of managing assets being loaded.
Is it possible to create a function where you can "collapse" the output variables like shown in the picture? I've seen that it can be done in C++ by changing the metadata but is there a way to do it with BP only? I have a function that I plan to put 10+ outputs and it would quickly clog up my blueprints
Not in blueprints, you would need to do this in CPP with the method you described.
Only thing i could possibly think of is theres a delay which I assume it,s using a network to populate the leaderboard, Do you do a check to ensure that the network is fully loaded before ? I,m no professional just an idea. (I,ve not done much android stuff personally in UE5, So shooting in the dark here in hope to help) xD
im having an issue with collisions and i cant figure out why. whenever the enemy runs into me, it just pushes me around but when i walk into it the collision event works fine.
theres a video of it if it helps
If you are using a Character blueprint I would check the collision on the Mesh component,, Capsule Component and anything else you have. Im not sure how the engineworks in detecting on who hit who first (maybe done by a velocity check but who knows?!?) I,ve had this sometimes too.
I usually end up creating 2 custom collision channels (Player and Enemy and then set them to overlap each other (unless you need to process a hit event))
I know this is probably a common issue with easy fix, but I can't figure out the google search terms.
Overlapping Actors are Actors the receiving node is expecting Loot Holding Actors
Im not sure if Get Overlapping Actors Class filter is "Find me all X Class" or Filter out X class's
guess it uses a generic actor ref instead of updating the output pin; and idk a workaround, so I guess I will have to redo the stuff in inventory handler
https://dev.epicgames.com/documentation/en-us/unreal-engine/BlueprintAPI/Collision/GetOverlappingActors (Odd it does say "Returns actors of a specified class" but you can see on your node it says Actors are not Compatible with Loot Actors")
Get Overlapping Actors
you can create another array, filling it with Actors each casted to desired type, tho this whole situation looks weird
I would probably go this route
Not tested this but it takes all your overlapped actors attempts to cast to your class and if valid it,ll throw it into the new array of "Your Class"
but give you the general idea of how i would approach it.
@pallid dagger I agree not sure why the Class Filter would not return Actors of the Class you specified :S
I guess it's better to filter original result manually by success/fail cast
I think my bp code might work but someone more experienced than me could tell you ๐
Because it returns an array of actors
It's probably technically doable to template it to change the output type but that's probably more trouble than it's worth
@faint pasture Why does it say returns actors of specified type on the UE Documentation I would guess it,s a bug or not implemented properly, But its not too hard to convert them anyway to your specified class as you said ๐
but it does exactly what it says it does
I think it's just an english interpretation thing
because it does only return actors of that class or subclasses
it just returns it as an AActor
How would you remove a specific item from an array without removing all duplicates as well
remove index
ah, i think i see. thanks
turns out i just had the collision capsule set to block pawns instead of overlap so thats why i was getting pushed. atleast i wont make that mistake agian probably
I need an opinion, is this a good implementation of DLSS3.7? It's my first shot, and I'm still new to UE. Any thoughts on doing it better are welcome!
@crude dew@pallid dagger Thanks for the help. Turned it into a sadly hardcoded libmacro. It seems to work, as my delete interface can delete them from the world.
edit: forgor to clear it. but it works.
.
Does anyone know how to do an input variable based cast?
wdym by input variable based cast?
What is this and why? I feel like there's no need to make the macro at all
not to mention you hard code a string to convert something
I don't need it, but it makes it easier, and I don't have to add another junk variable/function/macro to whichever actor I need to do it in.
make easier for what though? You already got the filter class if you want to filter the overlapping actors
oh ya, these dont work for this #blueprint message
I see but resorting to macro with a hardcoded string is not ideal imo
I cant think of anything, because interfaces dont support wildcards.
this might be one of those c++ moments
in cpp you can use template
By their definition, interfaces are wildcards. you run them generically on any object and that object handles it's own thing.
If you want to generically call a function on an actor that will have very different logic per actor, and you don't need state, use an interface.
If you want to generically call a function on an actor that will have different or identical logic on separate actor types, and may or may not need to maintain state but don't want to do it on the actor itself, use a component.
is this efisien for performance?
No
If you want to let the weapon track the ammo count (for whatever reason), you'd want to setup an event dispatcher that the UI can listen to. You obv dont wanna fetch Ammo on tick , as it serves no purpose being there
so whenever a weapon is swapped you want to unbind from the old dispatcher, and bind to the new one
When possessing an actor class with a character, the owner remains the character, but relevancy doesn't work correctly. How can I solve this issue?
Hi, some weird things are happening in my animation. The loop section is supposed to loop and it does, but the anim notify AN_Stop heal is being triggered during the loop while being obviously out of it. Does anyone knows why?
Let's say I'm using an interact interface for multiple different types of actors. Doors, pickups, beds and so on. That is working fine. But then I want to get some information from the actor I'm interacting with. How would I go about doing that without a cast
A bed for example. I will use the player controller. Which interfaces with a function on the bed. The bed will have a comfort level for example. I want to get that information in the player controller without casting or creating a link.
The bed doesn't know about the player
i am using the multi sphere trace for objects node
i believe due to multiple collisions its hitting the same actor multiple times and add it to the out hits array
i would like to change this so that it would only add a uniqe actor to the array
how would i accomplis this
It shouldnt be the controllers responsibility to house the code for what some X interactable does
It should be the X interactable itself
Or Usable or whatever you wanna call it
you could check object names of existing hits ๐คทโโ๏ธ
Or multi trace with overlap
I think that only logs an objects once on hit
AddUnique
ahh ty add unique did the trick
I don't really understand Enums or Structs - and how i can use them to create my weapon inventory.
Right now i'm inefficiently using bools -_-
Any body got leads on a tutorial (i checked out our tut thread)?
enums are just named integers
structs are just a collection of variables
interface call with a return
Imagine if bool had more than one state, and you could rename the states
bam, that's an enum
Cuppa, mornin' good to see you again!
So the struct would hold all my integer variables stored in the enum..
I'm guessing i should add the item struct variable to the weapon blueprints? Heck even after that i'm a little lost
no
the imagery genuinely does help the envisioning
This is gonna end with a superblueprint doing everything
Your item struct would have everything that you need to define an item.
Perhaps an icon, a class to spawn, a durability value and a stack size for instance
An item struct would look a bit like this
enums you can use more easily to define state. Say you had a weather system. Weather has different states, so you might control the current weather with an enum
The enum might have values such as Clear, Rain, Snow, Clouds, Thunderstorm
Then in your weather system you can do different things based on that enum
oh word, don't need nunna that. So i can focus on just structs?
I use those now!
i've got it broken currently
Struct is just a wrapper on a bundle of variables
It just contains a bunch of information related to what a "hit" is
OH!
"breaking" a struct just means taking it from the dark blue pin, and showing all the variables inside of it
so you're already familiar with how they work, you just didn't realise it :P
hell yeah!
So from my Hit Actor when i connect with an equippable item - currently i'm using tags and bools so it's messy and long. How would i implement my struct and my varying weapons into that (or is there a tutorial somewhere if you've not the time this will likely take me to grasp)
so you want to take the hit actor, take it's item information and put it into your inventory system?
just to clarify what you mean here
Yeah, sorry - contextually it's a bare bones FPS (two weapons at a time) - currently all my weapons are seperate actors/children from the baseplayer.
my brain just froze.
right now i use a hit actor to check if hit actor has tag - actor is then spawned onto my player actor - if no it goes on to check the next tag/bool.
I thiiink i can figure out how to limit it to two weapons but
crap
lost my train of thought again
It's ok, take your time
Is it a game where you can pick up items into a classic inventory (like Minecraft)
Or is it 2 weapons. If a slot is free, put weapon in that slot, otherwise drop weapon and replace it with picked up weapon, like CoD
ah! now we're getting somewhere.
Personally, I'd start by making your item struct. For just a weapon I could think of a few important bits of information: The weapon class to spawn in, and possibly things like it's current ammo, it's ammo in reserves, etc.
The stuff that wants to stick around when you change weapons.
Now, lets say your player has an array of weapon info structs. It tracks the current equipped weapon by storing the index of the weapon info when you switch. When you pick up a new one, it tries to find the first empty slot in the array, and puts the weapon info into it. You can define what an "empty weapon" is, by say making a struct with all default values and no weapon class.
If all the slots are full, it instead resorts to replacing the current equipped weapon index with the weapon information.
Whenever you update the inventory though, you need to handle changing the current equipped weapon, if you've changed the slot you were holding. Don't want your inventory to say you're holding a Glock 18, when you've actually got a Barret .50. So, whenever we make a change to the inventory, we make a note of the slot in the array we changed. If that slot is equal to our equipped weapon, destroy the equipped weapon and spawn the new one.
When a weapon shoots, it checks the weapon information struct for the info it needs. I.e, if the current ammo in the mag is 0, reload, subtracting the ammo in mag from the total in reserves. Then when you switch weapon again, destroy the current weapon, spawn the new weapon. Because you're tracking all the persistent information in the weapon struct, when you switch back, it can "remember" the ammo it had in it's reserves and the ammo in it's magazine.
There are other ways to handle this that can certainly be a bit cleaner, but this should be fairly simple. The bonus is, it would be trivial to change the amount of weapons you can hold, you just increase the array.
Make sure too when you switch the weapons, you increment that current weapon index. That's how you track what weapon is being used. Otherwise, you'd just switch weapon to the same weapon.
Then, if you are at the final element in the array, wrap back around to 0. For 2 weapons it would result in Primary -> Secondary -> Primary -> Secondary -> etc...
For 3, it would be Primary -> Secondary -> Tertiary -> Primary -> Secondary....
You usually need to sample a texture.
As for the pickups, they can simply be a mesh and a weapon struct. Find an MP5 on the floor, it's not actually the MP5 you would shoot, but instead the MP5 mesh that has a struct that says "Weapon Class: MP5, Current Ammo: 12, Ammo In Reserves: 120". The actual MP5 weapon can then track the constant data, like "Max Ammo In Mag", and when you shoot, you take the current ammo in the weapon struct down by 1. When you reload, Ammo In Reserves becomes (Ammo In Reserves - (Max Ammo In Mag - Current Ammo)), current ammo shoots up to Max Ammo In Mag. When you drop the weapon, it simply spawns a new Pickup actor with the mesh of the weapon, and it's current weapon struct, then destroys itself and sets that index to empty.
I love you.
I'ma read, attempt and update ya. I've got m struct set up and it added as an array variable in the player so far
Sounds like a plan. There's a bit of implementation I've left out for you ti figure, but I have confidence youi'll manage. Ping me if you get stuck and, time allowing, I'll help out
So, I have an interaction trace which sets an actor as the "LookAtActor" variable.
Then I have an Input which calls Interact from the blueprint interface.
The bed actor I am looking at works, The door I look at works.
But I want to move the functionality of the bed to the player controller.
How do I let the player controller know its a bed they are using without casting?
Do I add a new interface to that bed actor and check if inherits "bed" interface. Or can I reuse the Interact Interface?
I haven't gotten any further. after applying the start i'm not really sure what to do with it
Might be an idea to start with your pickup actors and weapons, so there's something to pickup and shoot
Make some pickup actors, give them some meshes to represent their weapons, and a weapon struct that you can fill out.
I've gotten weapons and their pickup variants made - with the weapons able to shoot reload yadda yadda
But currently i'm storing all this with bools
though not a weapon struct in them!
lets start by revisiting the requirements.
We need:
- A pickup actor. This contains the information that needs to be transferred to the inventory, as well as it's visual mesh in the world.
- The weapon that can shoot. This contains the static information of the weapon that will be the same every time it's respawned. It also contains the stuff you need to shoot the weapon. It should also contain the modifiable data, like the current ammo and the ammo in reserves, which is initialised on spawning via the weapon struct, and copied back when switching.
- The player to hold an array of weapons. The amount of entries in the array should be the number of weapons that we can equip at once.
- The player to track the currently equipped weapon. This should be a reference to the currently spawned actor, so we can do things like call shoot on it, as well as retrieve the ammo information from before we destroy it and switch weapons. It should also be a index, to know which element of the array is our "equipped" weapon.
- The player to be able to switch weapons. This should involve taking the current equipped weapon, copying the current ammo and max ammo back into the weapon struct, destroying the current equipped weapon, then incrementing the current equipped weapon index, or subtracting it if you want to be able to do a "scroll up to switch up, scroll down to switch down" type thing. You should then be checking that this index is not greater or smaller than the array. If it's greater, snap back to 0, otherwise if it's less than, snap back to the last array index. Then we should spawn the new weapon, and initialise it's current ammo and max ammo, from the information in the struct
moments being a visual learner ruin your day
Hold on while we make you a YT video lol
Another thing worth a look if you plan on using a fair few weapons would be to look into Soft References
Do i have time to grab some lunch?\
This "works", I am wondering if there is a better way to implement this. Maybe in one interface? Maybe using tags?
Iโd say you have all the time in the world
Yes
If the actor doesnโt implement the interface itโll just fail silently
So no reason for the check
This kinda defeats the point of an interface. An interface is for applying general functionality across a range of objects.
Instead, have a general interact interface. The bed might implement this interface to sleep. A chest of drawers might implement it to open. A door might implement it to open.
If you were going to do it this way, you might as well cast
Aye, the bedโs Interact function should make it Activate the Bed
Your player doesnโt need to know about it
But then I am casting from the bed again which is what I want to avoid.
but you're not fixing anything doing it this way, you're just reinventing casting but worse
How would the player controller know they are interacting with a bed or a door?
Because the bed and the door have different functionality
The object itself handles the difference
To a player controller you don't care what it is, you just wanna interact
Your goal should be to just call the logic, regardless of what is under the hood
The bed cares about being a bed
The player controller has functionality which determins how long they should sleep for. It uses the player stats and the bed stats to determine this value, with some randomness applied.
But then I have to cast to the player controller
from the bed, which doesn't matter
the bed should handle it's own sleeping using the information it needs from wherever
then you get to use the same interface to interact with a door, pickup a gun, launch a space shuttle to mars, etc.
The AI red panda is right - doing the same thing currently myself. Although in C++, I use an interface to implement an interact function, which is called when the player presses a key while its line trace detects something. Then each interactable implements the interface and handles its own logic in the function. Ie doors, elevators, picking up items, etc
at least someone got the animal right this time ๐ฅฒ
Couldnโt mistake an animal that cute
So using a single interface for interaction is more important than reducing casts?
reducing casts isn't that important
I thought the point of interfaces was to reduce casting
no
the point of interfaces is to apply behaviours across things that otherwise share no similarity
I.e. invoke behaviour when you don't care about the type of the thing that's doing it
Well.
Time to undo ๐
Wait, what if I can have multiple characters interact. Say an NPC and or player
The behaviour will differ
Well you could pass in information based on what's interacting, or handle two different interfaces
Why is the playercontroller handling what happens when a bed is interacted with tho ?
encapsulate the logic where it belongs
It's ok for the bed to know about the character
character doesnt need to know about the bed , specifically
casting is fine when the interacting class is guaranteed to be loaded (not much of a game without a player character ?)
In such a scenario as the Bed I'd consider letting the bed take temporary control over the interacting Actor (PlayerCharacter) and controlling it's behaviour for a limited period of time. During this time the bed would have some timer or whatever, using its internally known comfort level to increase the Energy level of the PlayerCharacter
Cancel Drag & Drop still crashes editor after 4 years, whyyyyyyyyyyy
mine doesn't ๐ฎ
wait rly?
my editor just freezes after cancel drag drop
editor, as in when played in editor (PIE) ?
Yea, but the game doesn't just stop with errors, the whole editor crashes
gotta test to verify now, so i dont spread lies without verification lol
I saw people talking about this around 4 years ago
and it still happens
for me at least
k
are you doing anything special while canceling ?
nope, I detect if drag left the widget and then cancel it
as in you call Cancel Drag & Drop, right?
yeah im not sure i actually call that
what do you do then?
i need to cancel it cause if I close my inventory (remove widget) the drag and drop image stays on screen with cursor
does it crash for you if you call this?
I can't believe something as simple as this still isn't fixed
This is what I always assume is the case. But everything online is like "DONT EVER CAST!"
ignore that
apparently not big enough for it to be worth fixing
so it seems its not an issue many have
