#blueprint
1 messages · Page 296 of 1
Then attach component to component.
Don't know how that will look like though. What you probably want might be a full control of the camera instead of spring arm.
no I mean change the attachment during gameplay
Attach component is the node
You probably should detach first before attaching it to w.e you want.
@fierce crypt what sort of camera mode are you using?
Spring arm is kinda gross for third person camera. Have you ever tried going to corner.
Since you mention cpp. I recommend taking a look at lyra camera, camera mode and penetration feeler.
I don't think I can make a decent game without it
might be a https://canary.discord.com/channels/187217643009212416/1004083824344436767 question but I am having a minor bug that I need to fix and I cannot figure it out,
Hit space bar once, jump works, stamina drains properly only once if tapped once and even held only drains once.
But if I tap it in the air it will drain stamina again without technically jumping so I can drain all stamina by spamming space in the air
I assume I need to have a on the ground check to proc the jump action?
There should be a bool you can check called is in air or something I forget the name in the cmc
thanks!
yeah it's... interesting
??
initially third but moving to first person, trying to get a mirror's edge type feel, which is... potentially complicated?
There is a CanJump function but idk if it's exposed to blueprints
Drag the cmc onto graph and grab from that. I'm not 100% there is a bool like that I just remember something like that exists
It might be a is flying or is jumping tho
I'm afk so can't check
doesnt seem to be it hm
Found it
now it checks whether you have enough stamina, if you do it checks if you are airborne and if you are not then it allows you to jump otherwise it leads to stop jumping
Nice
last bug
if I hold my sprint I can sprint forward, left and right, I cannot start sprinting in the reverse. This works as intended but if I start sprinting and holds it it allows me to sprint backwards. I need to figure out how to set the speed back to walking as an interruption when walking backwards to keep from back sprinting.
oh wait I think I got it
nvm didnt work, not sure what I am missing
I got it, its not perfect functionality as I would like it to start sprinting again when I stop moving backwards but it at least interrupts the sprint which is fine works for now
wack, I got it to continue sprinting when I move forward and interrupt when moving backwards but now I can't start sprinting to the side but if I start while moving forward I can hold it while going side to side but not start the action
wait it works now, I dont know what fixed it as I didnt touch anything lmao
I'm a noob so I might just be missing something obvious but...for context, I'm making a little first person point and click adventure style game. Currently working on the camera. I have it set to that clicking on the edges of the screen rotates the (otherwise static) camera, and clicking on invisible walls in the center of the screen moves the player about the environment. I have camera rot and moving the player using set location and rot, and it's all working smoothly.
The invisiwalls (I'm calling them Travel Objects) are reporting the same rotations as the objects in the world at different points in the chain - I'm just lerping self rot to wall rot and the figures are all working out (seemingly). However! Depending on where in the level(?) the wall is, the camera on click is positioned either (1) along the long edge or (2) perpendicular with the plane (how I'd like it to be). Getting dot product, of course, just swaps which camera is wrong. Any ideas?
Hi experts!
I'm currently practicing parkour level design in UE5, but I have encountered an #blueprint issue while implementing the sprint function.
Even after adjusting the Max Walk Speed, the actual speed does not change.
I have also tried modifying the Max Walk Speed in the Character Movement BP, but I still don't see any difference.
Am I missing something important that I should be aware of?
Thank you all for your patience and assistance!
I actually just finished this! gimmie a sec and I can show you my whole setup
Start and Stop Sprint Functions Respectively
Ohhh Thank you so muchQQ I'll absolutely check this out
@hollow acorn I am using the Enhanced Input System so dont forget this bit in your Character so it knows what mapping context to use (Basically tells your character to read the Input Mapping Context, which is a list of all Input Actions aka Keybinds)
Hi, How to only selected actor change the mesh when I load the level again. I'm using StaticMesh variable for the GameInstance.
Each instance of the changeable actor should point to its own variable.
Right now you probably have 1 variable on GI and all the instance point at the same variable.
Hi, can you pls give any clue, what variable should I create on my GI?
Does it have to be in GI?
If it is for some reason then you will need to map the actor and the value.
I would suggest using map variable.
If the actor always placed on the level and not spawn dynamically then you can use a map of Object reference and the static mesh (as the value)
Otherwise you will need to ID objects that are spawned dynamically and the one placed in the level with FGUID
You will need to involve save game objects too
Tldr uniquely identify the actors and give each of them their static mesh variable to pull from.
Or honestly.. just make the static mesh variable inside of the actor. I am not sure the purpose of G.I in this case.
Just use save game object to store and load the data.
you can look into vertex animation 🙂
works well with ISM's
allows for quite cool stuff extremely cheap
Hi all !
I'm using Sphere Traces by Channel for an melee weapon attack.
But my attack animation is fast and then I don't have enough "traces" so my Actor is not getting hit
I tried to fire the "Traces" on the Event Tick and on a Timer at 0.01 looping time but it's not enough..
Anyone has a tip to have more traces firing ?
when your fps is soo low, even if you do it every frame you will not be able to hit everything.
imagine you are on 20 fps
even if you do 20 fps, that's 20 trace you can do.
One approach is to trace back.
So I have to use a "Capsule Collision" overlap event on my Sword to resolve this issue ?
What is trace back ?
the most reliable approach that I end up using is to bake the data.
You simply trace back to the last location, I can draw a doodle.
Bake the data ? How ?
I mean in From Software games for example even if I have 10 fps I can hit the enemy, what are their techniques you think ?
You record the data and store it somewhere.
but that's not something you can do with blueprint alone.
this is not silver bullet for non baking approach but may help.
Red is your traces on tick
Yellow is for every trace, you trace back to the last location
P.S that method didn't help me when the fps is too low. Only baking works for me.
it may help to buy plugins from Fab 🤷♂️
It seems that the baking data method is what all AAA games do like Elden Ring etc..
I don't know for sure but it's one approach that many use.
ofc it comes with down side
like I will have to bake each weapon
but gives the best accuracy.
even at 5 fps, my character still do a full swing.
And best performance I guess as it's baking
So when you say baking data, I have to bake each attack animation of each weapon ?
maybe I am just a noob who doesn't know how to trace back better, you can look around for some plugins in fab.
Yup, I store the socket locations. Then I slice time on the anim notify state.
for every sliced part, I write the time stamp and the location of the socket.
then the anim notify state simply check for the current time and simulate (trace) to every point that hasn;'t been played yet.
Ok I see but
What is the downside about making a Collision around my weapon and check overlap events ?
As games like Street Fighter use that
no downside for that
you can still bake and trace using overlap events
the part that is the issue is baking the data or not.
But without baking datas, overlap events are not good ?
But why, what was the issue ?
the fps is too low
that I only manage to get 2 fps on my swing
so that's 2 points to work with
let me show what happend before I went with the baking approach.
This is with 100 fps... btw
with 30 fps, I get no traces or just 1 / 2 . Not acceptable.
that's really
nice
I guess I have to find a way to bake my data traces animation
But with your baking data it still traces over time, right ? I mean the traces not hitting instantly all at same time ?
it traces based on the current time
i am just simulating the missing points
So if I get in mid combo, then it's not gonna do a full swing
you can't really automate this in blueprint though. If you have to write down each points manually by hand, that do be a nightmare and possibly inaccurate.
I have an actor where it will play a montage with Anim notify states in it. When I press a button it will look for anim notify state in it, advance the time to each sliced point and record the socket location.
can't really do that in blueprint so perhaps the path of least resistance is to get existing plugins from market place
unless you want to tackle this your self then maybe it's a good time to dive into cpp
But look at this plugin, it seems that this person made it without baking data (see description of plugin) https://www.fab.com/listings/b3556c78-463b-4610-a81c-1bcb8916e202
yeah perhaps they know what I don't know.
He is talking about "interpolation" and "previous frame position" things
in my view to have an accurate swing, we need at least to know the direction it's going or at least the angle of the swing.
@odd kiln My advice would be to just look at plugins in fab.
can't comment if they are actually good or not as I end up rolling my own.
I see, I will try to look at plugins or trying to find how other games do that.. thank you very much for your help !
If I understand correctly this is what you do with baking but he bakes in real time ?
Look @frosty heron I found something interesting I have two sockets on my sword to signify the start and end of the blade. Each tick, I am lerping between the last known position and the current position, doing a hit scan with each increment to see if it hits the player. That’s it really!
@odd kiln that's my attempt of doing that.
Current position to last position
again though, they may know something that I don't know.
He said Even at 6FPS I’m registering hits fine
that's cool
that's not really a good metric by itself
6 fps, but at what animation speed ?
if you do 180 swing in 2 frames, its gonna miss
that would be true even at 60 fps
question the becomes do you really need it that accuracte to begin with, or can tracing shapes do 90% of the work ?
I don't want accurate hit
The problem I'm facing is that sometimes my traces are not hitting the Actor Capsule Collision
Because my animation is too fast
I'm already doing a Sphere Trace, what is a shape trace ?
sphere trace is a shape trace
its a trace with some shape
instead of just a line
i think cone fits better for sword swings
assuming they're relatively horizontal
I already use a Sphere Trace but my animation is too fast so it does not hit
Cones ?
you need to fix the trace location
not base it on the sword
or whater weapon there is
So based on what ? Because I want the traces to follow the movement of my sword as well
you probably dont, when its that fast
you could do that but it's more complicated with the timing of a swing imo
well maybe not complicated but .. 😄
i'd probably setup notify states
in the anim montage
and have some parameters for the location and shape of the trace
at the most basic something like this
maybe this gets far more complicated than what Coldsummer suggested tho
I want to control the sequences in the sequence folder by getting them from the wideget blueprint through get asset by path. But I don't see get asset by path, what's the problem?
So the thing is to make a bigger radius of my Trace Shape, right ?
So even if my animation is fast, the trace wille be big enough to hit the enemy
But I have 2 questions : 1) How to make a "Cone Trace" ?
And 2) How to do so the "Cone Trace" expand over time ?
What I don't understand is that if I attach particles to my Sword, even if the animation is fast, the particles are following the sword great
Been a fair bit of time since ive used Unreal.
Updated a project to 5.5 and ive got a bunch of errors all relating to "player mappable"
Hey everyone, Hope everyone is doing well . I need some help with an issue. When I launch my game and press "Press to Start," it loads into the main menu. My main menu is set up with a cinematic camera, a built scene, and a menu widget.
The problem is that when it loads, everything (props, lights, camera.) is visible for a moment, but then everything disappears—only the widget remains. It’s like the camera is gone, or everything gets unloaded, and it stays stuck in place.
Here’s my blueprint setup and a screen record of what happens.
Has anyone run into this issue before? Could it be related to level streaming, camera settings, or something getting destroyed? Any help would be appreciated!
Click on eject. If you are looking at what ever should be there, then it's probably a black widget element or you fade in sequencer.
there's also a setting in sequences which restore the "default" state
Can also remove all widgets when the screen turns black to find out if it's the widget.
@frosty heron That’s the thing I also thought it was a fade animation or a widget covering it, but when I’m in my Main Menu level and press play in the editor, everything works fine. However, when I run it in Play Standalone mode, or from Start Menu it works for a second and then goes black again. And I removed the sequences and get current level name just see if that works.
Hey folks
If I load a level from a main menu, should I use the "Load Stream Level" in order to have a loading screen that is not just a static frozen image?
- And if so, how do I make it work the same way once loaded? (With the one on the left, the GameMode BP is loaded, actor location set, controls handled etc.)
- Guess I would also have to "unload" the menu level afterwards.
Or can I just do a "Load Stream Level" node first, and on "Completed", I call the "non-async" node "Open Level", since it should now actually be loaded?
hi, i want to update you about my ammo band situation, and i settled for this (might change later but its good enough for what i need now)
You can use Load Stream Level to load the level in the background while showing a dynamic loading screen, like a progress bar or animation, so the game doesn’t freeze. Once the level is done loading, use the On Level Loaded event to set up the Game Mode, spawn the player, and do any other necessary setup, and then you can Unload Stream Level to remove the menu if you’re done with it. Just my opinion it might be wrong 😅
Whats this supposed to do? Define different bullet types that can be shot?
My suggestion would be to just grab a loading screen plugin.
Im using an audio component on my blueprint and added a meta sounds component to it and im trying to change the variable pitch in my meta sounds asset by using set float parameter but its not working
yes, its supposed to let you select witch ammo band to use and witch bullet to fire next, using a simple loop to select the next bullet to fire depending on the belt you use
Here's a few recommendations. Removes the delay node (I prefer timers), simplifies the bullet band check and allows for variable band sizes.
Depending on the class sizes for your ammo, it might also be worth considering if they should be stored as soft class refs and then you load the specific classes when the band is selected.
I have a problem, I am unable to create a Blueprint that contains both an Anchor Field and a Geometry Collection where the Geometry Collection depends on the Anchor Field. Does anyone know how to approach this?
I have a camera + spring arm attached to a car.
What would I do to make sure the camera stays upright when the car flips over?
I already set the spring arm NOT to inherit the roll of the car, but that doesn't help this issue
anyone ever encountered a similar issue?
It's not open anywhere else.. I just finished working on updates for this BP and now I can't save it
I cant' even save it as a new BP
harddisk full?
nope. what a silly issue.. turns out I had deleted a macro from a library that was in that BP and I couldn't save it because of that
I am making a river boat game using unreal engines water and buoyancy systems.
It looks and works great in the editor, but the river has fragments missing when I playtest in Standalone or build the project to an .exe. The water is still "there", I can paddle on it and float there, etc, but the visual aspect is completely invisible.
If anyone has experience with this or a potential fix, I would appreciate it, thanks!
using a Pawn with a Floating Movement Component, is it possible to make it keep it's current velocity when unpossessing ?
When I unpossess it, it freeze and start moving only when I repossess it with a PlayerController :/
Hi there !
I am currently trying to create a crafting system, however after watching the tutorial by "ryan Laley" on the inventory system, I am struggling to find the elements to make a crafting system. (2 slots. If the 2 elements placed in the 2 slots are good, then craft the object with a datatable).
I am a very very very beginner un blueprint and I have literally no clue how to do it and everything i tried was a disaster haha 😅 (Working on UE5).
I would appreciate help from a patient person, ready to help me on this feature ! If anyone know how to do it, tell me and i'll contact you asap ! 😄 (I can send you vids, pics and more if needed !)
Instead of:
InputEvent -> add movement input
try:
Tick -> add movement input (MovementVector)
InputEvent -> set MovementVector
assuming there's nothing in floating pawn movement to stop it from just going, it should just keep going when you hop out
The Pawn still stop when I unpossess, but move again when I possess again without input : [
the pawn component keep its velocity vector but it does not uses, it's weird.
Nvm, it didn't work because I thought the AIcontroller would automatically repossess after player ._.
Looks like it does nothing without a controller
kinda dumb design IMO
I ran into the same issue. Ended up having to ditch the floaty pawn movement comp.
Duplicating its functionality is super simple, just make your own system IMO.
That's what I ended up doing. However, the movement components Epic provide handle root motion so without them you don't get any root motion. :/
That's just CharacterMovementComponent I'm pretty sure
It might be, I can't remember if it was handled in that class specifically or the base movement component one.
How would I make it so if the mesh flips over, the camera attached to it does not?
Imagine your tank flips upside down, I want the spring arm and the camera to stay situated on a top-down view
(I tried disabling the "inherit roll" on the spring arm, but it didn't work)
Make the spring arm use the control rotation instead.
this works but then it locks in a single place and can't move with the rest of the mesh
so if the mesh turns and twists on another axis, the camera just stays in place
Set the control rotation to match the actor rotation but only when it's not flipping.
would this be the relative rotation i'd set? or the world roation?
The control rotation.
what is the standard way of managing multiple systems that needs to be persistent between levels? Stuff like music players, or a class that manages visual effects that needs to be consistent between levels etc? I know game instance class is persistent but in a bigger project where you have multiple unrelated logic lumped into a single class would get messy i feel like. I came across subsystems but im not sure if there is a better way to organize this.
I looked for a "set control rotation" node in bps but none showed up D:
this is dragging off the spring arm btw
If it’s available in the checkboxes it’ll be a node in the blueprint. Try harder
Game instance subsystem but you need c++ to make them. Can't be done with BP.
The control rotation is on the controller.
I'm trying to optimize some assets and a lot of them are stacked into blueprints, so just a bunch of SMs in an actor. IIRC actors do cost a bit as opposed to meshes. Is there a way to optimize it other than breaking them apart and grouping them?
Optimize in what way? Context is needed to really be able to offer any potential direction.
Hey everyone, I'm looking for help to set up a Special Attack based off the amount of times the character gets hit. Are there any good tutorials that might talk about that? I can get it to count the attacks, fill the meter, but then even when I try to set the meter back to 0 it keeps continously firing the special attack.
Hey guys, anyone having issues with the widget interaction component in multiplayer when the client or server hovers a widget component button?? On a listen server the buttons do not react when hovered, but when standalone it's fine and shows the button being hovered. Is this intentional? How do i fix it 😭
The function shown in the screenshot is called if the pawn with the interaction component is locally controlled after it gets possessed
Any help appreciated!
Widgets aren't replicated, pretty sure this applies to widgets created by the widget component as they just create a widget and then display it on a plane.
Anyone knoww how can I do so my Sphere Trace has more vertices ?
Sphere trace is a perfect sphere as far as I'm aware as it's computed mathematically.
I'm trying to use sphere trace for sword hit detection, but the sphere trace is not accurate for the "hit impact" location
So how would i fix this, would i just set the component to replicate?
That's probally collision on the thing you're trying to hit.
It's a Capsule Component Collision. Can I have more vertices on this ?
Honestly not sure, but I don't believe that will work.
How can I make this better? (i wont cast player controller, and cache it.)
My player Controller has UI Manger component for all my huds etc. And I need to access Countdown Timer, but as you see, Its very against to Law of Demeter etc. What should i do to improve this?
Capsule collision is also mathematically generated to be a perfect capsule.
I mean, look at this video : These are Sphere Traces or Hitbox collisions ? They have several vertices on their collisions : https://www.youtube.com/watch?v=A3vCY-jU_tc
sphere collidion is a radius check, the "vertices" are purely for visualisation
it's maths, not a polygon check
Pretty sure that's just visual for debug purposes. (and custom)
Ah okay! I suppose what I could do is have a image cursor on the widget follow the player's screen center (there's no crosshair in my game so i wanted the player to know if they were hovering a button)
But I can't find if it's a trace or just a hitbox collision moving attached to the weapon..
I tried to do the "Hitbox" collision attached to my sword, but when animation is too fast, it does not hit my Enemy..
You'll have to show a picture to demontrate the issue.
You'll most likely need to have the client inform the server when it's hoovering. (it'll need to be handled in something that is controlled by the player such as character or controller) Then the server can inform the other clients they need to update their widget versions. There could be a better way though.
My only issue is that when I have low framerate or if my animation is too fast, the traces or the hitbox have not the time to detect the Hit.. so I wondered how FromSoftware did that.. and I found this video (above)
Something like this?
https://bsky.app/profile/mpattym.bsky.social/post/3lhvokbl4pc2l
So what I thought would be a quick project turned into something that took far longer. So here's what I've been working on.
In short, it's a 'frame stable' weapon trace system. I would have liked to have implemented a hybrid approach but 5 days later it's time to move on. 😅
#UE5 #GameDev #IndieDev
Exactly
Hey, im trying to get ai to detect the player's flashlight however this appears to be quite difficult. Is there somone who knows how to achieve this?
Especially doing it in a somewhat performant way
He wrote performs all the relevant traces at once, pulling from baked data about the animation. but I can't find a way to store any data and baking it (into a csv file maybe?) I don't know
That's me by the way. 😅 Yea, it's a pretty complex system to be honest.
Oh congrats you made a really good system !
But I wonder if studios do that with traces or just like Street Fighter with Hitboxes ?
Normally traces as far as I'm aware. You can't just use overlap collisions as fast moving object can pass through things not triggering the hit/overlap. Traces allows you to trace from a previous location (previous frame) to the current location (current frame).
You're right, and with traces you can get a "impact location" to spawn things like blood etc... that you can't with hitboxes
But I don't know why when my Sphere Trace hits, it's not accurate; that's why I was asking if there is a way to "subdivide" the Sphere Trace to have more "points/vertices" on it.
I always see this giant "Capsule" collision with several vertices on it when I try to visualize Dark Souls hitboxes
So I thought that my Sphere Trace has not enough "points" to detect the impact location correctly
How can I make sure its 00.30 for 30 seconds and not 0:30..
After on digit, its 0:9
But i want 00:09 ..
I heard two digit formatting but chat gpt didnt help so far
I did this in C++. It uses a custom data object that gets attached to the animation. It stores the relative locations for the hand at a given time step. When performing the trace it can then get the relevant hand position and applies some offsets based on the weapon and socket locations. You can then use these locations to get where the traces should be. (start and end)
Because it's baked data, you can get points across a time range. Not perfect though as if the character physically moves to quickly it becomes off. Adding to that, each skeletal mesh using the same skeleton will need its own baked data for the animation as changes in the bone lengths affects it.
Found out this way.
Greetings, I hope you are well and that all your projects are going as you expected 🙏 🤠
I need help with my project, please. I'm currently working on an interaction system, but I don't know how to create 5 different types of interactions with the Enhanced Input Action (Interact, Toggle, Hold, Hold & Release, Repeated Press)
I created an Enum_InteractionType with the 5 different types
Let's imagine that for a certain type of interaction action, certain conditions, or object states, I would like the types to vary, as well as the associated parameters. For example, sometimes an object with the interaction action "Unlock" can be a 2s Hold, and sometimes it can become a 5s Hold, or sometimes a 5x Repeated Press, etc
All this with the same interaction key
Do you have any idea how to do this, please? 😢
You don't need a tutorial here. Show your code
Oh I see thank you ! But the cons are if you have a lot of weapons and differents animations for each weapons + differents Skeletal Meshes, it will take you so much time to bake each animation for each weapon and each Skeletal Mesh
Why do you need input involved here? You can just have input fire InteractionStart and InteractionStop on ThingYou'reInteractingWith and it can handle it from there
Could probably automate it by baking in bulk no?
I made an anim modifier to do it for me. It only takes a minute to do but yea, the time can add up if you have a lot.
Oh so baking happens in runtime?
I need to find a way to do that.. lol
No editor time.
Maybe you could tell me more please (I only have 1 year of Unreal and Blueprint learning)
Just tell the thing you're interacting with that interaction started and that it stopped
it can handle it from there if it's meant to be a toggle or hold or single press or what
A better solution would be to get the data directly from the AnimSequence but the function I initially used was editor only (would be missing in a build) and I couldn't for the life navigate the mine field of replicating the behavior but at runtime.
It would be the perfect way
Pawn:
InputActionInteract -> Pressed -> ThingI'mAimedAt.InteractStart
InputActionInteract -> UnPressed -> ThingI'mAimedAt.InteractStop
ToggleBP:
InteractStart -> State = !State
HoldBP:
InteractStart -> play timeline
InteractStop -> Stop Timeline -> Check if enough time passed
SinglePressBP:
InteractStart -> DoThing()
Pre-baking it makes way more sense imo
isn't that what an animation is?
You're already doing so much work in animation, it's totally trivial to calculate a few locations
you just need to have some minimum timestep you consider to be the floor, and sample inbetweens if needed if the game fps is too low
I guess pre-baking traces is only doable with C++ right ? And maybe store the data for each animation into a CSV file ?
But why? You already have the animations. Just cook up a system to get all the inbetween frames when your framerate is too low to naturally hit them and you're golden
You can use editor utility bps to do it in bps
Well the data is already in the anim sequence so if you're able to access it directly, baking the same data doesn't make sense.
Ah yeah accessing the frame data already gives you the same info
Can you arbitrarily sample animations? I haven't dealt with animation much
I'm really sorry, I didn't understand 😟 🙏
Currently I have an AC_InteractionSystem (which manages the LineTraceByChannel) and which has the EnhancedInputAction, then which calls a BPI_Interact
I also have an AC_Interactable which must be either on a Character (because I want to be able to interact with other players), or a vehicle (pawn) or interactive objects (Actor). So I think I'll add the AC_Interactable in a Parent Actor (Master) and then create Children of the different interactive objects
like, "substep" your animation BP?
I wish but I have really no idea on how to do that..
My animations are "Montage"
why are you mixing component AND interface?
What defines if an object is able to be interacted with, having a component, or implementing an interface?
So I need to spawn a trace at each "substep" of the animation montage if I understood correctly the concept ?
pretty much
And can I access to this information into blueprint ?
The problem is when your framerate is so low that a smooth weapon arc becomes a triangle
No clue, probably not
Exactly
This is my problem
I want to use GameplayTags for the different interaction actions, and therefore store variables in the AC (I think)
I also use the LineTrace Primitive Component, because I want to interact with different components of certain objects (machine with several buttons, drawers in a cabinet, etc.), and therefore sometimes to open a drawer, it can be a "Hold" type interaction for 2 seconds, and if the player is injured, it becomes "Hold" for 5 seconds (an example)
I'd first investigate if arbitrary sampling or substepping of animation is possible, and how hard it is
I've not found any way of doing this at runtime other than using editor only functions. :/
ok so instead of an interface, just use dispatchers on the component
Trace -> was the thing I hit an InteractableComponent? -> yes -> call InteractableComponent.Interact on it
Hard...
If anyone knows how to do it, i'm all ears. 😅
Actor can implement stuff in response to that
A workaround comes to mind is to have a skeletal mesh hidden in the level that you can set animations with specific time values to, and iterate for each frame for the duration of the animation. You can iterate multiple substeps and access positions for each frame
Which is very stupid but would probably work
Still might go right out the window with any blending
It would
Yea, i think this is an issue my baked data system would have as well.
You'd still have that problem even if you had access to animation frames directly in runtime no?
You still have no blend data
I will try, thanks for your advice 👍
Probably... But if you can sample one anim, you can sample another and blend. 😅
Still wouldn't be perfect though.
Tbh bake method would just work out of the box with no issues, and is a legitimate solution instead of a hacky workaround
If I were to do it I'd just bake them
The problem is even if I could spawn a trace for each sub step of the animation, when my framerate will be too low, I still need baking the data before..
But it seems I can't bake these in blueprint
You can
You can do it in a editor utility blueprint
I bake my custom nav meshes in bps
Getting the data directly from the anim sequence would be the best option regardless. Just not an easy thing to do. Otherwise you'd be duplicating data.
I would love to know how to do that lol
Yeah, it would worth the hastle to implement that if you have many animations
Create a data asset and an editor utility bp
in a utility by you can access a lot of stuff you can't during runtime, like reading and writing data directly into game assets
You can read data from your animations and write them into data assets
During runtime you can just access the data asset and read the animation frame values already baked in
This is as far as I got. 😅 Note, something in this is editor only so doesn't work in a build. Just need to figure that bit out. 😛 Expose to BP and profit.
Thank you guys, I'll try that ! Hope it will work
So without baking the data I was struggling to have the necessary information to lerp.
Like in run time, how am I supposed to know which angle the swing was when the animation happened in 2 frames?
I already opt to use baking but I think for bp only user.
They can just define a trace shapes and add them manually as an array of struct.
Would be a manual labour but at least they can define a shape that is good enough to hit something.
Yes because I also tried to do a "Fill Gaps" thing which creates a new trace between each current trace
But even with that, at 10 fps for example, it does not hit
@dark drum is the FAnimPose the editor only data? Or the UAnimPose extensions?
I mean I can see my traces going through the collision, but I don't know why, it's not hitting..
Draw debug and show
I can't remember to be honest.
Probably UAnimPose though. I think the FAnimPose is runtime.
Look, you can clearly see that the "box traces" are intersecting with the Capsule Collision (green)
But it's not returning the Capsule Collision Hit component
Print string what you hit
I hit another collision on that Actor
I surely put a Multi Box Trace by Channel node
Make a new channel that just hit the component you want or opt for multi traxe
It hits the Capsule Collision randomly, sometimes it hits, sometimes not, and when it does not hit the Capsule, this is the screenshot above
Did you set to block or overlap? A block would have block the trace and stop the trace from getting any other component.
My Trace Response for the channel is set to Block
But with a Multi Box Trace it should be ok, isn't it ?
But if I set to overlap, the trace does not work at all
Multi shape trace or multi line trace can get multiple overlapped components
Well you want to check your settings.
Ok so even with Overlap for the Trace Response, works randomly
Oh wait, I will set all to overlap
You were right, it was the "block" thing, I did not know that the Block Reponse stops the trace.. thank you so much
Ok now I have the Sphere Trace with Current and Previous infos to "fill" the gaps
But I can't find a way to make the Trace going from Top to the Bottom of my Weapon
I already made two sockets into the Weapon mesh
This is my code
What is this bullshit?
You probably have multiple of them with the same name.
Click on the drop down and type bp elevator, see how many comes up
WHAT there ARE two. But I only ever made one?
Not to me! 🙂
Turns out a hallway mesh pack I imported also included an elevator BP for some reason.
Unreal Engine socket position changes in different animations and skeletons
Hello! I have a problem with the positioning of my Actor. When I move the Actor in my Scene the Mesh doesn´t move. Why is that?
its because your mesh component isn't childed to your root component somehow I think.
in your actor, in the list of components, drag your mesh onto your actors root component (the one at the top) and if it goes into like its drop down then it'll work maybe..
In what scenario would you use casting instead of blueprint interfaces?
I use it for prototyping mostly
Alright. I tend to avoid casting most of the time but I guess that makes sense too
its okay to do it, but don´t use it to much
how can I change that? Does anyone know?
You dont use interface to replace casting.
This is youtube 💩 misinformation.
Interface is never replacement for casting.
Read the article Unreal myth buster by ari from epic.
Any idea why I might not be able to find the "load stream level" node? All that comes up is "load level instance". Tried with and without context sensitive
Casting an already loaded object is absolutely fine you don't need to avoid it
Hard reference to bp asset to be specific
The casting it self does no harm.
Casting to blueprint asset however load the dependency.
So casting to native class is next to free.
One can only get soo far doing everything in bp.
The notion avoid casting is just simply harmful
Not really, you can still manage hard and soft references and follow good practices to keep dependencies in check with blueprints
But yeah casting is not inherently bad as long as you don't overuse it with no care
Casting to blueprint asset force the class to be loaded
That's the issue with blueprint cast
Soft reference is another topic imo.
Casting is almost free. It's the hard reference to a blueprint asset that force the class to be loaded even when they are not needed.
Infact interface call is tiny bit more heavy than a cast. Regardless for performance they are irrelevant.
The only thing that matter is what people are casting to. Native class 👌
Bp asset = create dependency and has to be loaded.
Sorry, another question : Even if I do a "collision overlap", will it skip certain frames of the animation if it's too fast or FPS are low ?
(I mean a Capsule Collision attached to the Sword for example)
And call "On Component Begin Overlap"
Hello! I'm using a physics door but I also want it to use a key, therefore it needs to enable/disable the physics constraint. Does anyone know a way to do it through blueprints? Thanks.
If your animation is moving too fast and your fps isn't high enough, your object might move a larger distance in a single frame than your overlap radius.
Resulting in stuff in the middle not get overlapped at all
If I recall correctly, components attached to actors will not sweep by default - therefore yes, overlap events could be entirely skipped if the delta between two frames is too large and the item to collide with is outside that collision on both frames.
You could look into the setting 'Use CCD' on any primitive component (Continuous Collision Detection)
There's also the possibility to sweep trace between last & current positions to verify if any collision was missed.
I don't think you can toggle a constraint. You would have to create it / destroy it at runtime (careful with perf :D)
I tried the "CCD" thing it's not working
So if I have to "sweep trace" between last & current positions, it's better to use sphere trace, isn't it ?
You can't toggle it but you can set the axis limits to locked temporarily
Yes
If you need multiple overlaps use multi sphere trace
What I actually have is a Sphere Trace in the Tip of the Sword, and my Start Trace is my Previous Position, and my End Trace is my Current Position
Ok, do you know the node? There's many here
But what I want is to make a Sphere Trace between my Sword Base and Tip + calculate Actual and Previous Position
You have to do it for each axis, not sure if there is a way to set all axises to locked at once
These are the nodes you need
Atm my solution is to create more sockets on the weapon and create a For Each Loop for each socket and trace from that.. but I wonder how they did it here : https://www.youtube.com/watch?v=A3vCY-jU_tc
The Capsule Collision looks very clean in the video
Could be just pre defining the collision with time stamp
Like you told me earlier ? Baking data ?
The animation you see is probably purely visual
The actual thing that drives the collision trace is probably the raw animation data either pre-baked or read from memory
Think about run time, if you don't have the necessary info (from the raw anim or w.e)
You need multiple traces in a single frame, not possible if you rely on your visual animation
In 2 frames and you are doing 180 degree
How do you suppose to know the angle the sword is going ?
So you can't even lerp it
It's impossible. I have to predict the movement of the animation
Unless you have the info to fill the blanks
Or you can just define the angle manually.
But for complex animations manually it will be tough
Preferably automated by baking sockets and montage but with brute bp only then perhaps you have to type the data manually
Why? Most swings probably go to one direction.
Not like ufc combat where people fake punches
You gotta work with your limitations or just learn what you have to learn.
Ok so even if I know the angle, let's say, my attack is from left to right. I need to spawn a Sphere Trace on the First frame of the animation montage of the attack
And then ?
Maybe I have to create a Spline for each animation ?
And set X number of points in that spline
You have to work with delta time and not with individual frames.
Same problem with splines, if you move too fast there will be jumps in your trace
You need multiple overlap traces in a single frame if you have low fps
Lower the fps, the more traces to compute in a single frame basically
That will make it framerate independent
With the Spline I mean, not in runtime, I create manually the Spline before for the animation, and in runtime, I use a Timeline to spawn Sphere Traces at each point of the spline
When my Player triggers the attack
When you say delta time, you mean the "World Delta Seconds" node ?
Would almost work.
Instead of each point, you can make it spline time based (0 at beginning of the spline and 1 at the end)
You can then say I will fire a trace for each 0.05 unit increment
Example:
So if your swing takes 1 second and you have 10fps:
1/10 = 0.1 is your delta time
0.1/0.05 = 2
You need to compute 2 traces each frame
So I need to multiply this World Delta Seconds by something in the timeline, right ?
I need to divide it with the "0.05" unit
I mean
Example:
Attack swing takes 0.5 seconds.
You want to fire in total of 20 traces (Resolution of the traces)
You have 60fps
If you have 60fps your delta time is 1 / 60 = ~0.016
Your increment step for traces is 1 / Resoloution * SwingDuration (1 / 20 * 0.5 = 0.025)
AccumulationTime = 0.0
TraceTime = 0.0
Each tick, increment the AccumulationTime by your delta time.
Each tick you check if your AccumulationTime is greater or equal than 0.025, if it is:
- Fire a trace corresponding to the spline position at TraceTime
- Increment TraceTime by 1/Resolution = 0.05
- Decrement AccumulationTime by 0.025
- Repeat until AccumulationTime is less than 0.025 or TraceTime >= 1
That's if you use the spline method
When TraceTime >= 1 then the swing is completed basically
This would ensure you fire in total of 20 traces in the span of 0.5 seconds regardless of your framerate
Ok thank you so much for this method, I guess I will try this it seems lik a solid method, right ?
But now I'm thinking about one thing... why can't I make this same calcul for a simple Sphere Trace with a "Set Timer by event" and on the "looping time" I set the calcul you did ?
Hmm because the timers are frame-dependent, no ?
Using a timer is cleaner but might be less precise. This guarantees frame drops will not skip any traces while timers have no time accumulation mechanism so they might skip a little
Yes I just tried that with the Timer and even with the calcul it seems frame-dependent.
My animation is so fast that it does not spawn traces
With the spline method, do I need a Timeline ?
No just a tick
Ok so basically it's that ?
I just need to change the "Start Trace" and "End Trace" locations ?
But is this method will work when my Animation is moving too fast ?
Yes you need to get the Trace Start and End locations by getting the position at time of the spline
Yes it's not framerate dependent
What is the Trace Range variable please ?
Yeah
So I need to create the Spline at the base of the Sword, and not the Tip ?
Hi there, I have a trouble with the node "get class default". On the tutorial i'm looking, the guy have pins but in my case nothing appears. What do i have to do to make them appear? 😅
To sum up, it's a datatable with solf class reference in the Item. And those items are in a blueprint. Also in a datatable (different one, with name, quantity etc).
You can create it at the tip if you want, would only need to multiply the range with -1
You need this instead
So... I've got two characters that can issue commands back and forth, they both share the exact same blueprint structure.
But for some reason when i go to control my second character and open up the commands widget, when i press 1 to select all units - that all works dandy and the next screen all opens correctly.. but for some reason my first player triggers their Advance movement... which isn't even called here. Literally no print strings trigger to indicate that the second player sent an advance command other than the original blueprint letting me know it was told to advance.
What in the shit is goin' on?
Ok thank you. I don't know why, it's not following the spline curve correctly
My spline has 4 points to make the curve
it seems to be the same problem :/ Maybe i need to check somewhere something to make them appear?
You might need to cast it to your class
what's the issue?
My traces are going straight. I take a screenshot right now
My spline is blue
To be honest, i don't know what you are talking about 😅 😅 Sorry 🙈 I'm a very very beginner in blueprint
This is probably not the solution but I just noticed this
Can you screenshot your trace start & end?
Start and End like your screenshot
Start is above and End is the output of the "+" node
Like this
Ah of course wait
You need to repeat the check until it's false
use a while loop instead of a branch
And I remove the Start of Sphere Trace?
No the rest can stay the same
Because you put a cross on it
just change the branch to a while loop
I sketched on top of my previous screenshot lol
Oh ok lol thank you
Is it possible that my soft class reference i'm using for my item doesn't have pin? Do you know how can i make them? 😅 I have tried with another table and it shows pin
I am not sure if i need the AAsimpleclass item or the datacomponent 😅 (Another tutorial i didn't understood while making 🤯 )
because technicalli, the structure i'm using, uses the AAsimple item to search for the blueprint i need
But at least now it shows something ! Thanks already ! haha
I got infinite loop
if you switched it to while loop don't connect it back at the end
that was for the branch, not needed with the while loop
Is all correct ?
Resolution = 20 ; Attack Duration = 0.5
Yeah looks like it
Well I don't understand the infinite loop
hm, I think it might be the 1/Resolution
I wonder if it's returning 0
make the resolution a float instead of an int
Ok thank you now I don't have infinite loop
But I have 2 issues
- The traces not going into the end of the spline
They stop at the middle
- And the rotation is not good
they stop at the middle?
Yes like that
And I thought that the Sphere Trace will be from the Spline Location to Forward, but here it's following the rotation of the Spline
You can remove the get direction at time node and put in your own direction vector to achieve that (Or use Right Vector at Time, if that isn't correct use Up Vector at Time)
Now why does it stop in the middle is strange
can you print the trace time?
Yes here it is
LogBlueprintUserMessages: 0.05
LogBlueprintUserMessages: 0.1
LogBlueprintUserMessages: 0.15
LogBlueprintUserMessages: 0.2
LogBlueprintUserMessages: 0.25
LogBlueprintUserMessages: 0.3
LogBlueprintUserMessages: 0.35
Maybe I have to increase the amount of the Attack Duration ?
Why does it stop there prematurely, is it not on tick?
But no matter the Duration, it should complete the Spline
It's stopping because when my Animation is done, I stop the "Tick" with a boolean
We entered the duration as 0.5 seconds, if your animation is shorter than that it will cut it in the middle
You can set the duration to your animation's duration
Ideally you wouldn't tie this to your animation
Stop it when TraceTime is greater or equal to 1
So in the Completed of while loop ?
Or I add a branch at the end ?
No you can set your bool at the end of the loop body of the while loop
Yeah you can add a branch at the end of it and turn the tick off if TraceTime is larger or equal to 1
So at the end I add a Branch if TraceTime greater or equal to 1 ?
yeah
Ok I try this right now, thank you
But think that I am using an "Anim Notify State" with a Receive Begin/End Notify
So I need to calculte the Duration of this "Anim Notify State" right ?
To set the Duration variable correctly
yeah
You know (maybe) if I can get this information through BP ? (I know I'm asking you too much, you already helped so much.. thank you very much)
You can create an anim notify bp and do this inside the notify itself
AnimNotify simple ? Not "Anim Notify State"?
not sure I dont remember the exact naming
Because with this method I need to have the Duration of the AnimNotifyState before
You can set the duration in the montage notify itself, and the notify would call the event to start the sweep while passing the duration as a variable
does it work now?
It's all good for the moment
Thank you so much very very much
I just need to find a way to create my Animations Splines
And maybe to store them into a Struct or something
We came full circle to baking lol
But yeah you can store the spline points in structs
You can then override the spline with the new data during runtime
And the sweep would occur like normal
Exactly lol but you did all of the job to make the "baking" easy on blueprint, thanks a lot !
But I have to store the spline points upstream, right ?
So I need an Actor to play each animation and create a spline and store the points
In the Data Asset I store the Data of every animations ?
Create a Primary Data Asset for storing spline data
Then create Data Assets of that type for each spline you need
But which class of Data Asset can Store that ? It will store the Spline entirely or the Locations of Spline points ?
You can store any variable inside Data Assets
So first a Primary Asset Label
You can think of them as being somewhere in between of a struct and a class
You can store them as assets like classes, but you use them for variables like structs
The easiest will be to create the Spline with an Actor which will play each animation of the game, and then Store the entire splines into an Asset
You can automate that task with an editor utility blueprint so you don't have to do it by hand every time
I will search how to do that, thanks !
And you probably don't need to play the animations, you only need the spline data and that's not tied to the animations directly
You mean I don't need to play the animations to store the Spline ?
I need to play each animation to have an accurate Spline
And while each animation is playing, I need to create a Spline at the base of the Sword (blade)
oh so you want to generate the splines automatically
yeah you can do it like that then
you'd only need to do it once
Yes, if I create the splines manually for each animation, it will take too much time. I have many animations per Weapon
Once you store the spline to a data asset the game can just load that
Well now you have the option to generate it or create custom ones by hand, yay!
Exactly, thanks ! I just need to find how to use an Editor Utility Blueprint for that !
With the Data Asset thing etc.. it's new for me so I have to learn how to use that
They're very useful once you learn them
I hope it will be not very complicated to make what I want lol
Is there a way to allow **abstract **class references in a class variable here?
For example, I may want to test if something is in a base class of "Weapon," but I can't do that from a variable since it won't allow the class "Weapon," which is abstract.
An abstract class can be set directly using ClassIsChildOf, but it doesn't allow arbitrary classes for different situations, which I'd need.
For now, I've just made the base classes concrete, but wondering if there was a better solution.
The whole point of an abstract class is to not instantiate it.
They can't be used as is and must be derived.
If you want to spawn it then don't make the class abstract
I need to generate overlap events so my bullets can impact the meshes, I've changed all the meshes to do so, with physical materials, but inside my level instance they are not updated.. is there something I have to do for the level instance to show the changes?
But I don't want to instantiate the class. I want to use it to test if another class is a child of the actor class variable. Example in the image.
Without a variable, an abstract class can be selected directly using ParentClass. But then you can't make the base/parent class arbitrary for different situations.
Hi, I've got another problem though.
I click Actor [0], change the mesh. Reload the level and change the mesh again, it works fine.
But after that, I click Actor [1], change the mesh. Reload level. The actor [0] also got changed the mesh to its original.
After I reload the level, I change to Actor [1] , I also want to keep the mesh on Actor [0] not to reset it.
How to overcome this? What's the best way to approach this?
Ask in #cpp if there's a test you can do.
If there is you can just make a function library that takes the class as the input
Assuming you are testing against native class anyway since I don't think you can mark class as abstract in bp afaik.
You can make a class abstract in BP, but it doesn't really have a big impact besides preventing you from accidentally dragging it into the scene, so i can personally live with it being concrete.
Can I call an asset picker or something in the blue print? The goal is to launch an asset selection window when the blue print is executed
Cool, didn't know that.
Editor utility widget?
yes
You kinda can
But i don't have editor on me
Iirc it's about exposing the variable
I've searched things, but I don't know yet except for single propertyview
I made it like this
I can't update a DataTable at runtime, right ?
So if I want to store a Vector Array permanently, how can I do that ?
Yup so what's the issue?
You can just get the underlying mesh / value
I want to manage the sequence with an asset picker
SaveGames
I ended up by creating "Data Assets" to store my Data instead of Data Table as I can't update it at runtime
Thank you !
That's not the solution
DataAssets are also supposed to be read only.
They are Assets. You wouldn't modify a Texture Asset either.
It's not for saving Data when I'm in game. It's only for saving some vectors upstream
Sure but they are still meant to be read only
But I can modify a variable into it
If you are 100% sure that this is fine to modify an asset for, which means that's what its default value from there on is and you gotta make sure you save it etc. then sure
You could fully destruct a Texture too if a programmer would expose the functions to Blueprints.
You can even doctor around on the blueprint asset that makes up your actors and what not. Should you? Only if you know what you are doing
If it's not during runtime then you can use your data assets fwiw.
Just be aware that you literally modify the asset and there is no "default" you can be back to automatically
Ok I will be careful, thanks !
Hi, When I print this out in player controller blueprint and running a server-client network, client will print out the server character, how can I get the correct pawn that my client is controlling?
You dont want to bind input on characters that are not yours to begin with.
Use is locally controlled when binding the input.
I guess is to check during possession?
Hello, running animation is shaking on client. how can i fix that?
Sure but on possess only called on server, so you can't use that.
Client calls a function called acknowledge possession but that's not blueprint exposed
I tried to use IsLocalPlayerController in my SetupInputComponent, but is still the same problem, could it be that Im using the same player controller when Im testing in editor?
I think you have a misconception.
Every players running their own instance.
The world is not shared per say. We are not running the same instance.
You run your game.exe, and I run my game.exe
Each running their own codes.
Multiplayer is about communicating between machines so the respective world is seemingly in sync.
And where did you set it?
In my player controller cpp overriden function
Also to reiterate, client only know their own controller and no one else.
What function?
SetupInputComponent()
If you can use cpp then do the binding on AcknowledgePossession
You still haven't say where that gets committed.
You can move them on acknowldge possession for client and OnPosses for server.
And don't forget the is locally controlled check.
If you are doing them on begin play then you are doing it wrong.
It would have been called way before the player even possess the pawn.
This is a PlayerController function that I override
That's still have to be called somewhere
Check where it's being called
Do a break point and watch the call stack
By default I think they get called on begin play if you use template
Which would only work for single player.
Alright let me check, thanks a lot
Anyone knows if I can play a Montage without running the game ?
I mean I have a Character in my Level, I want it to Play a Montage without pressing button "Play" in the Editor
Yeah but not in blueprint. That's pretty much what I do to bake the sockets data.
Hmm that's bad, I'm only in Blueprint :/
Always good to level up early
Because what I can do is to Play Montage into the Construction Script
You gonna hit the wall sooner or later anyway.
I can't find any videos or documentation that explains how to implement this even in C++
Maybe I'm not searching with the right terms
Yeah you don't. You kinda just have to learn programming then translate what you need into codes.
But with cpp you get accessed to most of the engine
Things like the anim data etc.
Making a custom button for the editor where I can just click to start slicing the ans and replaying montage at a click of a button.
Ngl wasn't easy for me.
doesn't seem like it is called on beginplay
That's not setupInputComponent though
Add a breakpoint
Ok I will learn C++. Thank you very much !
So your input is set in the controller level and not the character?
Yess, inside SetUpInputComponent
I binded mine on the character.
As for the controller. Client only have their own local controller.
So explained the issue again?
Are you sure that when a client press something it prints on the copy of the character that is the host server?
Is locally controlled check should be enough here
Provided the input is in an actor that the client own. E.g the character or controller
I think the locally controlled check is done in the super class, I think I need to check the printing again
Is there a way to get ai to detect the players flashlight?
you could set up the flashlight to be an actor that the AI can detect the same way it would detect a player
With the was recently rendered node you mean?
As in where the light would hit?
Yes exactly
Players should be able to hide, and if they turn on the flashlight AI should be able to see the light wherever it hits and investigate
you could do a ray trace to where the light is hitting, spawn an actor at that position and if the AI see's that actor it moves to that location
Not easily no. All that stuff is calculated on the GPU of which it's just stacking coloured pixels.
I tried this approach but that comes with loads of edge cases which would be hard to fix without hacking my way through it
i cheated a little when i tried to do a similar thing. i just added a capsule collider to my flash light that if it hit the monster they knew where the player was. not the greatest approach but fake it until you make it really
This was my initial approach as well, but there's quite a few issues with this if your environment contains loads of small corridors and rooms
So this?
yeah without doing some major calculations to check each point of where the light is hitting and if that can make a path to the AI i'm not sure what could be done
Exactly
I thought of adding an array of scenecomponents manually to the cone of the flashlight in different spots, and line tracing from the player to each point, and from the ai to each point in intervals. Then if both line traces are unobstructed this means the ai sees the light
But I wondered if there was a more modular approach
This is where a cone trace would be handy but... When the torch light is on, trace into the world and if it hits something, add a tag to it. (IsIlluminated) And then the AI can trace in front of itself and if it hits something with the tag IsIlluminated, it then does another trace from the hit location to the player character. If it hits the player (nothing blocking) you can assume it's looking at an area lit up by the torch.
Is a conetrace something that I can find in Unreal by default or do I have to get the plugin for that?
You'd have to find a plugin. There are ways to get similiar behaviour though, just require more math.
Alright that's definitely a good approach I feel like. I'll see if I can get that to work thanks for the help!
Another approach is similiar to what Rory was saying and thats to use some sort of actor. You can do scatter traces and if it hits something it places an actor. (Or move ones already created). Anything hit could have multiple of these actors placed on its surface with a density amount to control how many it can ever spawn. These would just have a small sphere collision in them. The Ai can then trace for these instead.
For this method though you'd need variable actor amounts based on distance as the further away a hit is the more surface area there is. Again more math. 😅
Hahah yeah I figured this was going to require some math 😂
The tagging method could be better if you wanted them to be aware of any light source. Especially if you look at creating a custom user asset data object that you can add to just about anything. You could then store more information such as whats shinning on it and its approximate distance, event if it recently started receiving light.
Custom User Asset Data object require C++ though as you can't create children of the base class in BP. :/
hey, is there any way to make unreal only spawn 1 shared player camera manager for all player controllers in local multiplayer instead of one per player controller?
I have a problem where: after picking up a key, the game detects the door that is assigned to. Then, opens the door. But the key (and the door within it) is in an array and I don't know how to access it. How can I solve this? Thanks.
Pull from the array and call 'Contains' on the array, there's a different one arrays and maps.
On a side note: that interface call event is pointless.
Hello! I'm looking to have many moving objects (dynamic transforms) in the background of a map. I'm currently using timelines on each instance of each object but this isn't very performant. What is the most efficient way to accomplish this?
Mass, niagara, motion design
Thanks! I'm familiar with the latter two but I haven't heard much about the first one, got a starting link I can look into further?
Thank you
I did with ugly casts but it's only on click, so there's barely an impact on performance. Thanks @dark drum
Why not just have the door remove the key as part of the interact event? Normally with interact events, you want to pass a ref of the thing doing the interacting. This can be useful for many reasons but it also allows you to handle other things interacting with something that isn't the player. (such as NPCs)
Hey folks
I'm confused at the moment about why my pawn won't move.
It works if I start up the level directly. Then I can click somewhere and the pawn moves (TopDownCharacter Template with some modifications).
But if I start from the menu, load the level, and spawn the actor at the right location with the shown node, it will not move. Even though the function does fire (second screenshot)
I've set the default Pawn to "None" in project settings by the way. To avoid spawning it in the menu map.
It doesn't have a controller assigned after its spawned.
Should this setting not do the trick? Or how should I do it?
I believe that only works for pre placed pawns. When you spawn it, just posses it with the player controller.
As the player can only possess one thing at a time, it won't automatically posses a new pawn just because it's been spawned.
@young meteor Look in the pawn's Defaults around the associated AI controller. It has a setting to auto possess when placed in level or spawned.
Alternatively, change your SpawnActor to SpawnAI
Maybe. What are it's settings?
(just set it to Disabled now. It was not before)
You'll want it set to placed in level or spawned so that it'll make an ai controller for both.
What is the rest of the code on that move line?
I don't have a "Player Start" in my level if that makes any difference.
It's from the template TopDownCharacter
Can you breakpoint this? Is it being called?
It is. With a location too.
Also creates the "arrow" animation from the template BP where I click
You need to posses the pawn with your player controller after you've spawned it.
How?
Pull from the return value on the spawn actor of class node and call the posses function and pass in the desired controller.
Doesn't SimpleMoveTo work with the ai controller as well though?
This is the only option that pops up.
(done in Level BP)
Yea but he's calling this from the player controller.
You want me to call the SpawnActor node from the player controller BP instead?
Then I do get the option I think you refer to
Oh... The posses is on the controller and you pass the pawn class. 😅 My bad lol.
Unclear to me what you mean
Connect the player controller to the target of the possess node.
Tried calling this SpawnActor from the controller BP. Did not seem to make a difference.
Like this?
Hello fellas!
Can anyone tell me how i can keep an actor with a sphere? Assume the sphere is some kind of arena. I would liek the player to stay within the sphere but prevent him from going outside of it. How do I do this?
Using simple a Sphere-Mesh pushes the player instantly upwards on the surface of the sphere.
Tried calling "Get Controller" on tick from within the Character/Pawn in question.
Not sure if this proves to you guys it is in fact possessed by Controller0 or if it would output this anyway.
Hmmm, I'm not sure then. If it has a controller and there's a nav mesh, it should work. 🤔 Press the ' key and see what the nav mesh looks like. Also check to make sure the location its trying to move to is on the nav mesh as well.
It outputs the same controller if I start the Level directly. And then it works
It is only when I start the menu level, then load the sublevel in question from there, spawns the Actor (BP_TopDownCharacter) the same way, that it does not work for some reason
Hi ! Anyone knows if there is a simple equilvalent to the MOUSE X Y AXIS input ?
I'm trying to force a player to teleport to a specific spot when starting a dialogue. I have a vector variable on the actor where players are supposed to stand. You can move it around in the viewport on a level.
I need the global coordinates for where that is for the player but just adding or subtracting the vector from the actor's location doesn't take into account it's rotation. How do I achieve this?
Hey guys. I have a weapon, that i attach to ik_hand_gun bone on a character. Weapon mesh contains sight socket, that i use to make some ADS system.
I find offset between this sight socket and head bone socket, and modify ik_hand_gun bone by this offset, to place the bone in a way, where sight socket aligns with a head socket. And it works. However, the rotation is not correct, and when i try to adjust rotation by finding delta between sight socket and a camera, the bone or just ignore it, or starts wiggling, continously recalculate rotation, since changing rotation by one axis changed action by some other axis.
I tried to rotate a bone with Transform(Modify)Bone node in bone space, and it works well only if i do it manually. Please, help me fix this, since i already spend 2 days to do this
A little help finding a bug would by appreciated:
Simple door setup - I have an "Add Actor Local Offset" node run by a timeline, triggered in both directions. The timeline animates only the Delta Location Z by multiplying timeline output with a float variable (additionally multiply with -1 for reverse).
Now, when I run the script i have two issues:
- The float defined for my location offset multiplier does in no way represent the editor measurement.
- Running the script reverse does not restore the original location but running short. (i.e. Starting at z=0, timeline adding z=+20 and then reverse timeline doing only z=-18). Any ideas?
You want to 'Tranfrom' the vector by the actors transform.
how do i stop the rotation of the player/player start from effecting my movement? if any of my player starts, it affects where you have to push the left thumbstick for each player to move forward. I currently have the player starts all pointing in set directions, think all players on each corner of a square facing the middle point.
To describe the issue more, if i rotate player 1's player start by 45 degrees, it essentially rotates the thumbstick, meaning ive got to push it to the left/top left to get the player to move up
do deprecated variables get removed when cooked?
rotate the input vector by the control rotation
Hello
Does anyone know how to run a function on an item that's in the player's inventory?
Because when you run get actor or get all actor, it doesn't recognize that it's inside.
how are you keeping track of the inventory items?
got a silly one for you. Trying to figure out how to use common UI Carousel stuff and i want to make it so the nav bar buttons have words on them for what they navigate to, but i can't seem to find a way to be able to set that dynamically. Any ideas?
me?
ya
I have an inventory system for this YouTube channel.
I suppose because of the slots, which would be where the inventory items are.
https://www.youtube.com/watch?v=G9WrUFYANdc
Data driven inventory system fully replicated.
Thank you for watching! Please subscribe for more!
BP_Weapon tutorial:
https://youtu.be/gP6Scb_5y8I
BP_Weapon tutorial fix:
https://youtu.be/ZHC5dhp_gZ8
Marketplace Products:
https://www.unrealengine.com/marketplace/en-US/profile/NativeCoder
Discord Channel:
https://discord.gg/RVSMfv9BCG
Tags:...
so it looks like it stores the items in map
these arn't really actors at this point in time as they are not populated in the world as much as a reference to them that you will need to pull and populate the boxes and such with.
either way, what you would do is grab the item in the map (based on the key value you are looking for) and then run the function on that
I try, but since it is in an unselected slot, it does not recognize that it exists, even though it is in the inventory
how are you grabing the map item that you are trying to get the ref to
with an independent pick-up
And I have a master object that has children that would be the elements
can you send me a screen shot of the function you are useing to grab the item you are attempting to access
I managed to solve it for now, thanks anyway.
glad you were able to solve it
thx
im looking to make something like the super mario 64 slide, i tried using the "not walkable" setting on the third person character and it is similar but does not allow for much freedom of movement
Worked perfectly! That's exactly what I needed thank you so much
Hey guys,
I'm working on an Unreal Engine game where when the player dies, a corpse is spawned, and that corpse gets added to an array. I want to limit the total number of corpses to 5—if more than 5 are in the array, the oldest one should be destroyed and removed.
The problem:
Even though everything looks connected in my Blueprint, the logic to remove the oldest corpse isn’t working. The extra corpses aren’t getting deleted when the array goes over 5.
Any ideas on why this might be happening or how to fix it?
Thanks!
I've send the main blueprint here if you need furthermore explanation or anythign else let me know
🫂
that array is on the same actor that you destroy in the first Sequence step
you would have to store it somewhere else
you could also handle it all in the corpse actor class, add a timestamp float variable which is set to the gametime when the corpse is spawned, then GetAllActorsOfClass(corpseClass), sort by age, destroy the oldest one (if there's more than 5)
that might also work, but you'll end up with a bunch of BS if they go back to the main menu and start a new game
afaik the gamemode is persistent?
i wouldn't do it in the gamemode, even if it might be an easy solution, i feel like it's the wrong approach
yeah, i believe that in some moment it also gets deleted or touched in some way, ill try the timestamp metod
sounded fun to mess around too
someone here might have an better idea, since BP doesn't have any good sorting functions iirc
so it's either a pita with a loop, or a third party plugin
Hi question. in my game my player can get like 20 "Abilities" if u will, is it bad practice to have each of them as a Actor component and adding that to the "player" when u learn it ?
having so many components must be bad ? rather then to keep all info for all abilities in 1 component
right ?
you are aware that there's a GameplayAbilitySystem in unreal?
with 20 components...
Generally, don't use the same object for multiple different concepts.
not having it handle by one component is a fricking mess if you ask me
put the logic in normal objects and keep them on the component
hi does anyone know how i can get my first person arms to move with the camera shake, right now there attached to the camera and i tried attaching it to the camera managers transform component but that wasn't working, anyone know?
I can't seem to find the precise answer to my question 😢 😄
When we want to work with actors in our project that have multiple interactive elements (I'm thinking of a car with doors, seats, and buttons, or a machine with buttons, a cabinet with drawers, etc.), what type of Blueprint should we work with?
Because Epic says we should avoid using Child Actors as much as possible (especially for my multiplayer project, which requires good replication), and the problem is that if I use Components, it's difficult to assign logic or Gameplay Tags to Components (unless I'm doing it wrong). Afterwards, I also thought about creating a "StaticMeshComponent" Blueprint directly...
But it's been around for years, so there must be a professional and optimized way to do this easily, right? 👀
Instead of using an actual ChildActor, you can Spawn Actor From Class (which spawns a regular actor), and use AttachActorToActor node.
I guess technically it still qualifies as a Child Actor, but the thing everyone is telling you to avoid is the AddChildActorComponent.
Is it possible outside of PIE in the editor with A BP function's CallInEditor to set a variable on the actor instance, then use the Apply Instance Changes to Blueprint feature in the details panel to commit it to the BP class defaults?
I've been trying with no success
Shouldn't the Editor tool allow you to load the CDO and modify that, in theory?
If it's not possible in BPs, then potentially via C++.
which editor tool do you have in mind?
The odd thing to me is that even in simulate, when i press my button to set a var in the actor, it doesn't seem to update the var values (tested by making the var instance editable so i can see its values in the details)
Hoping to exhaust BP first then i'll choose between python or cpp depending on whichever is less lift if BP is impossible
Generally the Editor Tooling Epic added. I haven't done a lot with it, but there should be the Editor Utility Widgets that should have access to a few more Editor Level functions and properties.
Eh, I tried to do some stuff with python in the Editor before. The Docs and resources are not that helpful when it gets complicated.
C++ got me where I wanted to be quicker last time.
But maybe you are better with python than me.
ya im useless w python anyways hehe
i'm surprised tho what i'm doing isn't working. Pressing the function button on the instance does print the correct values w print string
so i'd think it is setting the var, but not sure why it's not updating it at all
in a nutshell the goal is to use CallInEditor on an actor to at least change the var's value on the instance. then I'll commit to the CDO (sorry repeating just to rephrase) : )
ty for the help btw. Turns out my way does work
I was just doing something dumb
Perfect, thank you! Save my life 🤩 🙏
How did you get this information, please? Since I'm trying to find the official information, did you read this in the documentation, or was it Epic developers who told you this, or was it your own testing?
I'm asking this because in the future, I can always find the answers myself to avoid bothering you with potentially stupid questions 😊
Is there a way to open and look at a level blueprint without that level open?
Like I'm pretty sure the answer is no, but I figure I'll ask just in case
isn't there an option if you rightclick the level file? nvm
Thank you so much for your help 🙂
I'm trying to do some tests. I'll create a function in my Parent Actor, then I'll call this function from the Construction Script. This way, I'll normally have the child actor attached to the parent actor from the start. I just need to figure out how to configure this, but I'll figure it out, haha (I've been learning development for a year). Thanks again 🙏 🤠
Anyone know if theres a way to debug collisions
my projectile settings is that
the Mesh of the AI is that
and it doesn have a physics asset as it's the Mannuquin
when I'm firing my weapon though it seems to go through the Enemy rather then it hitting them
The mesh of the AI Pawn needs to be blocked?
Hello, I currently have this setup to slowly increase the wind strength of a global foliage actor but each time the foliage is updated, it does a kind of flicker motion like it's resetting. Is there a way to fix this?
Does anyone know a way to reduce float to decimal/ two point precision? I want my 0.56998 float to be stored/processed as 0.57.
Multiply by 100, round, divide by 100.
That's the way, eh? 😄
Thank you 😉
Anyone know how to solve the issue of when character is moving forward the projectiles stopping mid-air and not going forward in the forward direction
Sounds like it collide with the player that is shooting.
Don't overlap with the shooter
You can just print w.e component you hit and address it from there.
Is the projectile too slow? Then you may want to account for the shooter velocity on top of the projectile velocity.
so it turns out it was two things, one was I had the Enemy Pawn mesh set wrong and also wasn't doing the same stuff I do when a projectile hits the player
Is there a reason i have to delay my GameplayCamera by one frame for it to run correctly 
This threw me into a loop for 3 hours, rewatched tutorials multiple times to be like "this should be relatively straightforward what did i miss", no avail, downloaded the sample project and compared, still confused until i realised the pin to tick the camera in the Camera Director was not running at all.
I noticed this happens with SetViewTargetWithBlend as well when i use the normal camera system, i have to delay until the next tick, otherwise it doesn't possess correctly and i don't know why, the example material doesn't do that.
Hey all. Does anyone know if its possible to pause/play a sequence from within its own sequence blueprint?
sup everyone , im curious about runtime data storing, ive been using Data tables of structs for various things , vehicles ,information for each level, stuff like that, but you cant set data tables at runtime in blueprint?
So I almost feel in alot of cases I should just keep an array of structs on my game Instance for things id like to change at runtime. I feel like this would also be better for mod support in the future too. curious of folks thoughts on the matter.
Data Assets allow modifications during runtime, if your looking at mod support stuff, you might be more interested reading from an external json.
I havent messed with Data assets yet, ill have to give them a look see then, from what im reading they seem a bit trickier to set up but are better overall then DT's
For list view... how do I actually get the list in a form of an array? Or, how do I know what current button is being highlighted?
I want to change the color when the button is highlighted / selected and unselected with keyboard/ gamepad
They're not too bad, you can do them with Blueprints but i recommend setting them up in C++!
Data Assets are really easy to setup. literally nothing complicated, you might want do them in C++ if you want to be able to reference them in the c++ code ever, but same goes for everything. Also structs are a must to do in c++ because how broken they get in the blueprints.
Structs are broken in what way and since when? I currently use Structs in BP for alot of things and I havent ran into anything strange as of yet. UE5.2
if you modify struct and dont follow some stupid kind of ''rules'' to change, not save, reset engine, compile, you are risking that struct will corrupt your blueprints, won't be able to open them anymore or just forever think there is still that variable you just deleted, and last one is that your values you put will get reseted everytime when you open project
Is there some trick to getting the asset manager to see a map that I'm requesting?
In the project settings, I have the asset manager set to look in the maps folder. But when I try to use the asset manager to find a map, it comes back null.
I'm trying to find a way to set any variable within a struct without having to manually set a line for each variable. I'm making an editor utility widget if that changes anything.
in simple terms
adding is usaually the safest, but renaming is broken
Why cant i refrence it to self?
self here is a Actor
the function wants a Pawn
Is it possible to see what a virtual bone target is set to?
Set Members
Is it possible to create temp variable like this in blueprint? Is this a local variable?
float someVar = 0.25f;
if (player) {
someVar = player->GetHealth();
}
Looks like it if I'm reading your example correctly.
cool, im still green on blueprints. Thanks.
is it possible to change the rotation of a bone of a skeletal mesh in blueprint?
Maybe I wasn't clear enough, I'll try to be more specific. I'm trying to make a function where I can input a variable and that variable will be set in the struct without changing the other variables.
I know that set members exists, I'm just trying to find a way to set any variable without having to set up a new set members node for each one.
ah i see,thank you, that might be why i havent run into it , i havent really needed to rename any of my structs, not yet anyway. ive mostly been adding new vars, tho rearranging the struct will at times break it but thats easy enough to fix for me. or to just not do.
I'm not following, you would already need multiple functions for this if you're making functions to set these properties. So what is wrong with a SetMembers in each?
because I have a lot of variables so it would take a lot of time to set up all of them and it would be quite messy, I'm just trying to find a more elegant solution
With set member you can just set the one that you exposed
I am aware but I would need to set up one set member for each variable, which is what I'm trying to avoid if possible
There's no way around it. You have a struct that can either be set entirely, or each member can be set individually(or multiple members at a time). If you want to affect specific members you have to only affect them with a SetMembers.
ok that's all I wanted to check, thank you.
If anyone else can think of an alternative, even if there's some other way of managing data that I haven't thought of please let me know.
use struct to set/initialize variable, then work on created variable inside blueprint
or create function that sets that variable inside struct, nothing else really when it comes to settings structs
Guys, what keywords do I need to ''research'' in this case:
I basically need to make this ''affect navigation mesh'' area smaller around the object.
When I remove it they have hard time avoiding it, I just wish I could control size of this area.
You can't do much besides lower the size of the affecting primitive or make your navmesh generation settings use smaller scale. That gets really costly really quick though.
These settings here, mostly.
But these settings will only lower to the affecting primitive of course. So if that is too big, it needs shrunk as well.
Is that a null area? What is the issue with it's size atm?
So if I set Acceptance Radius to 150, it gets aborted because of that, and I need the unit to ''touch'' the building. So I need to make it bigger and it just looks not nice.
Any idea on how to do this?
In general it might be better to use some insanely high cost to entry nav modifiers so that most AI avoid the area, but anything the NEEDS to go to it will still enter the area.
CommonUI will make this easier. It fixes a lot of this by using a CommonButtonBase in it's CommonListView. So you can just override the OnHovered, OnSelected stuff in the button itself to handle it.
Hi, who is understanding animations? I have a problem. When the character goes forward and everything is OK to the side. But when back and side, then the animation looks somehow strange. Can someone tell me what the reason is? (Screenshot - Event Graph, video - everything else):
https://youtu.be/bcmrwpmohde
Need better keys in your blendspace by the sounds of it.
Sorry. Auto-translator discord plugin broken link.
https://youtu.be/bCMRwPmOhDE
Basically, when I remove it that it effects navigation, units are bumping into it and sliding around instead of knowing to avoid that place. Maybe I should use some different approach like unit shoud have some collision around him and when in touch with that, we should apply some force?
Or if there was a way to attach custom ''hole'' with exact needed size in the nav mesh?
Or I should work on researching and modyfing unit movement character component and there add ''better pathfinding'' system?
I would honestly just go with a nav modifier like I said. Most AI will path around it because the entry cost is too high. Only something that needs to specifically enter that area will enter it. And if you want to get crazy with allowing entry at specific points, you can also make use of NavLinkProxies too.
Thanks, that's enough to make some research. Nav Modifiers probably make sense. Just need to check how to use them exactly.
these?
Yes, but no. Your list entry itself should BE a CommonButtonBase, not UserWidget
And your Listview that you use needs swapped to be a CommonListView. Other than that, yes you'd use those functions you linked and everything else would remain the same.
So on the the item list itself?
Im not sure what you mean by commonButtonBase.
Do you see this if you search here?
I dont have that plugin but I have my own list view I made.
Right. I'm saying if you use CommonUI it fixes these things so that the button itself can handle it's own visual states. Old Listview does not handle hovers and selections well. You have to do some workarounds with the Listviews Selected and Hovered events. It's gross.
I feel like someone pushed you into a rabbit hole with these list views. You should make it simplier and just create buttons and add them as children to some panel and then you have access to every button and can modify it. Like just simple For Each X Create Button - Add to PanelX in MainUI. If you create them inside MainUI you already have access to array of created buttons and then inside each button you can make your own logic.
Depending on what it's for, listview handling is much easier usually.
problem with that is I dont know how many buttons I need. Im making an inventory system.
It shouldent be that hard to make a button highlighted on keyselection.
Besides that. They also mentioned Gamepads. Unreal with gamepads without CommonUI is just a clusterfuck.
My colleague is dealing with that right now on an older project. 😄 He's had to do some hacky complex stuff to get what is basic functionality in CommonUI with gamepads.
how do i use it
It's just an extension of UMG. It's hard to explain easily without running through the entire thing because it's a bit interconnected.. But it has a thing called ActivatableWidgets. These are the primary core of the plugin. Activatable widgets are like your primary HUD widget, or a menu such as the Options screen or an Inventory screen.
Whenever a new Activatable widget becomes the leafmost activated widget, it does a few different things. To be the leafmost activated widget it needs to be the highest draw order and it's entire parent hierarchy needs to be activated if you've nested multiple activated widgets.
What these do when they're activated are multiple things. The first is that they will set input modes. The same as SetInputModeGameOnly, SetInputModeGameAndUI, and SetInpuitModeUIOnly. What this does is allows you not to track complex state of which input mode you should be in. A simply case of this is to have A HUD up and be in GameOnly as an FPS. Then open an inventory widget which puts you to GameAndUI, then open an Options menu which goes to UIOnly. Lets say you code stuff normally to go to the last input mode. But what happens if your inventory closes from under the Options menu due to your player getting knocked down or something? Should it still go back to GameAndUI since that was the last mode? No, it should go to HUD, but how do you track that since the Inventory no longer exists.
A second thing they do is maintain gamepad focus. When a widget becomes activated it will automatically set focus to a child widget.
CommonUI also moves around an invisible cursor when focus is moved, and will simulate a left mouse click when pressing the gamepad accept button. What this does is allows you to code your widgets using the same functions as you do for a mouse in Hovered and Clicked events.
There are also several new widgets that extend old ones such as CommonListView, CommonTileView, some containers like the widget stack and queue, etc.
and of course CommonButtonBase, which is a wildly useful class for button handling and styling. There are new text widgets with style assets and such.
There are some floating around that I know about from when I was learning it a while ago. I don't know what's been introduced in the last year. But realistically you'll have to dig for info and just learn to use it hands on. Part of the issue is that it is rather gamepad focused and it isn't a flashy thing. Gamepads are niche things for PC devs who have no console aspirations. And by the time you're at the console phase you're kind of past youtube tutorials. Requires a lot more intuitive understanding since they are NDA and most of your info comes from obscure places in forums that are not hugely frequented since they require special logins.
@storm solar But see. This is a CommonTileView. CommonListView handles identically. I just set my items into it.
In the button itself. The only things affecting visuals are the normal mouse events. Hovered, Selected, etc.
Is a datatable lookup more expensive than a map lookup?
yes
but it's negligible
their use case isn't about speed but what you need them for
I was going to use a datatable for a sound list
I need the functionality of a map, but I want to use it across actors, so it's easier to work with a datatable
Then use a datatable*
Don't trade scalable and easy to use code for maybe 0.01ms of performance gain it is not worth it
yeah wasn't sure just how expensive the tradeoff was
It's basically nothing
if you compare them it maps are more efficient and faster, but considering you're just gonna read data from them every once in a while that performance gain would get lost in the noise
How can I make an actor comp reference another actor comp without setting it in my actor's event graph?
What I want to do is the green arrow, but won't go. I have public obj reference to TestComp1
comp?
Actor Component*
You can't
you can't really
gasp
because it's going to be different in game
You could search for the component B from inside the component A's own graph and set it there if you don't want to do it in the actor's graph
"Has component"
I guess im wondering what the good practice is here. I come from a unity background, so im used to slapping scripts on objects and connecting them all by dragging lol
In my head, I thought Actor comps were the equivalent
Yeah you can't really do that in Unreal
In your Actor Component's graph you can Get Owner -> Get Component By Tag/Class to access the other component
Or set it in the actor's graph
Yeah that worked, is this okay to do? Like scalability wise
of course
You can access it like that once and save the reference for future use
But you might want to check if the other component actually exists before doing anything with it to avoid null errors
Thank you!
I found simple solution. Add Collision Box with Dynamic Obstacle that uses _Obstacle class. There is access around the ''building'' ,units will avoid it, but if needed can walk freely.
i am curious if someone would be able to suggest why a built piece can be damaged by the player but not by an enemy ai? the ai can apply damage to the player, player can apply damage to the built piece, but enemy ai cannot apply damage to the built piece?
show code
impossible to blindly guess
for one, this will never be valid
If you're not seeing the print string at all, I'd assume the branch before the apply damage is always returning false.
Whenever I assign a mesh(any mesh) to my static mesh component, my pawn won't spawn. Removing that mesh(keeping it empty, no visuals) would start spawning it again. What's wrong ?
thanksf or a reply, what "this" do you mean the first is valid or second one?
Make sure your pawn is set to "Always spawn", it's likely failing a collision check.
i see no rpitn string when the ai attacks the built piece
The first "Is Valid" after the apply damage has nothing input into the input object, so it will always return not valid.
I'd recommend putting print strings on the values leading up to the branch before the apply damage. The distance and rotation values. Something in there is causing a false.