#blueprint
1 messages · Page 256 of 1
there is too much to share a SS, anyway, I appear to have got it working.
Are you using edit layers? If so I don't think you can do anything about it. At some point they added the ability to apply it to an edit layer, but they also forgot to make it take the other edit layers into account making it effectively useless
I am using edit layers. That's a bummer and a weird oversight. Thanks!
Got a weird issue here. If I put a simple Add Actor Local Rotation in tick with a Y value of 1 - This works fine on a regular actor. It works fine on a pawn. But when it's a character it works if the character in NOT possesed, but if the character is possessed it flips the rotation when it hits the horizaontal (90 degree mark). I can't understand how the possession is causing this. I have disabled the movement component and that has no effect. I can only think that it's the capsule but it doesn't really make sense. Anyone have an idea?
Have you tried using control rotation instead?
unfortunately i can't use the controller in this case because there will be a physics aspect to the mechanic
sorry, i meant movement component, not gonna work for this
Can't use controller or CMC? Confused me a bit there
If you're using physics, any reason why you don't also let it handle the rotation
yeah i meant movement component. but i just set up another test not using add torque, and the same thing occurs.
gimball lock ?
yeah but that shouldn't apply to forces. and also can't explain why this does not occur if i don't possess the actor
GetLocalRotation -> CombineRotator (Y = 1) -> SetLocalRotation ?
true,
looked at source to see if there was something weird but couldnt find something apparent
remove possess player and it's all good
Looks like a weird use case for characters tho
Characters shouldn't rotate other than Z
yeah i also went through the whole chain in the code and there's nothing. bizzarre. and very frustrating!
In that case you should be using pawns with custom movement logic
flying characters do
That's 99% of the time only visually/animation
Almost never do you rotate actual capsule
Might be a reason why it breaks, can you try visual rotation only?
if i could find a line of code that corroborated this i'd say cool, but there is no code in the character component or the capsule that enforces this hidden rule
did it! works superbly =)
Capsule itself should be fine, I'm talking about character (as it typically uses CMC)
Can't check source rn, but that would be my thoughts. Something there which breaks the rotation because it's not a very common use case
At least since you mention it only happens when possessed, which is odd
yeah and i run this and it makes no diffs
anyway, i'll come up with a workaround i guess. just a frustrating thorn that's gonna bug me.
I'm surprised that even works
anyone know why there's a doc page for CastToProceduralFoliageSpawner but none for Procedural Foliage Spawner class itself, according to UE's doc search results?! also my local BP having a Procedural Foliage Spawner Object Reference function input param (populated with just a normal Procedural Foliage Spawner-typed asset existing under Content folder) seems to list no variables or methods specific to it whatsoever when dragging off that param.
is this class opaque or C++-only for some unknowable reason?
Hello, is anyone knows how to add/remove InputAction Triggers using blueprint ? For exemple i want do remove "Pressed" and add "Down" using blueprint. It's possible ? Thanks
You can get an array of the triggers from each InputAction, just need the object reference
Should be easy enough to remove one, I suppose you should also be able to construct them at runtime and just add back
Hello I need some help with a car customiser I’m trying to make. I’m following a tutorial but I’ve missed some stuff out because I didn’t need it, idk if that has affected me but my problem is the buttons take input, but the material of my car won’t change. These r my blueprints
All I need to do is change the colour of the car, which are selected through seperate materials
I’m looking for a programmer for my project
#volunteer-projects or any of the job channels
You need to check that your cast is succeeding. You should also put this logic in the car. You're pulling variables from the car to the widget to make the widget set state on the car. Make the car set it's own state with it's own function.
hi guys am trying to make a item status in my inventory system like when the player interact with the item it destroys and the icon and the name and description shows in the inventory how can i make this ? please any help
Hey I have a bit of a weird issue with my 2D scene capturers since moving my project to UE5.5. Normally the portals should line up perfectly but they only line up perfectly if I eject from the player or when I look at the pinned player view but never when playing. The scene captures mirror the position of the player Camera Manager relative to the portal. Any help would be appreciated maybe I'm missing something obvious.
I'm unsure what I am doing wrong?
when I collect the key that is added into that Item Invetory array, and then set it into the Active Hand variable which is an actor type, the isValid nodes return false when I interact with the door actor 🤔
and I'm not clearing the variable anywhere
printing the data of the variable after the Check For Key event also returns the name of the actor inside the variable
meaning it is valid
so yeah I'm confused
put a breakpoint on your is valid switch and see what the value coming in looks like, then step through with f10
This isn't a "just do this" kindof thing. I think if you don't know where to start on this then you're going to struggle with every aspect of your gameplay and you'll end up with a game that's just a bunch of tutorials all stuck together, and it will be completely unusable. I would suggest really diving deep into the programming side and gaining a real understanding rather than just copying a method. It will empower you to solve all the problems you encounter.
But a rough sketch would be to have a class for your items, have a variable that stores a unique ID. Have an interact mechanism via linetrace. Cast your hit result to your item class. Get the ID. Store that in an array in your character. UI will iterate the array and pull the text/icon etc from a data table or data asset or a map. That's a high level simple version
i don't see a cast in your screenshot
it turns out its an engine bug
so obviously I need to restart
in any case
I checked out the breakpoint
for some reason, it returns unknown?
is this replicated?
you mean referenced?
no, networked
yeah, I'm using blueprint interfaces to transfer the data
if you mean multiplayer, no
you can drag active hand directly onto your print string to be sure, it will print the display name by default. that will confirm that the object has no value
☝️
that's in a different event
did you follow the breakpoint, does it pass through the invalid gate?
and its valid even when added into the variable
yeah
are the items in your inventory actual actor references (have they been spawned into the world? if not, that's probably why they are not valid.
the key is added into scene ready to be picked up and added into the inventory array
you don't detroy the key do you?
I do yes
that's why
first its data is gathered then destroyed from the scene
tooltip says, not pending destruction
I've seen that text somewhere...
this scenario is better handled by data than objects. so the key should have a code or a name, that should be added to the inventory, not the object
yeah, on the "is valid" node 😅
the key is a child of a pickup object that uses a data asset for its type to be determined
and the data asset has a structure of that type
ok, so add a reference to the data asset to your inventory, not the actor
well, not the data asset, but a copy of the struct that it uses more accurately
one issue tho
if I'll be using one item invetory array for all the types
and their structures have different data
like the key having usage type as an enum and what can it be used on
and a tool having a usage type with a different enum
then how could I store those datas?
do I simply go all out?
honestly, you can do them separately, but it might be more complicated than you want. if you want the simple answer, put all the possible fields in and use a single struct. then just switch on a type field for logic
saves a lot of planning from a data perspective
that might work yeah
actually yeah that makes sense
good thing its not just the actor that I'm transfering to the character picking it up
I'm also transfering the structure data of that item
it must only be the data. you want the actor to be destryed otherwise your memory will be a mess
tho, I think I'll keep the actor input in the blueprint interface
it'll probably have a use
timing is an issue, if you are destrying it then it's of no use to you
hmm
you can destroy it in the code that processes it rather if you waqnt to go that way
but you can't call an event and then kill it, the event will fail
yeah...
so instead of actor -> calls interface -> kills itself. Use actor -> calls interface -> interface kills actor
so the picked up item would kill then if you want to use the reference
pickey up key sorry
the destroy runs immediately, before the code in the "picked up key"
I see
or simultaneously, so it's unpredictable.
pretty much like a custom function
the function is called, but on the next frame, the following node will be fired before the function will have its setup running
yeah not the next frame, immediately
right
yeah... it all makes sense now
when getting the info of an actor, unreal tries to look for that actor around the scene
and because that actor is destroyed, it fails
and the reason why the print string was getting a valid info, it was because it was reading the name of the blueprint
yeah so it helps to think in the correct terms. the term for that reference is an object reference. the object must be in the world. "info" is a separate thing, and would be a property (usually struct) that can get passed around independent of any actor or object
edit, actually not really
so if you puit a 5 sec delay on that before printing you'd probably get nothing, cause the garbage collector would have wiped it from existence. the only reason it shows is because destruction doesn't happen immediately.
but isvalid checks for pending destruction
i suggest only passing the struct to your interface, that will solve your issue
yeah, as I have just tested it, and the structure remains
Hey smart people. If I want to have, let's say, 10 different security cameras around a level, do I need to have 10 unique render target actors?
Or can I use the same one and each camera will use an instance of that class?
Depends on if you want all of them to always be visible at the same time.
In this case, I plan on having only one terminal in any level, where the cameras can be accessed/viewed. And I plan to just let the player cycle between them. I don't think I need to display more than one at once.
But if I did, they would need their own unique RTs?
No they wouldn't. You can activate and deactivate the scene capture components as needed and they should be able to use a single render target.
I'm pretty sure if you wanted all cameras to be visible at once, you would need multiple Render Targets
ok cool. Thanks
Ok I'll keep that in mind if I decide to go that route. Thank you
Sorry yea I read that wrong... If you wanted more than one displayed, you would need separate render target for each being displayed..
Quickly becomes pretty expensive
Yeah I think I'll just keep the one and not worry about having multiple cameras displayed at once.
how do you get two tracks to play back to back in a cue then have it loop back to the first one when they are done
is the like a sequence node
Meta sound maybe?
That one allows you to mix sounds
my interchange pipeline blueprint's categories are in the wrong order despite being numbered, any idea what's going on?
So I ended up solving the issue to my portal bug, just sharing in case somebody else comes across it here. After UE5.3 the FOV system of the Camera changed so it kind of breaks the aspect ratio. It can be fixed by setting "Override Aspect Ratio Axis Constraint" to true & making sure "Aspect Ratio Axis Constraint" is set to Maintain X-Axis FOV. (Found thanks to DevSquared comment on his own video)
I'm not looking to mix them together though. I want one to play after the other is finished then loop back to the first one
That's what mixing is though. If you want to do it trough a single audio cue then you have to mix them together
Otherwise you have to play 2 audio cues back to back
Alternatively, this would be a way to do it without meta sound i think, you just gotta know exactly how long the 2nd file is
this might actually be what i was looking for
it says it plays children sequentially
yea thats the one
Why does this not work when I try to shut it down?
hello i hope you are having a nice day so i have a receiver Bp that i have to assign to a character Bp both of these blueprints are child actors of the third person char Bp the Receiver BP is a variable of the character BP and to better understand if i drag the character BP to the level then go to its properties and assign the other Bp that i have to drag as well to the level and then click simulate it works as intended but i want this to be dynamic
should just drag the character and pocess it at game start
but that also wont work right cuz the property is of the child actor not the main character BP
Does anyone know if there's a workaround or better way of getting a reference to a spline component from it's child component? I have an array of box colliders that returns the collider currently colliding with the player but I cant seem to move up the hierarchy to interact with the parent spline component due to type scene component != spline component
Order of possibilities:
Your Input is not enabled on this actor.
The input itself isn't allowed to trigger while the game is paused.
The "Crafting Menu Ref" isn't valid.
"Show Mouse Cursor" is set to false when the key is pressed.
You can use breakpoints to troubleshoot issue like this to see where the logic may or may not be triggering.
hi guys anyone know how i can do top down movement without getting hit result ? i have an area i want my character to move but theres no object the line trace can hit so theres no movement. How to fix?
You have to go into collision settings of whatever is blocking your click and disable the collision of it
Unless I'm getting it wrong and you want it to hit? Idk, the way you phrased the question is confisuing, but the principle should be the same either way
Mouse cursor is set to true when the key is pressed
Because otherwise I wouldn't be able to see my mouse when I pressed C. That works
it's not that the Crafting Menu Ref isn't valid but that the IA_Crafting event doesn't get triggered the second time to begin with
Yes, true, breakpoints do indeed help and reveal us the truth here
hi thanks for the response, its ust an area with nothing that i want the character to fly over asically. theres nothing to collide so line trace doesnt work
I think it's more likely that the input isn't allowed while the game is paused but I still need to have the game paused!
You can configure if an input actions is allowed to trigger when the game is paused.
(in the input action)
ok it was the Set Game Paused, thank you
Hey everyone whats the best way to fix the location of an actor to its current position relative to another actor? For context, i have a container and want all the objects to stop simulating physics and be fixed in space when the door to the container is closed, and if the container is moved to keep the position inside the container
It's not absolutely mandatory that I make a pause - widget but it wouldn't hurt either I think
oh thanks
that would be pretty cool if you can configure that
Through override settings in the IMC_Default?
OH I found "Trigger When Paused" in the IA file itself
I would just do a line trace into the world from cursor location. If it hits something, great, move to the hit location, if not, move to the end of the trace.
Attach them to the thing you're moving. (Unattach when the move has finished.)
ok thanks
You have to make a box volume that collides with the player chaarcter and the clicking
doesnt work with box volume
What do you mean?
Did you change the collision settings?
yes
And the click pases trough even though the collision settings are set to block it?
i added my own trace channel and it for some reason works
thanks for the help!
:DD
Need to move pawn to a specific part of my game board without using level blueprint since its a multiplayer game
Question: Does the Game Mode BP contain the Game State BP??
And if so, what's stopping me putting all the Game State BP code into the Game Mode BP?
The Game Mode allows you to define which Game State class will be used, and also spawns it.
Separating GameState is usually more of a concern for online multiplayer games as GameState is a replicated actor where GameMode only exists on the server.
okay thanks
Hey all, I'm having issue with trying to get static meshes to unload. From a blank FirstPersonTemplate project, I created one blueprint. The expectation is that, when I approach the Actor, the static mesh is loaded. Then when I walk away, I expect to have the static mesh get garbage collected. The problem is that for some reason GARBAGE_COLLECTION_KEEPFLAGS are being set. Does anyone know how to prevent this from happening, and allow proper garbage collecting?
image 1: blueprint definition
image 2: player is near actor, model is loaded
image 3: player is away from actor, reference is set to null but keepflags are set
This is not how asset management works. Loading an asset into memory and setting it in a level are two different things. Generally speaking, you shouldn't mess with asset management unless you're making a sizeable game and have a good understanding of how memory works at a low level. For 99% of indie games, Unreal's garbage collection, default asset manager, level streaming methods, and LOD system are more than adequate for managing performance.
If you're just trying to hide the actor for gameplay purposes, use Set Hidden in Game. If you're worried about performance, consider breaking apart your level using level streaming, or using LODs. You really shouldn't be trying to unload an asset that's just 10.0m away. LODs don't kick in until quite a bit further away (depending on the asset's screen size).
https://cdn.discordapp.com/attachments/598889888531611668/1314360065561460857/2024-12-06_01-36-35.mp4?ex=67537cb3&is=67522b33&hm=433f9b52dc4dc31cfad42ed184bd4da7885d3453a43357b7cef8039465f03df6&
I have a drag drop system as in the video. if the player closes the inventory after activating the drag and before the drop, it stays on the screen. how can I fix this?
Call this when closing the window.
I never thought there would be anything ready. :/ thx bro
I have a sizeable game with about 15 gigabytes of 3D models that i want to display in groups. i want it to run on mobile hardware, so I need to have good control over what is loaded into vram. is there a good way to manage this?
Have you manage to deploy your project to mobile yet?
I thought the limit is like 512 mb to 1 gb for mobile store
You do have to make your own cloud solution for downloading the rest of the file iirc.
LODs are your friend. Constantly loading and unloading assets in and out of memory will end up slowing you game down more than if you just kept the assets in memory. Unreal also has a huge amount of tools specifically for optimizing games for mobile (since they needed to do it for Fortnite). Look at how the Lyra sample project optimizes for mobile.
Yeah 15gb is an extraordinary amount of data for a mobile game. Your assets are likely either too high poly for a phone to run, or your game is too large to be deployed on a mobile marketplace
The cloud model downloading is expected to be a part of this. I'm porting an existing project that was originally designed for PC hardware, and I need a manageable way of displaying a large database of 3D objects to a user. I am hoping to learn how to have control over the memory usage so I can write the application to run for weeks without closing in a permanent kiosk-type installation.
Just fyi. Things that already loaded in editor stay loaded.
You will have to check in packaged (use development build) if you want to see if the object remains loaded or not. Using console objlist
Shouldn't need to touch GC. They already do their job out of the box.
Is objlist the name of a command? I did a Standalone Game build but it doesn't seem to recognize it.
I've tried obj refs in standalone but I couldn't get that to display results
@pliant socket https://youtu.be/K0ENnLV19Cw?t=1851
Listen to this time stamp, also look for the objlist usage in the video
This week Christian Allen will provide an overview of Hard & Soft Object references in Blueprints, why the differences are important to know about, and how you can utilize Soft Object references in your project to help with memory management.
Watch Inside Unreal live at twitch.tv/unrealengine, Thursdays @ 2PM ET
DISCUSSION THREAD
https://forum...
35:11
Thank you! I think I might have been confused by the editor-only nature of the obj refs command. I see the memory values decrease in the obj list command when I step away. So maybe things were working the whole time? One thing I noticed is that a lag spike only happens on the first approach of the object. I'm guessing that's because it's because garbage collection didn't yet happen? If that's the case, everything should be good to go then!
1: obj list from far away
2: obj list nearby
3: obj list far away again
As far as I know, I can't inspect the keepflags in a standalone build. But if this indicates that it will eventually garbage collect, then I think we can move forward
If a reference no longer reachable then it will be gced eventually.
Don't need to worry about UPROPERTY. GC will do its job.
It's too bad obj refs doesn't work in standalone. I'd like to be able to poke around to have some assurance the conditions for gc are met
Is there a memory pool size that I can configure?
I'm thinking that, if I set up an environment with say 2GB memory, then I can observe GC happening due to necessity
Okay I figured out an easier way of testing that. I can toggle gc.CollectGarbageEveryFrame when I'm expecting that things should be ready to collect. So in my case, I move out of range, toggle the flag on then off. Then run obj list. I've observed that they do in fact disappear from the output of obj list Class=StaticMesh. So now it's clear that everything is working, and I have a way of proving things are working. The lag spike comes back just as I would expect. This is great. Thanks for your help!
can someone please help me, i'm trying to get kind of a first person drone movement
very new
what's the problem?
Gonna need more info than that
welp, nothing is really moving or working
i don't think it's receing any values from the gamepad
What isn't?
Do you have a movement component?
add movement input only sends numbers to a movement component
Calm down fren, bugs aren't the end. Explain your expected outcome, what you did, then what happened so far
If i want a for each loop going into another, where I'm checking if the first array element matches an element in the second one, and it keeps saying infinite loop even though it isn't. is there a way to make it keep going?
It won't say that unless it went through 1 million iterations. You either have too many elements it it's actually an infinite loop. You can increase the max iteration count in project settings
MY GUY
thanks
he was asking for me
i'm doing the advent of code in blueprints as a way to learn blueprints
prob not the best way but it seemed fun
and AoC has you iterate through 2000 numbers multiple times
so you know, 2000 ^ 2 ^ 2 ^ 2
not actually that crazy im exaggerating
I think it was like 4 million iterations
I read that Select node tends to be expesive, coz it evaluates every input. How serious can this be and is there a way to test performance impact by those?
I used them a lot now for playtesting different options.
I need to change damage numbers and such.
Any alternative ways to do this?
I'm currently using 'Attach Actor To Component' to pick up objects. It works fine but of course snaps to target.
How would I go about making that transition slower? (so I can eventually add character animations that show him picking the object up)
Do I sneak a timeline somewhere in here?
You can just trigger it when the hand reach the object in the animation
How much does select cost you right now?
Timeline for now if you don't have an animation
interpolate the transform from starting world transform to the world transform of the hand, attach at end
im literally so confused rn but nothing in my project is working, quite literally nothing
tick doesnt work, event begin play doesnt wokr, player character has no gravity, players cant move, code doesnt run at all
players are just stuck mid air, i dont have any settings otehr than default, deleted player and made a engine default character and its still just stuck in the air, project is almost new
this is the only thing in player controller
@solid needle ask a question at a time. Be specific with a problem first.
well im not sure what i can ask, just seems like the game just stopped, never had an issue like this
i was wondering if i did or a setting?
for a start you probably didn't have any pawn in your level
or at least they are not spawned
player start
and what game mode did you use? what is it derived from
proj settings have a GM with player character and controller setup
Game Mode or Game mode base?
yes
which one? the two ain't the same
I would say that's the root of your problem
gonna ask one more time, what is your Game mode derived from?
from GameMode or GameModeBase
again, they are not the same
That might be the issue
to have player spawned from player start you have to derive from the proper GameMode
GameModeBase probably the bare bone of Game mode, it most likely doesn't handle the spawning on player start, etc
like if this doesn't work, it just means your controller were never given a pawn to control (e.g. not spawned and possesed)
it ran print strings and drew spheres on it owner
The sphere is the spectator pawn
this worked^
debug sphere, just drew it on the owner and it seemed to be running, this fixed it, not sure why no code would run too, entire game was in a stalemate but this fixed it. thanks for the 900th time coldsummer
Which code?
show one?
iirc Begin Play is called after Game Mode finish it's thing
to pre-placed actor ofc
:D
Multiplayer is a can of worm btw
This is not how you want to assign roles
avoid Multicast entirely until you know how to use it in the future. Because 95% of the time you don't want to use MC. and avoid youtube multiplayer tutorial. They mostly just give you the wrong info despite the illusion they showed that "look it worked"
any good form of guidence/doc/videos that do the pracitses well?
cuz i am making this proj to learn the stuff
in #multiplayer pinned material.
Exi's compedium and Wizard multiplayer tips and trick should be a bible for those new to UE multiplayer.
you will have to read dozens of times. Practice, fail then repeat until you understand.
Takes a while to sink in
I would suggest reading the compedium, then starts with a very simple task like changing material of a sphere and have the change replicated to all players.
then once you got that task down, you can try opening / closing a door in multiplayer
and gotta stress this again, no multicast for any stateful behavior, that includes the task above.
I want to make a knockoff of Super Mario & Rabbids
How should make the movement system to get which spots you can move to?
- Make a voxel map like Minecraft and have everything stored in some sort of vector
- Build the map directly and just place the spots manually?
Nintendo lawyer has entered the chat
Hello
Hello, I have been getting a weird bug/error and I was wondering if anyone had any idea what could be causing it. When I start up my project a rather important array (The Inventory) that I have in the game instance blueprint doesn't show up until it and every item its attached to is recompiled. Below is a video of the bug. If anyone has any insight it would be very helpful. Thanks
Hi, I'm attempting something that seems simple on paper but I'm struggling with. I simply want to clamp the players axis input/world direction vector like in this visual any advice would be awesome thanks.
what is your reference vector?
DirectionVector = ABS(Min(InputVector * (InputVector DOT ReferenceVector)), 0.0)
Might need to normalize the result
reference being "forward", Input being the actual input vector
Can also just clamp their cameramanger's yaw values if it's singleplayer. But still need to know what forward is and whether it can change directions or not. Like following a spline, or something, or if it's a strict non changing vector.
I'm currently using the AIPerception Component on my player to have an interface function be called on an AI only when it's initially perceived by sight from the player, and when it's no longer being perceived. Problem is, If the player is looking down but towards the AI, it's still being perceived! Anyone have any ideas on a better method for what I'm trying to do? Kinda wish I could attach the component to the player's head socket lol
Best thing I can think of is using a constant screen trace of the player's window, or a polygon mesh the size of the player's screen, but that feels like it'd be very unoptimized especially for multiplayer
Any advice appreciated 🥺
You can make so that the AI "eyes" would be attached to a socket using C++ (APawn::GetPawnViewLocation()). Also, by default the rotation a pawn uses is the controller's control rotation, if it has any, actor rotation otherwise.
Note that by default it's at actor location + (0.0, 0.0, BaseEyeHeight), so you can shift that on the Z axis, it doesn't solve the rotation problem though
Oh I never knew I could change that, thank you! But yeah hopefully I can find a proper solution to the rotating, I set up my system and everything worked fine until I realized the perception cannot get rotated around like a 3D cone, so looking down won't work how i thought... oop lol
Can you print out the control rotation on tick?
Through blueprint, It doesnt even return a rotation of anything unfortunately 😭
Probably gonna end up making a class that derives from AIPerception and edit it myself
if i can
Sorry to butt in, don't camera have collision? I rather not slap a collision as a child of the camera if there is one.
show your attempt?
you can change the collision of the camera!
Where?
do this on tick
Hmm, I am betting this is the sprint arm component though
I do not use spring arm
I'm trying to get the rotation of the AIPerception not the pawn though
i'm just using a camera component
OH I dumb you're right, thats the spring arm
Will controller change control rotation in case you're using a spring arm?
I would imagine that it would, but based on what Renlay is telling it shouldn't, otherwise the observation cone would rotate accordingly to the control rotation
(Also why are you using AI perception component on a player?)
Ideally, I just want the perception to rotate depending on where the player is looking, at I have Use Controller Rotation Yaw set but it's still acting as though im looking at the AI even though im looking straight down
I have an AI that stops moving when the player is looking at it, and the best way I can send signals back and forth is through the AI perception using an interface!
Anyone have any idea on how to solve this mystery
I have a button that when I press I'm having a sound played that shouldn't be played
I've narrowed it do to where something is going a miss however if doesn't make sense on why it's going wrong as I've set the sound that actually should be played
show your code
Oh, yeah, we implemented something like that. We didn't use AI perception for that, it was so annoying. It was a bit annoying, but we had to consider a lot of factors. It depends on how accurate you want it to be, but we put a few point the player mustn't see, e.g. limbs, and we would trace for them every .1s or something like this server-side, and tell the AI if they are seen or not. You obviously want to cull out enemies that are not visible or too distant, e.g. custom frustrum and distance culling. You also have to consider the player resolution so that people with ultra wide monitor wouldn't see enemies on the side of their huge monitor walk towards them
Player's resolution is one of the things I'm definitely a lil concerned about running in to now that I think about it, using AI perception... LOL
I didnt want to try a trace on a tick/timer bc i thought it'd be a bit too unoptimized but hmm
AI perception component uses a cone which is not the shape of your monitor. AFAIK you can't tweak the check frequency either. You have to deal with teams (in case you have different AI teams). It also checks only the center of the enemy, e.g. if you see only the legs/legs, it would consider them as not visible
You're hella right...I'm definitely gonna have to change how this works a bit then, but keeping the interface 🤔
Running one single trace per tick on a modern~ CPU considering that you're running the game on 60 FPS will consume around 0.08ms. Limit that to 10 traces per second and you'll get 0.008ms instead. Use different culling to decrease the amount of work the CPU has to do
Very wrong numbers, I must have confused something. It's way lower with a regular environment. It obviously depends on many factors as well, but it's generally lower in a non-heavy environment
Oooohhh okayokay I'll try this out then :D
In case you can have a LOT of enemies, you might want to have a manager that would limit the total amount of traces your observation component does per second, and it also would make sure that everyone fires the same amount, e.g. if you have like 20 enemies in front of you, and you were limited after checking 5 of them on frame 1, you would check the rest of (6-20) the next frame until you hit the limit, and so on
Ill have to figure out the communication between when th eplayer's looking and then when they stop looking at the AI, the AIPerception would send a signal when it stopped percieving a target so maybe I have to make my own perception system that keeps track..
This too! I'm making a lil horror game so hopefully it wont be that many on screen LOL
We had a game state component that knew all the players and enemies that have to be traced. It also would run all that logic without ever telling the player that they are observing anything or doing any of that work
OH a custom actor component handling everything would make sense lol
You should make this first, and see how it performs in your case. In case it gives you performance issues, add culling and whatever. Profile first, optimize after
[...], but we put a few point the player mustn't see, e.g. limbs, and we would trace for them every .1s or something like this server-side, and tell the AI if they are seen or not.
🫡 I will go forward little by little! Thank you sm for all your help!!
Gonna sleep on it since it's been itchin my brain all morning
You're welcome, gn 😄
Is there any solution for different languages when it comes to voice? I mean, e.g. the NPCs speak English, but I would like them to speak Chinese, I need to create a system in BP that selects what language it should be played in? is there something similar where I can set the Audio languages the same as in Localization Plugin?
I have never done anything like that, but there should be voice classes that you can use. I feel like you will something about localization along the lines, it's like using Text for localized text, but Dialog Wave instead of SoundCue/MetaSound
Hey, would anyone like to help me with some blueprinting issue? Trying to customize the current VR Template to my own application / game..
Hi, if I cannot see .uasset files in the content browser but they are on disk and UE says they might be corrupted, is there a way to fix them manually somehow?
No, rollback is the usual solution
that's a tough claim... trace cost depends on scene complexity
True, but that's a rough estimate for simple scene. Ultimately you have to profile either way
How do you code a diplomacy system?
As of now i have a TMap on each player, with Player*, EAttitude.
Though sometimes there could be teams, right?
Would you do a struct for this?
just to know in case i dont regret it later
is the TMap enough?
Thinking about creating a plugin to use chat gpt/claude ai directly in the editor to create blueprints and materials. Would anyone use this?
Oh no
Why not?
Chatgpt has an extremely poor understanding of the engine outside of extreme basics
I would make it know about the context. I have been experimenting a lot with the API recently
Context won't and hasn't stopped it hallucinating many a function.
I understand, but it could help a lot with getting started
I think LLMs are at the point where if you know the terminology, and some basics of what it is you're trying to do, then it can be helpful as you're then able to catch where it does make mistakes and so they can help you save some time coding, if they happen to make something that works how you're hoping.
"Starting out" is probably the worst time to use an LLM as when things don't work, or they don't work as expected, and you don't know what to tell it as you don't know the lingo or how to best describe what you're trying to do, it will just fall flat and you can end up wasting more time trying to reformulate your questions to that LLM and trying all of its possibilites rather than actually discovering how you should properly approach such problems and learning why its not working.
unreal already got such system built in (kinda). it's mostly used for AI but for whatever reason epic made it only usable in c++
that's why this feature is seemingly non-usable for blueprint purists
because you have to add a bit of cpp code to make it work
I wasn't clear. I didn't mean starting out as a beginner in Unreal, but starting out with a task. I agree that someone probably needs to know terminology to actually do something productive.
I do agree with your take on that LLMS are at a point that they can be meaningful. I have being using claude (for rust development) lately and I am quite shocked with how good it is.
i've been using LLMs in my work and honestly it can be good if used as a more advanced google. but (in my experience at least) i found it's problem solving skills to be really bad because it lacks context of my situation or it cant understand it. it always insists on the standard way of solving things!
Yes fully agree. However if you make a system that provides this context to the LLM it could help a lot
sorry I'm not sure what you mean
🫡 So how do i kind of recreate this? Is this also done by a TMap or something?
nope just an interface
the interface asks what "team" you are. if you are with team "1" and the response is team "3" for example then you are enemies
otherwise you are allies
i think if you return "-1" then you're neutral
Thats not really a diplomacy system with varying degrees of affiliation
When i hear diplomacy i think 4X games or something alike where you have some weighted friendlyness toward other factions?
Affilitation is probably not the right word to describe the relationship between different factions 🤔
you can extend this. this is just an example i used in my code to let AI decide what are their enemies and what not. but you can make it so team 1 and 2 to be close friend while team 3 and 4 to be more like buddies
jesus you didnt have to jumpscare me like that 😂
but yeah you got a point
Not sure if this is what they ment tho 🤯
the issue is AI requires thousands of examples that constantly needs to be updated at the project grows to get the context which takes time that i'd rather spend figuring it out myself
Rider got some working stuff there 😅
i havent used it but i did try out another plugin in visual studio that is basically the same and it was...meh
Thanks to everyone who tried to help me out earlier. I think I've got my solution, was just over thinking it
I don't think it needs examples, it needs to have a concept of how the graph execution works and needs the functions (with descriptions) it can use.
Hey I'm using unreal engine to make some basic turned based system is anyone free to help me I would really appreciate that?
i dont know how effective it will be with only that but i wont complain if it does get good 🤷♂️
It would definitely be an experiment. Just out of curiosity, would you pay for such AI?
depends, on my current job the issues that i tend to solve are very simple and doesnt really take much time out of my day
i would probably pay for it if the projects were a whole lot more complicated
you got fab for that! /jk
Well
If fab had an in-editor ai helper that just found the assets you couød be interested in based on some simple description etc thatd be nice
Having to search thousands upon thousands of assets of mostly unrelated stuff is meh
Thats something id pay for 😂
??
Ask your question, people will answer if they can. If you’re looking for teammates, #instructions
All you 'need' is some game manager which assigns turns to either players/AI or entities directly
And some method to end the current entity/players turn
I have created a turned based system in unreal egnine just need some help to clear out some things that i'm stuck on so that's why i need some help if someone can jump on a call i can show them
You'll have better luck just asking specific questions here.
okay got it thanks
thats exactly what im trying to do
so a TMap should work for that, huh?
TMap with Player, and then a Stance
So you meet a player, push it to the TMap, with the stance Neutral.
Then declare war becomes Enemy
Tmap or array
Array would need a struct?
Yepp
Array of FDiplomacy
Tmap sounds better, because its like, get player , stance
Going from -5 to 5 or something
Tarray you will have to iterate to find the player
Its a small array but sure, yes
🫡
crusader kings would like to have a chat
Then id have some function translating the float to a human readable stance
understandable! Maybe some kind of credit system could work
Fair 😅
You mean 3d objects? Afaik 3d model generation is very bad
yeah in my current plan i have an enum for the stances
Yepp 3d objects indeed
Even scenes, blocky layout would be awesome
Imagine the iteration speed if you could just speak to some ai describing things to change and it does it accurately per descriptions with some intuition/context awareness 😁 thatd be the dream lol
Interesting. That could definitely work with a custom model, not sure if an LLM is good enough at spatial awareness though
It is a bad calculator for example
Hello, im in new in unreal engine and Coding in general i was hoping someone could help me out. I tried to make a jump arc for my charakter, but the jump timeline only activates if i keep pressing the jump butten for the full duration. Can anyone tell me if i can trigger the jump timeline by only tapping the Jump butten?? ;/ thx in advance
Quick Reference/Ownership Obtaining Question
jump z velocity is only used at the start of the jump
instead just call Jump, then play the timeline which modifies gravity over time
im making an AI for a strategy game. We all start as neutral. How is he supposed to choose the neighbor to attack?
Random? Attack the strongest player around/most threatning? Attack the weakest?
If attacking weakest, it might be more what a human player would do. But then everyone gangs up on the weakest. And the strongest player never gets attacked and wins...
If they AI choose to attack the strongest then it becomes a shit show where all players gang up on the strongest.
Civ4 got an AI talk that might give you some tips
with Soren
🫡 got it. though will take an hour 🔥
worth it, imo
however you want
I'd maybe give them some sort of a personality, like one type always goes for the big guys, one type is super ruthless and goes for the weaker ones, etc
yes thats the best. Also accounting for relations, attitude, and reputation. if the player is warmonger, or expanded a lot, attack him to grab his land
this is super tricky
i can see it snowballing into something like the ai ganging up stupidly on the most powerful or the weakest
This just in:
AI is hard
The classic is the Civ example of Gandhi 😁
Gotcha, I was under the impression that casting wasn't the best performance wise. Just to clarify, I can use (the bottom reference) to check if the player is overlapping with a trigger box and I do not need to reference it. Otherwise, If I did need a reference to the overlapping object, I would use a cast. That sound about right?
I need to have a Ghandhi in my game too
The "Other Actor" pin is the reference to thing beginning and ending the overlap in both scenarios.
The Begin Overlap using the cast is effectively checking if the thing overlapping is any BP_FirstPersonCharacter instance, and if so, you can use the "As BP First Person Character" to then access functions and variables of your BP_FIrstPersonCharacter class for that particular instance.
The End Overlap comparing against FirstPersonCharacter is checking if the Other Actor ending the overlap is specifically the character that is possessed by the first player on the instance of the game. It's not quite the same as the Overlap Begin would allow any BP_FirstPersonCharacter to continue with the execution, where the End Overlap is allowing only the first player's possessed character (if there is one!) to continue with the execution.
Where did the Components section go in the BP editor?
still on the top-right side as it always was
huh...trying checkign and unchecking again?
if that doesnt work then try restarting your layout
Interestingly - it will not uncheck 🤔
and I've already tried closing and reopening both the BP, and the engine.
It must think it's being displayed somewhere, but there is no other window.
try resting the UI
That worked! Lovely 😅 Thank you
Why is this not working?
promote static mesh comp to var and reuse it
yeah but it's not even showing up in it's place
never shows up
Is it safe to use the Allow Explicit Impure Node Disabling feature in late 2024? Seems like it's been around for some time. Will it create issues with other team members who might not have in enabled?
hard to tell from ss, I would make component in bp and just swap/clear meshes in it. instead of addind/destroying alltthetime
ok good idea
At the moment it works like this
This is the most messy part of my project so far
check cropout sample, they did mutable character with diffrent hats and tools
but im not making a top down game
i mean that sounds relative simple, why should i use cropout sample?
problem with this is if i where to rotate the person character roll by say 90 degrees then try to do the pitch it will act as if the drone is up right instead of doing the person character rotated pitch
Hello, how could I make that when Z key is pressed first, I can then press X to spawn something
but also that when X key is pressed first, I can press Z to spawn something different?
@drowsy anvil one way it is to have a buffer for the input
You basically just store the key that gets pressed. When you press Z, you check the last input in the buffer then do action accordingly if the condition are met.
Is there no object iterator in blueprint?
I'm trying to check how many instances of an object there are.
interface is not replacement for casting
don't listen to youtubers, read this instead.
https://dev.epicgames.com/community/learning/tutorials/l3E0/myth-busting-best-practices-in-unreal-engine
casting cost almost next to nothing, it's the hard reference produced by blueprint cast is what get loaded to memory.
Why is your widget updating player';s objective?
Widget job is to just read
contain the objective as a data. Then widget simply read the data.
also avoid get Actor of class
pass the instance you are interested in instead. If you have trouble with that, you should watch blueprint communication video.
and use character blueprint?
Also I would advice to not do multiplayer at this stage
Im not doing multiplayer
are you copy pasting tutorial from youtube then?
you mean var reference?
I kinda was
not even suprised looking at the multicast
Multicast
(Ryan Lalley)
garbage channel
Multiplayer prep 😅
whats wrong with ryan lalley
If the code above come from Ryan lalley then that's what's wrong
So like, you are still doing the same thing that I strongly suggest not to do.
you don't want to do
PlayerCharacter -> If I Interact with the log do A
PlayerCharacter -> If I interact wih a door do B
PlayerCharacter -> If I interact with a chair do C
etc
etc
etc...
get rid of that macro,
make a generic interaction system. HANDLE the interacted logic in the Interacted Actor
PlayerCharacter -> Run Interact function on interacted Actor
Chair -> Makes the player sit down
Door -> Toggle open/ close
A lamp -> Toggle the light
one key aspect with this ^ is that now the code is logically placed inside the actor that performs the various things
encapsulating the logiic
which future you benefitis massively from
yeah but it's easy for me to pass boolean variables via regular variable references or using this "get Actor of class" node
shooting your own foot moment bruv
I can either do that through character bp or wb_objectives, and you told me to not have code or have minimal code in WB_objectives
im not trying to be in high horse here, but you will only have headache moving forward
and using cast, I need to have an object
yes but what should I cast to the other bp? I can't cast bools
Please watch the second pin
or can't use object bool, im not used to it lol
there is a lot of misconception, I would suggest going through blueprint communication video first. It might be 2 hours video but you will end up wasting more time trying to brute force things you don't have a grasp on.
I need an object to cast
And really that video is the best 2h you’ll ever spend learning unreal
Watch the video ColdSummer mentioned. It’s the second link in the pinned in this channel
which sounds really stupid that i need to cast an object, im just trying to cast boolean lol, why would i use cast? sounds counter productive, maybe im wrong or maybe idk how to use it because people always told me its very memory intensive
Announce Post: https://forums.unrealengine.com/showthread.php?101051
This Training Stream takes a look at Blueprint Communication. We find that Unreal Developers of all levels can sometimes struggle through the concepts behind moving data between objects. So in this video we'll take a look at the different ways to make Blueprints talk to one an...
You don’t know how to use it and what it actually is
Also watch this when you’re done so you can understand why those people telling you cast == bad are actually bad teachers
Forgot to paste the actual link lol oops #blueprint message
Excuse the silly art but, is there a way to properly deproject from the player's screen and properly make a "cone" shape out of a multi box trace? Ive currently tried it the way shown but end up with the result in which its only facing in the X direction??
first pic is the player facing 90 degrees from the X, the second pic is the player facing X at 0 degrees
You want a cone, sideways from character ?
😭 no no I want it in FRONT of the character, my drawing is just really crappy
like the character's camera forward vector
Terrible drawing then 😂
LOOLLL
just to learn how things can be structured
Small at the character camera location, to big at a set distance
The multitrace doesnt really do scaling
You can do overlap with invisible mesh tho
Yeah but it wouldn't scale with the player's viewport size I think or idk how I would do that lol
Ig It wouldn't hurt to try? Ive already attempted 2 different methods trying to get this system im making how i want it to work
It can if you make it scale
Or you can do regular linetraces
10x or smth
Or 1x + box trace scaled with distance
Honestly I might try making multiple multi box traces but in a cone shape, each trace getting bigger, instead of trying to do one multi box trace lol
Prerty expensive solution if you do it on tick
true, im gonna do it on a timer to make sure it doesnt do more than 10 traces a second
https://blueprintue.com/blueprint/c1qe7ik-/
problem with this is if i were to rotate the person character roll by say 90 degrees then try to do the pitch it will act as if the person character is up right instead of doing the person character rotated pitch
So Instead of doing the multibox traces, I noticed there's a function called "Draw Debug Cone" that allows custom setting but its only a debug visual, might try to figure out the code for this and move to making something in cpp instead lol
Cpp allows custom shapes 🙂
The act of casting costs nothing. And whoever told you this needs to learn how to correctly explain things assuming they understand it themselves and aren't just repeating bad advice.
Linkers cost things, and are a separate issue from casting. Linkers make ObjectB stay in memory if ObjectA is being used and ObjectA has a linker to ObjectB.
Casts cause linkers, so do any other functions, having properties of that class in your BP, etc. It's not just a casting thing and reducing it to that is a huge detriment to your learning.
Linkers are also not a bad thing. You should always have a set of code only classes that are always loaded that you can cast to freely to call functions on. These are parent classes of your others and they'll have no size, no assets like sounds, textures, and meshes linked to them so no memory footprint.
Do anyone know a good way to select an int (in range) where each value is weighted? I was thinking of using a float curve to help determine this as the range could change but I can't think of any meaningful way to use it.
How much wrights are we talking about
TMap <value, weight>
Combine weights, random value between 0 and combined weight
Might be easier with an array, you end up looping anyways
as an exmaple, I have an array and if it's length is 2 then it should pick either 0 or 1 where it's weighted more toward one, but if the array length is 4 then it should pick a number between 0-3 but the weights would then be different. The length of the array could possibly go upto 6 so it would have to also provide a value between 0-5. I might have to use combining weights method and just have 3 different weight groups.
With a combined weight theres not really a group to anything
0, 0.5
1, 0.6
2, 3.2
3, 1.0
4, 1.3
Tot = 6.6
Roll = Rand() x Tot
Chance of rolling 2 is ~50% (3.2/6.6)
any idea how id figure out what this is? i searched "createwidget" and found nothing
You're calling the 'CreateWidget' function without specifying the type of widget you want to create.
I think I can get away with this.
Edit: Although the length should be the last index lol.
show how you search for it
Does this work?
I'm not at a point to test but with some quick math tests in excel it seems to add up.
Edit: Actually, one min, ill make a call in editor function and print the results.
Oh so the curve determines the odds for copying more genes. I see
Yea, it seems to work. I've tested with two curve types and it seems to line up.
This way I can increase/decrease the upper bound and it'll adjust the weight due to the curve.
For dure nicer than my method !
I have the problem that I can not click the buttons in the Deathscreen. I’ve used "UI Only" and set the mouse cursor to true, but that also doesn’t work. I'm really struggeling and I dont understand why it wont work. Can someone help me?
Can you try Widget Reflector to see what's the most front widget?
Run the game and get to the death screen, then go to Tools > Debug > Widget Reflector. Then select "Pick Hit-Testable Widgets", go to the game, hover over it and press Esc. Then go to Widget Reflector and see what is says
The image was in the beginning on top of the vertical box but even after moving it down, its still in the foreground. Do you have any tip for me how to fix it?
You need to use Widget Reflector, there are a lot of settings that we need to look at to solve this. You might have some widgets' Visibility set to Visible instead of Not-Hit Testable
Yeah its the visibility. When I change it to not hit in the widget reflector it works but when I change the image in the death nothing happens
If the Image widget is the top most widget and it is set to "Visible", you will not be able to click on buttons below it (you can't click through it, you are clicking on it). You need to set the Image widget to Not-Hit Testable
Okay I fixed it. Thank you: )
I'm glad to hear that, you are welcome!
Can someone help me out? I have a parent widget that holds a boolean and 5 children that inherit from said parent widget. I would like to change the boolean that is in the parent from its children to affect the parent's boolean only.
The result I am getting is each widget is changing its own version of the boolean and not the parent one. How can I change the parent's boolean from its children?
Are you using Lyra plugins? CommonGame, CommonUser, etc?
CommonUI, Common Activatable Widgets to be exact
That was to Ape. But in your case, what do you mean when you say parent and child in this context? Is this layout hierarchy, or class hierarchy?
CAW_Parent is the parent, CAW_Child(n) all inherit from CAW_Parent
Then I'm unsure what you mean? If there is a boolean in the parent class. Then it's the same boolean in the child class that the child can override. If you use a CAW_Child, you're using both in one object, with the same boolean. So how are you changing/testing/expecting it to change?
I will be more specific. The parent is called CAW_BASE (a place for all menu widgets) has IsOptionMenuOpened boolean. MainMenu (a child of CAW_BASE) can open an options widget, and when it does, the boolean becomes true. OptionsMenu (child of CAW_BASE) has OnHandleBackAction event when clicked, the boolean is supposed to turn false.
When I call IsOptionMenuOpened in any child, it always returns false.
This isn't how you handle this. The reason for this is because this boolean is per instance. If you have 2 children and set it true on one, it will only be true on that child and not the other.
If you're using CommonUI, you shouldn't be doing this anyhow. Can I ask what you're using this boolean for?
I have Common Activatable Widget Switcher, and shoulder buttons on Gamepad set to change between widgets. the Logic is in MainMenu, but when OptionsMenu is opened, the shoulder buttons still move the CAWSwitcher. I am not using a stack, I need the background widget to stay visible.
The boolean is to stop the MainMenu shoulder buttons from activating.
How are your shoulder buttons handled? They should be bound to commonbuttonbases or to a tab list widget that registers with the main menu activatable widget. If you push another activatable widget over that, those controls stop working automatically.
They are InputActions in an InputMappingContext that is added in PlayerController when it is constructed.
They are just thrown as is in MainMenu
That's 100% not the way to handle UI or menu inputs. For example if you put a widget up and want the character to stop receiving input, you should simply be able to set your game in Menu or UIOnly mode. You shouldn't have to maintain complex states of "IsThisThingOpen?" And if you put your game in Menu or UIOnly mode, those input actions in your player controller stop working. Which is why CommonUI uses triggering input actions.
The other benefit to triggering input actions is that you can use a mouse cursor, keyboard hotkey, or gamepad key to click the same button. Which means your click logic is all in a single place encapsulated in your widget without your player controller having to care about widgets it needs to delegate controls to.
Wow, that makes things very easy indeed.
-
I just saw the option you are talking about in the Input category of CommonButton. But I can't find that option in CommonSwitcher?
-
So you are telling me if a CAW is "activated", by default even if it is not in a stack, all previous CAW input will be ignored? Without manually disabling previous widgets?
They should be. Test it out. Make a CommonButtonBase child and drop into the same widget as your switcher. Set up a triggering input action for it and make it change the switcher. Then you should be able to put the options menu over that and press the same triggering key and it shouldn't work.
Makes sense, thanks a bunch! I'm glad we had this conversation
If you have trouble with it, feel free to leave a message here. 😄 Happy to help.
Should dub you CommonAuthaer soon 😄
scared me, i thought i was doing something new
I searched "createwidget" in the content browser 😅
im certain it's coming from the async loading screen plugin, however i disabled it but im still getting the error
I do have commonUI and all that though
Does it go away if you put a blank widget in the common loading screen plugin?
im curious though, is there a way to ensure a plugin is TOTALLY disabled? I feel like there's stuff forerunner from Async Loading Screen that shouldn't be there (I disabled it yesterday in favor of Common Loading Screen)
Even though I disabled it
How did you disable it?
for this, i recreated the c++ std's discrete_distribution in unreal
Why is this failing to compile?
You added an additional output. It's only meant to have the text return value.
Basically looks like what i suggested, in finer terms :p
built a procedural grid that gets huge without performance hit, realized I have no way of marking tiles
the strategy rpg dream continues 🙃
Using isms?
The tiles are just stored in an array
I currently use 1 array and 2 tmaps
Array for all tiles, and maps for tile/entity and entity/tile lookup
I can prob remove both tmaps at some point
oh maybe i can have things find their location in the array
maybe i'm smort enough for that
Thats what my tmaps are doing atm. Storing the entity reference and the tile its on
So the tile array doesnt really have or care about that info
Hey everyone 🙂 I have a question about dynamically programming a spline. I drew a beautiful painting to represent it lol.
Is this something that is possible to do? I have a spinning object and want the spline to always connect the 2 points with a curve around the spinning object
I don't even know where to begin with this so any tips would be great
i have nothing to offer unfortunately, but it is a beautiful painting
oh no i'm using procedural mesh components
like literally just drawing squares to make the grid
i wonder if i can get the vertices or something to get locations
You dont need to directly connect them
Just use grid snapped world location as tile location
World location / gridsize
I'm pretty sure my grid construction is incorrect for attempting to build the array in the first place, will have to go back
does anybody know how i could generate random noise maps in blueprints? and then use that data to spawn a bunch of actors and set their transform values based on the noise map
imagine vertices in a landscape mesh, but the vertices are the actors
incorrect as in not symmetrical or what?
you can always validate tiles and ignore those who are "un-reachable"
So, as per usual I have a child's understanding of what I've actually accomplished, but from what I understand I'm simply calculating a number of vertical lines based on rows int and a tile size, a number of horizontal lines based on columns int and a tile size, and then drawing a shitload of triangles to render, 2x triangles per "square" created by the lines - then I'm drawing the lines and squares, and essentially toggling visibility on the squares as needed
previously, I've been making grids out of actual meshes, so I have had an easier time building the data behind them - unfortunately I had a hard time toggling the grid on and off and also as that grid gets big things start to get wonky
I'm sure what I'm wanting is super possible, I just don't have an understanding of the way the data works when the stuff is built in construction like this, I guess
thats what i ment tho
using gridsize , you can use any world position to have a "tile"
just define a starting point (left bottom corner of the map), and go from there
StartLocation = SW Corner;
StartLocation + (X = Rows * GridSize, Y = 0, Z = 0) = NW Corner
StartLocation + (X = 0, Y = Columns*GridSize, Z = 0) = SE Corner
StartLocation + (X = Rows*GridSize, Y = Colums*GridSize, Z = 0) = NE Corner
and then run a forloop using the rows and the columns to add uhhhhh, vectors to an array?
ForEachLoop with something like a trace from top to bottom, returning valid tiles (mesh with correct tag) and their height
And I can just use the actor location of the BP as the start location? That way if it moves for whatever reason (I can't think of one, but give me a week) the calculations still track
what spline is supposed to be? UI (2D screen space / widget), mesh in 3D, is it static or dynamic(physics) 🤔
please hold, coding
more dang money in the squize coffee fund, i thought i was free of you and could just put it into my daughter's college savings 😭
It’s a spline path that I will use to animate objects from point a to point b in 3d space
have you tried Spline Mesh Actor/Component?
at least as a learning material
Yes and I know how to modify a spline point at runtime. But the idea of keeping an accurate curve around the planet regardless of positions during rotation seems over my head haha (the spinning object is a planet)
Id split the two concerns at the very least
Well I guess becoming PhD in math isn't an option
, so I would try smth simpler e.g. create few perfect splines manually as a reference(in a different states like in you painting). Log their params to be able to investigate diff to get some idea of what params to focus on (further research).
Do you have specific blockers? i.e. way to determine perfect tangent from end(purple) to the planet?
(about splines) might be useful: https://www.cs.cornell.edu/courses/cs4620/2022fa/assignments/docs/assignments/a1/splines/
Do it a bit differently maybe?
Approach, slowdown and attach to closest spot on a circular spline that is rotating around slower (or faster) than the planetary rotation until you're within X distance of the desired landing spot, then detach and translate down.
Im not sure I completely understand. Why would the spline rotate at a different speed than the planet? Maybe I explained my goal poorly
It doesn't have to be a spline, but I believe there are some nodes that make it easy to find the closest spot on a spline. That spline can be a circle. It rotates faster or slower than the planet as that then allows it to appear like your ship is still in motion relative to the planet but the ship has no actual velocity itself, only what the circular spline imparts on to it.
Oh okay I see what you’re saying
Probably doesn't have to be a spline even... Just some means of attaching the ship to a scene component at whatever desired orbit which you then rotate at whatever desired speed.
welp 😦
Hello everyone! Is there a way of doing arrays of arrays in ue5? Looking for it on the web I found out that the solution should be about structures, but actually I can't find a way to refer to an inner element by index. I mean, if I have the array A containing 3 arrays, I need to get the second one with A[1]. Do you know the right way of doing this?
You make a structure that has a single array of the type you want. Then you make a property that is an array of these. The index of the array holding the structs is your row index. You use that to get the struct that has the array which holds your column index.
Thank you very much for your support, but what do you mean when you say a "property" that is an array?
Variable in a class.
You can also make a second struct that has the array, and make a property of that if you don't want to have to remember to make an array every time. Or want to make helper functions around the struct maybe in a library.
This should work, assuming that you also restarted the editor.
for the direction, i want to be able to find the amount for the Blendspace. Is this the proper way to do it or is there some other way i should be using?
Not quite. Blendspace's direction should be in local space. Actor's rotation is world space. So you'll want to inverse transform this rotation into the actor's transform space and then break the rotator to get the yaw.
how do i do that, sorry im new to ue
i have the inverse trasnform
i just dont know what else to do
Drag off of the AsAIWolf and GetActorTransform. Drag off of the orange transform pin and Inverse Transform Rotation. Plug the GetActorRotation into that inverse function. Drag from the output of the inverse function and break rotator to get the yaw.
like this?
there is calculate direction node in anim blueprint
@fiery anvil
/**
* Returns degree of the angle between Velocity and Rotation forward vector
* The range of return will be from [-180, 180]. Useful for feeding directional blendspaces.
* @param Velocity The velocity to use as direction relative to BaseRotation
* @param BaseRotation The base rotation, e.g. of a pawn
*/
Should I use that?
🤷♂️
it's what I used for my BS
I don't do math but what Authaer says probably give the same result
Hello, someone knows how to bind the event from UMG in animation to a event in the graph ? thx
@gaunt plover
click on the drop down arrow, see what that gives you
nothing, when i click the menu disappear
use the endpoint then I guess, I'm using 5.1, can't check for you.
For anyone who has used Mover 2.0, is there any way to manually cancel a layered move from Blueprint?
anyone know how to use Game animation sample footsteps for AI to hear? im not sure how im supposed to do it, the GASP notifies and stuff are very confusing and i dont know which are the ones im looking for.
could someone help me figure this out? im trying to print all the objects of this class so i can see how many there are
Looks like you'd do it in BP_AnimNotify_FoleyEvent in the ReceiveNotify function aroun here:
okay, ill test it out, thanks
There's also these checks in the GetAudioBank function... Gives you a clue as to how you can test for specific events relating to footsteps.
You can get the length of the array, no need for loop
Drag from the out array and type length
is there another way to do this? Essentially I have a widget in another widget but they're not directly parent-child, more like great-great-grandparent-child
This is way easier than I'm trying to make it - how do I calculate a sphere trace using 4 vectors
It's math, and I can't math right now
I'm pretty sure I can just do the SW corner to the NE corner, and then the radius needs to be the distance from the NW corner to the SE corner
Why is it that your widget needs to know its great-great-great-grandparent?
This smell like a design problem. Normally parent should manage child widgets, not the other way around.
I wanted to access some RecipeWidget stuff from Wood
I believe that worked, but I'm not generating any hits on my procedural grid with the multisphere trace
I'm not intending on changing stuff, just accessing attributes
In this kind of setup, this "Recipe Widget" should probably be generating the "Recipe Ingredient" widgets that are going to be used, assuming you want this to be something reusable, in which case you could feed in a reference to the RecipeWidget that's creating them when you're constructing them through an exposed variable. Otherwise, if you for some reason want to manually place them like you are currently, you could still create and pass in a reference on construct of the RecipeWidget.
yea I just got an idea of generation on construct which might actually work better
the naming is pretty weird
like if it's a crafting ingredients, shouldnt they be added at run time
it could be anything, not just wood or stone
well yea
I don't know why but my brain thought that I could add children to subclasses of a custom user widget (although I know I can't). I'm still testing the system atm tho, making sure everything properly works
I meant you can't (shouldn't) do this, it overwrites everything
really depends what you want to do
you can just slap a canvas panel
some elemnts can't have children (e.g text block), you will need to wrap them to a widget that can have child
My math was wrong anyway, it makes a tube
in my use case it probably won't be optimal
well now you know how to make a tube ig
not sure wym by that, gotta elaborate
see this is the widget that the wood and stone thing are inheriting from
so there's already, like, content in there
adding new stuff in the subclass overwrites all of the masterclass content
not sure I follow, we probably thingking of a different thing
anyway if you need the child to know it's parent you can follow what datura says
create a variable for the outer and expose it on spawn
On Widget construct, the parent can pass it's reference to the constructed widget
I think I'mma go the other way, let the parent generate the children
imo that's how it should be. The parent is normally the master widget
at least that's how I've been rolling my widgets
what I don't understand tho, see here I have my things in a horizontal box. When I add (generate via bp) a new ingredient entry, how does it know whether to size fill or size auto?
this thing
I’mma sleep on it. Worst case I could just position the widgets via the parent bp with some fancy maths
There's a way to do a single sphere trace directly on the pmc but that doesn't help me much
anyone know how to fix the snappiness of the wolfs turns? it makes it feel so unpolished and robotic.
same with the rabit although its less noticable
don't know but if I were you and you are using cmc, I would probably try to change the turn rate
tho wolves can make snap turns so it is not the turn rate imo that's wrong here but the legs are always straight since it is playing forward only running anims which is not working out when turns left
but again it is just a video game not a movie so its up to you how much effor you wish to put into animating a realistic looking animal here. the major point was to get the ai working (and you already managed to do that) so from this point it dips into art more or less
wolves? i think the rabbit should be able to make snap turns
not the wolf
their mass doesn't allow that
yes both are very nimble
and rabbits are also kinda known for doing snap turns to escape predators
but even on open field
indeed, animals are great at using their body, im just saying it is also a visual issue here that they running forward only but never sideways which would make it look far more realistic
yea you are right, watched it again with pause, and the wolf is rigid the whole time, that looks off indeed
I have determined that procedural meshes and line traces are bugged and I hate myself
I knew the second part, but I just discovered the first part
My procedural mesh collision settings and my multisphere trace settings
Bugged how? I'm using them just fine in our latest project.
I suspect they aren't bugged, I just don't know why it isn't working and I'm definitely too smart for it to be anything other than a bug
Lol, I feel that some days.
(this is a joke, i am a joke)
Is the trace not hitting?
It's not hitting anything
The only thing I think it could be, but it's probably not this, is that i'm doing the generation in the construction script and the trace in beginplay and somehow that's messing with it
I set my out array to advise me "No collision detected, idiot!" in the instance it is 0
Sec. I need to open my IDE, but there's a thing you have to do that regenerates the dynamic mesh's collision. It doesn't do it automatically because it can be somewhat expensive.
well there's a box to check in "create mesh section" to create the collision, but if you've got another trick I'm all eyes
realistically i'm only running the trace once, so I'm not super concerned about performance
Once you're done generating the visuals, try calling SetDynamicMeshCollisionFromMesh.
This is C++, but it might help you. Since these should all be BP callable functions.
FGeometryScriptCollisionFromMeshOptions CollisionOptions;
CollisionOptions.Method = EGeometryScriptCollisionGenerationMethod::SweptHulls;
CollisionOptions.MaxConvexHullsPerMesh = 4;
UGeometryScriptLibrary_CollisionFunctions::SetDynamicMeshCollisionFromMesh(DynamicMesh, NewMeshComponent, CollisionOptions);
NewMeshComponent->SetGenerateOverlapEvents(true);
NewMeshComponent->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
NewMeshComponent->SetCollisionResponseToAllChannels(ECR_Overlap);
NewMeshComponent->SetCollisionResponseToChannel(TraceBlockChannel, ECR_Block);
Note you may need some of the settings different, unsure. These are specifically for an invisible mesh that I generate around regions.
I'm using procedural meshes - which if I remember from the last 4 hours of googling, were meant to be replaced by geometry scripting and dynamic meshes
Ah. My derp. 😄 Yeah I haven't touched procedural meshes. I went straight for geometry script stuff.
i might try to recreate what i've got here using that in the morning
does radial damage work on yourself? (if you're the causer)
Sphere trace?
Multipshere trace
Wont regular line do fine? Complex trace
It might if I knew how to do the math
why use a sniper rifle if a bazooka will also work but better
although in this case, I'm shooting blanks in either instance
Well math is just the same as the placement/generation
I mean, the multisphere should be working though
efficiency be damned in this instance, there's something janky in the collision
and the sphere is big enough to at least hit SOMETHING, theoretically
Got complex trace turned on?
Should, so long as you don't add yourself to the ignore actors list.
Visually confirmed location with debug trace?
I've tried it with and without, and with and without "use complex as simple collision"
yeah
so there are two procedural meshes, one for the lines, and one for squares inside the lines, set to hidden until moused over
i create a dynamic material instance for each mesh in the construction script before the actual drawing of the lines and such
at this point, in the interest of desperation, I've set collision on both meshes to the custom channel
yeah
so it's got to be something with the way i'm building the grid
it's checked on both the lines and the squares, I posted the collision settings up above, I made a custom channel and it's set to block
to be fair i recreated the nodes you pasted in a new project and it didn't work either
so i'm gonna go to bed
ironically, the top down character can't run through the mesh, but it's not detecting a hit
Id just go with default trace channels for now
Instead of custom
I added tags to my landscape so i knw what i hit
that most recent screenshot was on visibility, i made a whole new project and just made a single section to test the way you pasted it in
idk what i'm doing wrong, but 🤷♂️
Yeah
And it’s wild, cause I can’t move through it, so there’s definitely some kind of colliding going on
Show your logic
dm me your cashapp dude that deserves a latte - so now i do need to convert that multisphere to a line trace
and i would just loop for every row and column a linetrace to store the xy coordinates as tiles
You kinda already have the xy coords if the generation is relatively simple
Youd prob wanna fetch those in the original loop for creating the triangles
I mean. It doesnt even depend om simple rly. Just grid allign the locations and divide by gridsize
TileVector = Location.GridSnap(GridSize)/GridSize;
TileID = TileVector.X + TileVector.Y*TilesX;
I’ll see what I can come up with in the morning 😂 two hours past my bedtime at this point
Thanks again for the help, I meant it about the latte - so dumb, I thought that checkbox was so the trace didn’t trace itself
Why is my Movement Component's Get curent acceleration is equal to '0' even though the character is moving towards me in game
@steady thicket you are looking at the preview instance. Which is stationary in its preview world
No, I've added a print string node, and when I played it. The character is moving but the acceleration remains 0
@steady thicket show how you print it
I'm getting values on input
I think it should but the value stays the same regardless of the speed
acceleration and velocity aren't the same, you can have a velocity of 500 and an acceleration of 0. Wouldn't that just mean you're no longer accelerating?
acceleration would be the rate of change in velocity overtime or something like that
Thats what id expect it to be
"Whats our delta velocity this frame compared to last"
guys is this logic correct to detect when the player presses a button to pick up a weapon that's within range and attach the weapon to the character
this is in the character blueprint btw
and this is the weapon blueprint logic to call the custom weaponwithinrange event
bc when i playtest it it's not working but idk if it's my blueprint logic or the input itself not being set up correctly
Yeah.. the way your logic is set up right now, Weapon Within Range only gets triggered once, the moment you step close to the weapon.
You'll want the logic to work the opposite way - use the action (IA_Pickup) as an event, and when it's triggered check if a weapon is currently overlapped.
make interaction component for your character
Anyone know If the Advanced Steam Sessions plugin is still updated and is okay to be used for online play in 5.4?:0
They really should make CommonUser an engine plugin. It makes session handling much easier.
how do i do this tho
what nodes to use
@scarlet marlinyou can attach the same blueprint directly with out spawn another one.
First show collisions in the console command and see if it has collisions .
Then try to print any message when the player overlap.
if it overlap then should be fine .
you can make variable OverlappedWeapon save the weapon blueprint .
and when the player Press Pick up Key Add the OverlappedWeapon to the Picked up Weapon. and attach it to the socket.
you can change this to the variables if the Overlapped Weapon are not empty then he can pick it up if empty no.
Decide when Overlapped weapon is empty depend on On Start Overlapp and On End Overlapp
Hope you got what I mean
ok nvm i fixed it. turns out you're not supposed to set the class filter on the get overlapping actors node
but now picking up the weapon causes my character's movement to start spazzing out...like if i try to move forward it will just go in some random direction instead
why tf is it fucking up my input tho aggghhhh
what?? you mean it's fucking up the way my character moves bc now it's constantly colliding with the weapon it's holding?? or what
most likely
ahhhh fuck
lemme try turning off collision after pickup then
ok thx that worked
I have aiming spell and I reckon I can just pop it on activate and hide it on deactivate. So the crosshair guaranteed to appear when the character is aiming.
Just wondering if I should use the HUD anyway.
Could always use UI Extensions, or something similar. Just push a crosshair to slot on activate, remove on deactivate. Make it like a stack so that other things can push or pull theirs as well but only the latest is shown.
will that be Common UI?
i have 0 extension and plugin for UI atm
been forever since I touched U.I. How can I ensure that the crosshair is always at the centre of the screen?
drop a canvas panel and do 0.5, 0.5 alignment?
UI extensions is a separate plugin to them. But you can kind of replicate it yourself with some delegates from somewhere global like the AHUD class. Basically the container registers and listens, abilities broadcast.
And yeah, 0.5 alignment and 0.5 anchors will be center of screen if the canvas is stretched to the screen.
How do I cast to a widget? I want to start an event in the widget
you can just use the cast node, but normally you don't want to tell your widget to do something
it's widget job to listen and read
like the player shouldn't even need to know the widget exist
imagine a quest update from your quest component. It will just broadcast an event that the quest is updated. Widget picks it up and display all the needed info for the player.
you want to maintain one way dependency
I have remove from parent node in the widget
Basically I want it to be invisible
Is there a better way to do this?
So it can appear and disappear on the hud
so how would i fix it, im reallt new to ue5 so i dont know how to do stuff. im using a Character BP for the AI and im using an Anim BP. I have a BS that includes turns but for some reason it dosnt work properly. (this is the code to determine the direction and input it for the animation)
is there any way i could make my character use physics to spin around, like a 360 spin. im trying to make a sloppy sword attack "animation" for my game
Simulate Physics and add torque?
Sorry. You'll have to look into physics more if you want to use physics to perform such an action.
Hi! I was wondering if there's any way to grant a blueprint that's not the level blueprint direct access to any actor from the level, just like the level blueprint does, so that I can drag and drop references to actors in the blueprint. I know how to get references to actors into blueprints and C++ by defining variables, and I've been doing so regularly, but I came across a use case that would benefit greatly from the ability to drag and drop actors
No, and it would kind of break how unreal works if you could.
The reason the level blueprint has that functionality is because the level blueprint has a reference to the things that are placed into the level and there's a direct relationship between the level and the level blueprint.
To make it possible for other blueprints to do this, the "new" blueprint would need to know about the level in order to know about the references the level blueprint contains so that you can then reference them. If you wanted references to objects that are present through multiple levels within the blueprint, then you'd need to load every single level that contains those references in order to load the blueprint. All of a sudden you're loading way more data than you actually need to.
Learn how to use and get references correctly. For singleton actors there's nodes like "Get Actor of Class" which gives you a reference. You can have objects register themselves with other actors which you can then iterate through and perform logic with. You can use traces and collisions to detect actors and build the functionality off of such events. Use can even use instance-editable variables which allow you to place actors into the scene and then link them together without having to build functionality into the level blueprint with direct references.
Thank you for the detailed answer!
The blueprint I have in mind would be applicable to just one level. I would just derive a new blueprint for each new level, so that direct relationship could indeed exist for my blueprint as well. I'm not debating whether what I asked for is supplied by Unreal Engine, I understand from you answer and from what I could read online that it doesn't, I'm just pointing this out.
As I said in my original message, I already know how to get references to actors into blueprint/C++. I'm already using all of the techniques that you mentioned (although I try not to use "Get Actor of Class" much because of how expensive it is, but that's a different story). However, in my opinion, none of those really fit into my purpose, which is to have a kind of "Director" entity that can easily reference specific actor instances and apply arbitrary operations to them (arbitrary as in applying different operations to different instances of the same class), which is the reason I'm looking into doing this in blueprints and not in C++ (more flexibility).
I could just use the level blueprint, but I was looking into customizing the blueprint graph itself to give it a tree-like layout
how could i make the mesh spin?
the mesh only falls to the ground
it doesnt spin
is there a better way to do this? i want to check if any of the vector values for xyz are below 0
this feels stupid lol
Get Actor of Class isn't expensive, especially if you define a specific class to use, and especially if used only a single time at begin play to get your reference. A "Director" sounds like a singleton actor.
What I would do is probably have a component that I attach to actors that on begin play registers with that Director (using GetActorOfClass). I'd figure out what most of the commands are that I would need and create functions within the Director and the component to facilitate the communication between them, and using GameplayTags and GameplayTagContainers to help facilitate identification of the actors to be controlled by the diector... Then I could subclass the director as needed for each level to have its own unique functionality and execute whatever commands needed.
Using Get All Actors of Class (Actor) on tick... That is expensive.
That almost sounds like a level blueprint.
Get all actors of class is never really a good thing.
Get all actors of class -> get index 0 is 😂
Yea XD
The trouble with the level blueprint == it's not reusable. Any functionality you want to make you couldn't reuse.... So then yea, maybe just make that Director as a base class containing the functions you'd want to use within your level blueprints, drop it in your level... Now you can easily get your director in your level that has all the functions you want, and then you can just use the level blueprint and feed it the references you want when you want to the director.
This is a good idea, but that would make it more rigid than I'd like. Again, don't get me wrong, I get I'm just asking too much, but avoiding as much setup as possible is precisely my goal. If I need to classify actors with GameplayTags, that kind of defeats the purpose. I'm not complaining, and I understand it may be the only way to do it. And if it is, so be it
Yes, it's pretty close, only missing the option to shape it a bit more to my will. I'm probably just getting too fancy
In this case, reusability doesn't concern me. In fact, I want to avoid any extra levels of abstraction if possible, so that it's easier to see what's going on. And the idea of passing actor references from the Level Blueprint to the Director actor is promising. Closer to what I want
Anyway, I know I'm asking too much. Thanks for all the help! 🙂
No, it's cool. The whole issue with Level BPs is that they aren't re-usable. Making a director which has reusable portions for you is a 100x better system.
