#blueprint
1 messages · Page 246 of 1
tree ignores world dynamic and axe is world dynamic
axe and tree will ignore
Thanks. I'll take a look.
Ok i set both world dynamic and world static to overlap on both
But the problem is, begin play string never gets fired
are BP_Trees even being spawned?
You've put the cart about 100 miles before the horse lol
yes because I can see them spawned in
Also I see all these errors but never had any problem with actually spawning of the trees and stuff
or the axe
works just fine
i can see my tree static meshes just fine
can you see BP_Tree actors
not static meshes with the same mesh as your BP_Tree actor class
Static Meshes are INSIDE the actors. So yes
Does anyone have any experience assigning and referencing/getting references to individual instances of a dynamic material assigned to several components? I'm trying to do something potentially dumb; I have prefabs that I get the components of, and assign a dynamic material instance to. These prefabs, and the material assignment, happen on a different blueprint from the blueprint I use to modify the parameters of the material. I want to modify the material instance of a particular prefab's components separately from other prefabs. But I'm having trouble finding a suitable way to getting the material instances assigned to components of specific prefabs and setting their parameters from a different BP. The closest I've got so far was setting a single instance and sending it through a BP interface, to the BP that requires the reference, but obviously it ends up assigning all prefabs (and their components) with the same material instance. I suppose perhaps using a map would work best in this case (pairing the prefab as a key with a material instance.. instance.. as a value)?
What are your prefabs?
currently just a bunch of static mesh actors (a group of primitive components). in other words, basic level geometry.
More specifically, what I'm trying to do is modify material parameters for individual prefabs, through the player controller. Ideally I don't think I want to assign dynamic materials through the controller.
I think my best bet is pairing a dynamic material instance with a prefab, since the amount of prefabs and instances of a material will never change throughout the course of a play session
I was just wondering what you're using as that group. But in general it should be as simple as looping through the Prefab's actors, and looping over each actor component and setting the parameters. You don't need a map to look them up this way.
I'm making my character follow a circular spline. But at half way point the controller direction reverses.
How to fix this?
Spline BP and CHaracter BP
I can't do that if I don't have a reference to the dynamic material applied to the component. the issue I'm having is knowing when/where to set the material instance dynamic reference.
I have a blueprint which does some stuff after the prefab spawns, and I have the player controller. those are the two chances I get to create and modify the material instance parameters
Yes you can. You get the dynamic material from the primitive component.
you cannot get a dynamic material from a primitive component
you can get a material, but you can't get a dynamic material instance reference
and the set scalar parameter (and other variants of the parameter modification nodes) only appear for the dynamic instance material node
basically, there's no good/easy/lazy way to get a reference to a dynamic material applied to a primitive component (as far as I know), even if a MID is clearly applied to it, because you can't get the material applied to the primitive component as a material instance dynamic reference
from what I can tell, I'm forced to pair the material reference with the prefab in some way in first blueprint, so that I can later reference that prefab-material pair in the player controller blueprint and apply the material to the primitive components of the prefab. If I'm missing an obvious alternative, I'd be glad to know it.
?
Just create one
CreateDynamicMaterialInstance node and there’s your ref
you did't read my previous messages
but anyway, I guess Set Scalar Parameter from Custom Primitive Data might actually work?
How far up do I need to read
forget it, I may have found a solution
This sentence makes no sense to me because I’ve done it but sure
This is also incorrect
Care to elaborate?
Yeah sec gotta find Vik’s message in here
Alright. The obvious way would be to drag off a component reference and search for "get dynamic material instance" or some form related to that but I had no luck. I'm looking forward to being wrong here 🤣
As for the way I did it before I learned that from him: I would just use the Create Dynamic Mat Instance on the mesh, then modify its params. Iirc, If the original material is already an MI, the changes are instantaneous, and if it’s a regular mat, you just need to also change the mesh material to the new instance when done
I don't have those nodes available for my components
It’s not a mesh component ?
I mean a mesh component is also a primitive component but wdym like an arrow?
Ah, you don’t have an actual bp made up?
Or do you mean an actor component ?
the components in a prefab actor exist as primitive components
hm..
actually
give me a moment, I might be able to adjust this
nope nvm, I'm SOL
I haven’t worked with prefabs tbh, so there’s that. Idk exactly what you’re looking at
I can get all attached actors but that's a faux node that Prefabricator comes with that doesn't really help
If this component gets attached to a parent actor you can prly get parent (attach) or smtg
ultimately, I'm just trying to procedurally spawn level geometry and do some dynamic material shenanigans to fade/unfade stuff based on some player location logic
but prefabs have proven to be somewhat of a pain in the ass in some cases and a godsend in others
Doesn’t #pcg-framework kinda do that for you tho?
Or is it not good for your use case?
I'm not too sure, it doesn't look too related to what I want to do. but in any case, I think this https://youtu.be/QQ-VzeGjLMo may actually be the solution
Hey hey! Today we're talking about Custom Data, or Custom Primitive Data which is an extremely awesome way to create variation in your assets, as well as a very effective way of optimizing your scene. Draw calls can be a huge performance bottleneck if left unchecked, but Custom Data allows us to have control over colours and other parameters in ...
Nice, I didn’t know you could do that. I’m guessing you can adjust those indices dynamically from the material ref
seems like it might! it's late here but I'll report back if I've succeeded
That looks like a good channel to learn more about mats from so I’m saving that. Only thing that didn’t age well is “go read the documentation” 😀
hahah indeed
Good luck
It worked!
and surprisingly too. required even less setup than when I was screwing around with dynamic material references (I still need the prefab's components to have the material instance dynamic assigned to them in the initial BP, but that's easy). glorious.
Yes you can. CreateDynamicMaterial is actually badly named. It should be named GetOrCreateDynamicMaterialInstance. Because that's what it does. It first gets the material. If it is a dynamic material instance it'll just return it. Else it'll create a new dynamic instance and set it.
You can do the same thing yourself if you know that there is a dynamic material instance on the component. You simple GetMaterial with the right, or every slot, and cast it to a dynamic material instance. If it succeeds you had a dynamic material instance there. If not then you can choose to silently let it fail or create one for the slot. But if you want to create one, then just use the CreateDynamic material instead of all of this because it'll do all of this in a single node.
That's interesting to know, thanks! damn shame it's poorly named.
But I think the solution I've come across also leads to less overhead so I'm going to stick with what I got for now. I'll keep what you said in mind for the future though. I appreciate the info 👍
And apparently a lot less draw calls
yep
CPD is pretty good. Definitely use when you can. But it does have limitations in that you quickly hit the limit of properties you can alter on a material. Not a big deal early on, but larger projects with complex shaders hits that limit pretty quick.
BTW I was thinking about using that node and sticking in a regular get material from the component into it but thought that it would cause a new material instance to appear so I decided against it. Kinda silly how such an expectation was subverted 😅
that's definitely true. I'll keep that in mind too. I don't think I'll be doing too much dynamic stuff, at least not with level geometry. *famous last words*
Thanks for all the help and leading me to the right direction, everyone 🙏
hello hello. have some problem with nav mesh. i have world partition map and try to do nav mesh.
i try this guide from epic's, but it doesn't work for my case (https://dev.epicgames.com/documentation/en-us/unreal-engine/world-partitioned-navigation-mesh), cause i have so many cells. What i must try?
So casting is looking for a more specific type at the cost of performance
No. Casting is extremely performant.
Hold on casting eats performance?
If it's implemented the same way as dynamic_cast it could
Does this mean that you communicate your durability from your item to the inventory ?
Or the inventory directly holds the AActor ?
Casting is literally attempting to convert a reference to a specific type. If it succeeds then you can access the variables and functions of that type. If it fails, you get a null pointer reference out.
A comparison of a reference is checking if that reference is a specific reference. It has nothing to do with its type at all.
Performance really has nothing to do with it, they are both different tools for different jobs and you'd use the one for whichever of these scenarios you need.
It depends on what your definition of what an item is and what an inventory is.
Your base definition of an item can be an actor class, it could be a row in a data table, it could be a data asset. There needs to be some single thing that says what the base definition of what that item is with default attributes, like your durability.
if you're using an AActor to represent your item at run time, then that AActor would be spawned with the base data about the attributes and you manipulate them as needed.
The Inventory would provide you with a means of keeping track of what items you have (for example, an array of AActor items) and manipulating the items within your inventory, moving them around, etc.
maybe someone can help me?
i have a grab function to just grab an object but my problem is:
with "Grab Component at Location with Rotation" the object will rotate ones while grabbing..
and with "Grab Component at Location" the object doesnt rotate but swings around on the point where i grab the object...
but i want it stiff while grabbing, doesnt matter which "node" i use
what can i do?
(changing values at the physics handle like linear or angular doesnt help)
I would like a way to hold runtime data without needing to spawn the actual actor that represents the item. I though of having a shared pointer on the inventory to an objects that holds the runtime data and having my actual AActor that also points to the same UObject so if i'm not using the aactor i would only need to have the UObjects being instanced
What are your thoughts about this setup ?
is there a way I can prevent the box extent from increasing when rotated?
Get Box Bounds is just a simple pure function that returns the coordinate of all the 8 points, nothing of a mystery
okay this method only works when it rotates on yaw, the points completely offsets when it pitched or rolled
only z rotation gonna be adjusted, try this
For a tabletop roleplaying game simulator thing I could put dice rolls in a BFL right? Calling them from everywhere, they literally just generate a number and output
You could, but Is it really necessary?
If you want to have 3D dice in the simulator, you may want to just have the 3D meshes and then determine what the value is after physically rolling the dice in the game world.
If you're just wanting rolls as calculations, Random Integer in Range would cover all possible types of rolls, you'd just need to give it the min and max value of the dice.
No because the box extent has increased when it's rotated. What you need to do is get the box extent of the static mesh itself, not the box extent of the component. Using it from the static mesh, you can then scale and rotate it based on the scale and rotation used by the component.
I see
Well I could do for multiples (3d8), but ultimately you’re right - and if I can figure out how to make the meshes palatable to the player I want to do that
Yea I guess that would be an ok function to make, but I'd probably just make a single function to handle all rolls.
Instead of number of dice, just have Dice size an array. The number of dice would then be the total elements in the array. This would allow for throws with different dice sizes.
You always gotta make my stuff more complicated 😭
I just don’t have a good place to give a satisfying visual of a mesh rolling around, or I’d just do it with physics
Isn't there a way to animate UI property from its current value?
I simply want to make a Hide animation changing render opacity from "current" to 0 to prevent multiple calls to yank it over from 1
The only topic I found was https://forums.unrealengine.com/t/umg-how-to-animate-a-property-from-its-current-value/460813 but after I did the blending with relative line nothing changed visually, it still plays from start
Sorry, it's my indecisiveness planning for all options. 😅
I got an offer to help on my game if “you wanted to switch to unity” I said no thank you I would rather ask questions and learn through people telling me roundabout ways to do what I wanted plus a little bit more 😂
Anyone have ideas or examples on how you could achieve a building cutaway mechanic for a top-down tycoon-style game?
Oh actually it's called a clipping plane. That helps
is there a more straight forward way to get 4 textures (based on number generated) and put them on 4 respective buttons?
because I'm currently setting button 60 times per class(in the future) while remembering the order of them
A select node would possibly be favorable to using a switch here, seeing as right now all you're doing is setting a single value differently based on the switch input.
Why do you have so many styles if there's only 4 textures?
4 textures from 30 possible ones, based on random number generated
Oh, so you want to pick 4 from a pool of 30 possible textures?
yes
I would have them as an array. Then you can get random element. You might need some additional logic to prevent duplicates but it should be more manageable than a switch on int.
I was following a tutorial, are nodes like Mouse X and RMB supposed to work? Because they don't for me... I tried experimenting with adding a Mapping context so my IA_E node might work... It doesnt. I'm sure I'm doing a handful of things wrong
i have no idea lol, i'm just not switching engines atp
Keyboard/mouse inputs only work on pawn/controller classes. is BP_InspectItem a child of a pawn or controller?
Drag off get player controller and get enhanced input player something something, connect that to target, not the direct get player controller
If it's an actor not controlled by the player (such as a pawn/character), you need to enable input on the actor and specify the controller it should receive inputs from. This needs to be done to enable both legacy and enhanced inputs to be received by the actor. Don't forget to disable input on the actor when it's no longer required.
True. This should be added on your controller BP begin play and then you can call the mapping context in reference. Didn't even notice it was on a non player bp
Or player char but then your casting to the control to set it anyway
With the BP name being Inspect Item, I can assume it's an item the player would interact with and it's the interaction that would most likely enable the input. If it's an inspect triggered from an inventory when the item doesn't exist, it can be done when the item is spawned. Input Mapping Context can be added at the same time. Personally, I'd handle it in the item itself as I normally pass who is interacting so getting the relevant controller is simple enough. It would only require casting to the base player controller class.
Would you add separate contexts or make rules for one? I always assumed it was better to handle all control mapping on the player controller and then cast to it when needed. I'm still a noob though
I don't think I've ever added context mapping from the controller. I wouldn't say there's a right or wrong place, just whats easiest to manage. If it's added on the item, it keeps the logic with the item its for so there's less searching around if you ever want to change it lol.
Very true lol. I try to comment the hell out of everything to save myself time later
It makes sense in non-single-character driven games, RTS and so on
Hey guys im trying to make a tiered event system where x happens at level 1, y happens at level 2 and z happens at level 3. What is the best way to approach this?
What is the GameMode for if we cant store other level actor references there?
Im trying the eye drop thingie doesnt work bruh
it only works with the node Get Actor of Class
i thought i could use this class as some kind of master class manager of the level. you know... where you store all the references and some generalistic stuff
With 4.14, the AGameMode Class got split into AGameModeBase and AGameMode. GameModeBase has fewer features because some games might not need the full feature list of the old AGameMode Class.
Get random unit vector. If you don't need the z, break and recreate the vector excluding the z value.
ty
What is the difference between "Line-Trace by channel" and "Multi-Line Trace by channel?
Line trace sends out 1 line. Multi sends out multiple line traces from the same start point
Can I select how many lines I want to send?
What's the purpose of it? Maybe better off with sphere trace
If you are just trying to cover more area
For example, I have a sniper that has a lot of perforation, so it can hit 2 enemies at the same time
Or a shotgun that shots different lines in different directions
I dont get how to collide a BP (or rather its child collision-capsule) which is moved by its own script from in-the-air into the ground. see the 8-sec-video how it slides right through the ground and my collision=explosion logic wont trigger, neither for On Component Begin Overlap (Capsule) nor for On Component Hit (Capsule). Collision settings are in the 1st screenshot. Also the movement code shown in there only ever prints false/false as it glides through the ground.
The "ground" being a World Partition Landscape set up like 2nd screenshot.
How can I ever move something programmatically that'll also trigger the builtin collision mechanisms? Is there some update method I need to call?
Shotgun would be good use for mult line. The bullet penetration might be better off adding parameters to the projectile
You can set it so that the lines go in different dirrections?
I believe that's the purpose of it
There's some YouTube tutorials called "wtf? is _____" they have one for all the traces
yeah i read that, unfortunately the functionality and instead i must have a separate class for the generalistic stuff
it doesnt allow to get references from the level
i mean
where would you store stuff about map generation, references to other classes
the array of current players alive
the array of rooms and buildings you can enter and stuff
i was thinking i could store this in the GameMode
but its not good because it doesnt allow to get references from the map directly. only with Get Actor of Class
you could make a subsystem that actors register themselves to
Hey, can someone help me with a weapon pick up BP? I am following a tutorial but whenever I do pickup the item, it doesn't show up in my hand. 😦 It basically disappears???
Make sure to untick "Consume Input" on the Interact input, otherwise having more than one weapon in the world will cause issues.
hi
hello. i am intending to swap the cursor.
What would i cast to to get the cursors owner,
and, would you say it works like that?
Hello, Christopher! 🙂
i guess this could work, although i only have defined software cursors....
No, they follow a single line in space, but continues through overlapping objects with a new line along the same path(stops on blocking)
For a shotgun youd ForLoop traces from the same origin but with different angles
Enemy Ai is stuck in circle loop walking around it instead of attacking me, I couldn't figure out why to debug it
There are like 50 enemies of the same bp all act normal but then one or two of them gets stuck like that and doesnt attack
Anyone have an idea why?
Use crowd ai controller
If I have two Actors like that with Collisions that enable Interaction with them,
But since they are placed together, the Collisions overlap – so the End Overlap event is not always triggered, since it's seeing it as the same collision
Any idea how could I avoid something like this?
i feel so dumb right now... i want to spawn particle system component on component hit, and destroy it when the actor doesn't hit anything. how do i do that?
Sounds wierd destroying it when actor doesn't hit anything or you want to spawn it and it destroys on it's own?
I looked it up but its seems like a c++ thing and i only use bps
Maybe look at using the big circle to overlap with the player capsule instead of the overlapping the two big circles.
If you want to destroy on not hit anything then if it hits you spawn it and otherwise check if it exists and destroy it, otherwise you can setlifetime on the particle system so it destroys itself after a while
i want to spawn it once and destroy it if hit equals false
Just where you check the hit or not hit then spawn or if it exists destroy.
they already trigger On Overlap with the Player
what's the issue then, the end overlap should trigger when they're not next to each other
You'll want to change the collision profile of the sphere so they don't overlap with one another but can overlap with the capsule component.
thats the whole point of my question, the Collisions are overlapping..
Which collisions? the big sphere with the big sphere? You may need collision channels or something, i'ts not clear what your issue is
But since it's the same BP, profiles would be the same too?
The colliders have profiles that can detect specific other colliders.
Ok I'll look into it thanks
It's this whole bit. This is what the capsule collider is of a character by default. Because it's object type is "Pawn" that may be a good profile to overlap with on your sphere but ignore everything else.
The issue is since it's the same Blueprint for both NPCs, and as you can see on the picture, if two NPCs are close to each other, the Colliders (red) are overlapping, so it does not trigger the End Overlap event if you move from one to another
I'm not sure if its possible
right now what is happening is your collision setting is still detecting the sphere being overlapped. What I'm saying is if you change it so the sphere's don't overlap with eachother and instead only overlap with capsule, then it will work as you expect.
oh ok I see
It doesn't matter about being the same bluerpint, just that the colliders themselves are detecting one another.
I will try that thanks
Figured it out... good grief
Hello, does anyone know what's the difference between the two? When should I use one or another? I saw that the left is used in the construction script, and the second one on game time, but I don't know why
Are you talking about materials? Game mode is not replicated, so it doesn't make any sense to have a multicast or any code that has to run on a client in the first place
You have to move that multicast else where. Most likely it should be a RepNotify property, as you most likely want players that will join the game later to have the same scalar parameter on whatever you're changing it on
Clients cannot communicate with GM directly in any way
You might want to read this for proper information rather than watch tutorials
https://cedric-neukirchen.net/docs/category/multiplayer-network-compendium
This compendium is meant to give you a good start into multiplayer programming for Unreal Engine.
Also there's more in #multiplayer pins in case you want to read more
Cast is a type check. a Controller is NOT a mouse cursor
read the #multiplayer pins like suggested 12 times , practice, fail , repeat then ask question if stuck
for a start using Multicast here is already the INCORRECT step
you don't use multicast 95% of the time, it's a beginner trap.
Anything stateful shouldn't be in multicast
even saying is a node not replicated already indicate that you don't know basic replication
Same thing
Use Rep_notify
Multicast can be dropped and will not run on players outside relevancy
so people join your lobby and they go wtf, why is my color different with yours? since the function invoked by the multicast never RUN on their machine
Start with this, then read Wizard tip's and trick
and stop watching Youtube tutorial ESPECIALLY for multiplayer.
On top of being garbage, they always make the wrong move all together. Like using multicast when they shouldn't
Your lack of simple multiplayer concept is apparent
it is not fine
your only way to go forward is to read the pinned material
there's no other more helpful source sadly
In your actor blueprint you are likely don't have ownership, hence your RPC gets dropped.
Again MULTICAST is wrong here,
Again, read the pinned material regarding ownership
I already did, don't use multicast and use repnotify instead
Also read ownerships in the pinned material
nothing else I can do to help you
if you gonna fight the advice, then I don't know
you can try reading the compendium 12 times, that's not my advice but the common advice from #multiplayer
takes a while to sink in. It took me more than that actually
multiplayer is a beast, replication is only the tip of the ice berg
can confirm that basically every time i tried to use a multicast when starting out it was for the wrong thing
@somber torrent Freebie
Ideally, you only want to care about the collision that happend on server, but I am just giving example so you have the idea how to call as client too.
If Server -> Just change the Color variable, this will trigger on Rep that changes the material color
If Client -> Route to Controller (Because client doesn't own the cube, it needs to route to something it owns) -> Call Server Rpc
-> (Now we are running on the server), Run Change Color on the cube that get passed by client -> Set The color variable which trigger OnRep
Use a timer to check if it's already overlapping.
OnBeginPlay check if they are already overlapping
this is just to address the initial issue where they are already placed together in editor
Iirc when you have that box it's a complex function that follows timings. It's been a while since I have seen it.
Timings? You mean that it's async?
I think so but also they call this a tunnel node on the website. Does it show a tooltip?
Ah no I mistook it @tepid willow I was thinking latent but that's a clock.
I know the f is a function. Not sure what box means
It's usually used for auto generated nodes
You never can open them by double clicking it
@tepid willow according to ai that box or window icon means construction script
I would guess you can use one for construction but not the other
Doesn't look like something I would use in a construction script
Well idk what the box icon means but the main diff between those previous 2 nodes is one had a class wildcard
First one doesn’t even give you the option so it probably just adds an empty one ig? What did the tooltips say
This is gonna drive me nuts...
I am pretty sure the box does not mean anything, it's just the default icon. The simple difference is that one of these nodes has a wildcard and the other doesn't because it's outdated
Added a new AddComponentByClass node that allows a class to be selected or passed in. Unlike existing Add Component nodes, this node may be used any place functions can be called on an Actor, however, you cannot customize the component template beyond any properties that are exposed on spawn.
oooh, yeah, that's true, I forgot about that difference
So they can be used in the same context, but they have different use cases, right? If I know the exact class I want to spawn, it's better to use the first one since it allows to change all the properties with no code
pretty much, yea
if it's not a one off you might prefer making a subclass of uSkeletalMeshComponent, make the adjustments you need and then spawn the subclass instead with the generic node
It was just an example component, I was not going to add it like that
Hello! Baby programmer here. I want to create a very simple puzzle game in 2.5d perspective but I can't figure out how to get a camera detached from a character. Every tutorial that I look up is focused on making a third or first person character but I want to split the 2, any help would be appreciated. thanks!
You're looking for a pawn that you can attach a camera to
I see thank you!
Anyone have any tips for merging skeletal meshes on a modular character
I don't know why I can't get this to work, can anyone offer some insight?
I'm trying to get buttons in a UMG widget to change the index of the widget switcher it's nested in.
Image 1 = main menu, nested in a widget switcher on the "WBP_StartSequence"
Image 2 = "Start Sequence" UMG Widget.
I want the buttons in the "main menu" widget to control the widget switcher in the start sequence widget.
I've tried casting and making hard refs in both, but neither seem to work. I've even tried it as an event. Still didn't work. Any ideas?
show the bp for the widget switcher index
This is in the "Main Menu" widget.
I've also tried casting instead of creating the widget.
I've also tried it like this, in the start sequence.
One sec sorry
It looks like it should work? Can you get the buttons to fire a printstring?
I'll try one sec
slap it in before the branch
Nothin
so your button isn't being pressed
Let me run some break points
make sure the widget is set to visible or whatever too
The on click custom event isn't being fired. Even though it's bound to the button in the WBP MainMenu 01
If I try to call it in WBP Main menu I get an error.
It's set up like this in the WBP_Main_Menu_01 which is in the widget switcher.
set your widget switcher index as a variable maybe
Still
Is there a way to cast from one widget to another? It seems to be some sort of casting issue
uhhh, so i have my buttons
it passes an int to a event dispatcher
which then when fired, sets the widget index of the widget switcher on my widget
I mean, the "none" is implying it's not finding the thing you're pointing it at, which is a communication issue between the blueprints, tbh I'm not 100% sure WHAT it's missing
The start sequence ref is null, what ever type it is
i dont even know what im looking at with this, and apparently something somewhere doesnt work. brain hurts
oof
what a brother gotta do to make a progress bar that goes down when i dash
what progress bar, stamina?
wdym
it's totally possible to make a bar that can go down over time
anything wrong would be the logic
Yeah, you never set the reference
trying to access null object
In your blueprint, you implement code that says, Change the Percent in Dash meter
but you never set the dash meter
so it's changing no dash meter in existance since you never point to one
so waht just add a "set, dash meter, 100%"?
wait i might be stuipid but isnt aht what is already happening?
this variable is never set
hence the error
you might want to watch blueprint communication video to better understand object reference
This is what I mean by setting
now that As Char Bp is the player character that you passed which is the player's 0 character
are you reading above?
HAHA my monkey brain has solved the puzzle
but now i can still dash even with no stam, but that is progress.
i got it to fully work, huge.
do you need to upgrade UE5 to the latest version to get the fab plugin?
What version are you on?
5.4.4
Check out your Epic Launcher / Unreal Engine/ Library. You should have a Fab UE Plugin there. Pick Install To Engine, pick 5.4.
i checked plugins in my project and didnt see it. i'll check the library / launcher. thanks
You should be able to find it by searching Fab here.
yea i just found it. I appreciate the help. thank you!
Once you install it you can access it here.
If I have a component variable, how can I get the actor(or gameobject, whatever) that it's attached to?
Morning everyone! This is the default camera input that comes with UE5's FPS template. I was wondering if it's possible to unlock the pitch, that is limiting the up/down 90 degrees look? Or do I have to create my own custom camera input system?
it is limited elsewhere not here, controller rotation input just adds to rotation raw values
@grave crow thanks! any ideas where I can tweak the limiting values?
can you not look straight up or down? because there is no built in functionality for limiting pitch afaik
Attached to, or managed by?
i can look up and down yes, but i want to completely remove the limit and be able to flip 360 on the Y
that's gimbal lock
gotta use quaternions for rotation if you want full rotation freedom
sounds complicated lol, can you recommend a tutorial to follow?
oh yea blueprint channel
but quaternions are not exposed to BP
wait I just looked at it and it's not even using quat
there is a blueprint version of this https://unrealcommunity.wiki/blueprint-six-dof-flying-pawn-tutorial-ocrkre4o, but if it's all euler it's still gonna have gimbal lock so I don't really get it
You can make an easy enough function yourself if you're setting rotation directly. It's as simple as inverting Roll and Yaw if pitch goes above 90 or below -90.
okay I think I figured it out, add local rotation uses quats internally
so just use that instead of control rotation
all default rotation operation internally converted to quats
how do I offset a transform with another? The "Grabbed Object WTrans Offset" is a relative transform to the Pivot World Transform so I want to get the world location and rotation of the offset
Search function for "Transform". There are some functions for Position, Direction, Rotation and Scale. Though in theory if there is an addition node for transforms, that may do the same thing.
I see
Authaer, are you familiar with back-end?
Hi All,
I am trying to simulate an orbital movement. I've plotted all formulas (G constant is value of 1 in my example to boost the values).
I have a mass of my "sun" of 33200 and planet 100.
Gravity force kinda works (M*m/r2) but planet velocity is too small (sqrt(M/r) ) and planet is eaten by sun anyway...
did anyone make some simple examples and can point me in the directions?
thankjs
I am using "Add force" to make planet move
I'd like to add a cooldown bar in the HUD to show when the dash ability is available again. I'm currently a bit stuck since I've only just started with Unreal.
I wanted to check if the player dashes, if so, set the value to 100 and the percentage, otherwise 0.
Could anyone help me out?
Back end? Like uploading data to a database sort of back end?
Database yeah, my struggle is knowing what kind of service I can use to track if the user is "connected"
from my mind, I am thingking websocket, but trying to find other alternative since I am totally new to the field
I used AWS, for the login system, which generate credential with JWT token, but then I relaised, multiple person can just "log in"
and now they will overwrite each other's save file to the dynamoDB
oh well, I am looking at a chat app tutorial atm, trying to see what I can steal for the connection part, but I think they use websocket.
I'm only surface familiar with them. Kaos handles most implementations like that for us.
👀 Oh you guys work together, that sounds nice.
thanks anyway, I think I will end up using websocket anyway.
just praying the bill didn't go up astronomically.
reading chats from AWS discord is kinda scary, people get unexpected bills
Yeah, seen a few complaints about that floating around. We don't have anything that scales to a degree that we can't just use our own hosted server in the office, yet.
Hi guys. I'm trying to spawn an actor from widget using the mouse to drag and drop. It works, but the actor spawns at the world origin and not at the mouse position. What am I doing wrong?
try the impact point? or even better draw debug the trace
you should break the transform too...
and only plug the location
A Transform contain location, rotation and scale
Instead of dealing with booleans and delays, you should consider simply setting times.
When you perform a dash, set a float like LastDashTime to the current game time. When trying to dash you can simply check if (CurrentGameTime - LastDashTime) >= DashCooldownLength
In your UI you can do ((CurrentGameTime - LastDashTime) / DashCooldownLength) clamped between 0 to 1
I did all of that and still spawns at origin. I'm trying to draw debug it right now but I'm not sure if I'm doing it correctly
just look at the trace, if it doesn't behave like intended (mouse cursor to world) then youa re doing something wrong
start with the debug, make sure it impact the right location, then move on with the spawning
I don't know much but it's strange to me why you multiply the direction by 2000, what's the actual math behind it?
do you even need the trace at all? Shouldn't deproject mouse to world gives you the location already?
I'm doing it after watching some old UE4 tutorial, so most likely something is done in a different way. Just not sure what exactly
The tracing seems fine. It draws a red line to mouse location
but the actor spawns at origin
ok I think I found the problem
the 2000 distance was too small. I increased it to 200 000 and now it does spawn at mouse location
I see, it's getting the direction vector then multiplied by distance
One more question. How can I get the scale of the spawned actor, and then multiply that scale with the scale of the Niagara System.
So for example, if a new actor is 2x bigger, the spawned niagara system will also be 2x bigger
I know nothing about niagara but if you want to get the actor scale, you can drag from the return value of the spawn node and type get scale
I wondered what is the best way to achieve this - I have a lot of static meshes in a BP and I want to be able to pick a handful at random and trigger the same animated transform on them - for example, rotate 75 degrees using a timeline over a few seconds. All at different/varying times. Of course a function or macro would be great for this containing the animation timeline and pass the mesh to it, apart from you can't run a timeline within a function. Is there another way without having to create a timeline for every possible simulataneous animation that might occur?
Hi, I can't figure out why after adjusting font size on my text block in widget the size resets to 0. Please see the blueprint - the size passed is 48 and I'm sure, I observed this using those two debug variables visible. Am I missing something? I'm about to go crazy... Other text properties (like font family) remain intact and are the same on both variables
Ok, I've figured it out... This works. It looks like the "set members" happens "in place" and does not require reassigning back. I could've sworn that in other places I've used the "set members" node on different structures it required reassigning it back.
I just learned UE doesn't support composition which is one of the basics of OOP, which is honestly mind-boggling to me
In general I would say a simple ticked function, and an array of structs.
Make a struct with a few variables like the Mesh pointer, StartTransform, EndTransform, MovementDuration, StartingTime.
Make an array of said struct on your actor.
Make a function that takes in this struct and iterates over the array to remove any structs with the same mesh pointer before adding the new struct.
On tick just iterate the structs backwards and move all of the meshes using a simple Lerp. Remove any entries that are past their move time and set them to the end location.
I can't create a scene component which has subcomponents and instead I have to copy paste singular components inside an actor bp
Components can use UObject as subobjects. Components are managed by actors, not other components. Why do you need a component to manage another component?
Consider a vehicle with headlights, a headlight is a static mesh with an attached spotlight.
Instead of essentially copy-pasting components with only difference between them being the socket from the parent mesh to which the headlight is attached, I tried creating a HeadlightComponent which would be a static mesh with a spotlight, but SceneComponent doesn't have a hierarchy and can't have subcomponents.
So I can create a HeadlightActor which does have a hierarchy and I can put static mesh and spotlight inside it (along with logic to handle turning the light on and off), but to then put it inside the vehicle actor, I have to use ChildActorComponent, which loses information on the type of the Actor being referenced and I have to use Cast to call a function on that HeadlightActor, which isn't an elegant way to do this.
hey all how can i play a music that runs on async thread? also how can I control it once i have played it. I initially though of playing it from GameInstance but it seems not to work on level change
It would be nice to have bundled components like that. I personally do things like this with a data oriented approach. I have an ActorComponent that is a customizer. I feed it a data asset that has a hierarchy of components with tags and data and the customizer creates all of the components for it's owning actor. So in my case for a car I would first specify the main car mesh. Then under that I'd have entries for the meshes which would attach to sockets on the main mesh, then under the mesh entries they would have the spotlights.
But yeah it would be much nicer to have a bundled component that would make it easier at designer time.
Is it possible to make a character where other characters can walk in them? To avoid needing to handroll my own movement component, I was thinking of making a "Spaceship" character.
But when trying that, it seems I can never have other characters walk in the ship. They just bounce around, even when setting the "Character can step on" to yes.
Making the spaceship a pawn makes the problem go away
I have a mount which moves with WASD and a hero that can only look around. The hero is controlled with my controller and sits on top of the mount. I would like to leave the hero controlled by the player but move the mount at the same time. I already set Autoreceive Input to Player0 but the mount does not register any input. I also tried the "Enable Input" node in the Begin Play of the mount, but to no avail. Any idea how to move the mount/register input at the same time?
Yeah, seems like an overkill honestly. I'm coming from Unity and Unreal has some great things about it but some things you would think are basic are missing from it or are completely unintuitive (interfaces come to mind). It would be nice if the engine didn't fight me when I try to use all the best practices I've learned in traditional programming.
I couldn't stand Unity. I'm sure it has its merits, but I am a professional software developer, having programmed in C# since .NET 1.1, and I couldn't stand it.
I'd rather struggle with unreal's C++ / weirdness than mess with Unity, and programming in C# is my daytime job lol.
I haven't used anything except Unreal. But there are a lot of Unity people in here lately. More than normal.
Probably a lot more due to the hype of recent releases and the fact that unity screwed over so many developers less than a year ago
Or tried to screw them over real bad. It backfired to the point of them appointing a new CEO and walking back the changes.
Authear, you have been around a long time, do you know the answer to my question? I have limited time during weekends and was hoping to avoid rolling my own basic CMC.
Is there a way to make a spaceship character and allow other characters to walk inside of the mesh or is that impossible to do with the engine?
I haven't made anything like that myself. But I would say it's possible simply from playing ARK:SE. They do it with things like platform saddles and whatnot. Unsure what it would take though.
Fair enough. Well I guess worst case all I need the spaceship to do is lift up in the air while leaving the level and land when loading into the level. That probably wouldn't be too hateful to implement.
It won't be player controlled
I worked 4 years using Unity and in my opinion from the programming standpoint it's simpler to use and more friendly to utilize proper design patterns, especially if you know the tools, like zenject which allows you to use dependency injection
Each engine has their strongpoints
Unreal has started to take a really heavy data oriented design approach in the last few years. ECS has also become pretty prominent with things like Mass.
One thing about Unreal is that it's more often used by larger studios. In game customization is usually a large factor with a lot of things, and that means designer stuff tends to be left to things like static map design. A vehicle or character that can change skins and the like don't tend to be created by hand in editor, so the tools to do so tend to not encourage it.
That makes sense
I hope they'll start addressing the needs of indie developers, with Unity being what it is there's a niche that can be filled
They probably won't.
Most of us indie's don't earn the engine any money. There's little incentive for them to do things for us. The engine gets what it needs for fortnite, and what AAA can use
I feel like the biggest void is for intermediate developers
For them to make money off us, we need to be pulling in over $1m per title, which just isn't happening except for an incredibly small amount of us
Even indie's that can live off their work don't tend to make that much :P
is there any way to ensure BeginPlay of level blueprint is called before any other BeginPlay? (I would be fine with BeginPlay of gameinstance and similar special classes run before, it is about normal actors in level)
I wouldn't think so
You'd be better off firing off an event and having the necessary components / actors listen for that event and then run their logic.
No, but what are you using the level blueprint for?
The need to ensure this initialization order tells me you may not be using it well
My situation is this: I have certain param on GameInstance informing if we are in main menu or in game level itself. I set it both in UI (before I change level from main menu to some game level and vice versa) and in BeginPlay of all levels. By default its value is MainMenu.
It works fine in actual game, but if I run PIE or similar, I get MainMenu when level starts (to be specific, in character's animation blueprint, EventBlueprintInitializeAnimation) in level that is gameplay, presumably because level blueprint's BeginPlay was not called yet.
It impacts game, since I have character model in main menu (for character creation preview) and it has different idle animation than in actual gameplay.
It is not big issue. But I would really, really like to have exactly same state of game when running in UE editor as in actual packaged game.
Why not just use a different character for the different levels?
Have a specific pawn for the main menu and one for the game level
I would like to avoid that, as it increases amount of assets. Maybe I will do that, if initializing vars is impossible in level blueprint (there is no construction script for level blueprint or C++ class for levels to inherit for some forsaken reason)...
hmm maybe it is enough to set different animation blueprint
Am I really supposed to do it like this? Why cant I just have a SceneComponent and attach a box to it and handle it from there and fire events like any other component?
Hi im trying to make a view sway but i have three issues one sometimes it flickers when swaying two the right sway is quicker than the left despite them being the same and three i cant figure out how to change the time of the timeline so i can make it shorter or longer
hey there idk what to hook up to the object node i am casting from one widget to another widget to set text based on a input from a editable text box in another widget
you need to pass the reference of namecomany to this witdget and hook it up to "object"
i created a variable with the reference in it but it wont let me get that refernece
wp_namecompany spawns this widget?
that is the widget
what is wp_namecpmany?
the widget im casting too
so they both widgets
yeah
im gonna be setting something in one widget which transfers across all scenes ui
i just promoted the cast to to a varible and that seems to do somethinbg
the widget that is casting to wp namecompany needs to know what widget that is
so you need to pass the reference
example of how you do it
WP_namecompany must spawn this widget
and in it you create an exposed on spawn variable
im using different scenes does that change how i set it up
what do you mean scenes
basically you set the company name in one level and then press play it puts it to the game level
where the text will be set based on what was set in the previous level
should i just combine the levels instead
widget can persist through all levels
Widgets are normally purged during level transitions. (It's part of the reason you can't do proper loading screens without using C++)
should i just do it on one scene isntead of two then
Level streaming is a little different but generally, you shouldn't be storing gameplay relevant data on widgets. Widgets should be displaying data that exists somewhere else.
mine has to be on a widget as its the only way u can do a editable text box to set up names
Anyone ?
its actually totally fine lol im selling my games for 4 years now
When you set the company name, you should update it somewhere else. An easy place would be the game instance but personally, I would save it to disc using save game objects instead.
Then when you transition to another level, the widget would load the data and display it.
Adding to this, you could store it on the game mode and have the game mode handle saving and loading the data. The game mode is pretty easy to get from most places.
It's a massive no no in multiplayer games. You can get away with it in some cases if it's single player but its never to later to get into good habits.
Instead of using a select float, use a lerp and use the sway amount for the alpha. At 0 it'll be -10 and 1 it'll be 10.
now it wobbles awkwardly and leaves the camera at a non 0 degrees
Show how you've setup the changes.
the numbers were the wrong way round but it still does the same thing
Ok, so change the curve to start from 0.5, goes up to 1, then down to 0 and then backup to 0.5
Edit: Actually, one minute.
essentially I'm taking the value of 0 to 1 from the timeline then times that by either 10 so the maximum is 10 degrees or if the value is on the other side of the curve by -10 so the maximum is -10 so the angle returns to 0
You probably want something like this.
The Tilt Right, will flip every time it's finished meaning as it loops, it'll flip between -10 and 10 for the tilt rotation.
is the tilt right checking if it is on the second half of the curve
No, the TiltRight tells it what direction it should be rotating. This flips every time the timeline has completed. One run through of the timeline will go from 0 - target angle - 0 -> flip direction -> 0 - target angle - 0 -> flip direction and so forth.
will that fix the stuttering ?
It should do.
it tilts slightly then stops quickly and it doesnt tilt again
I don't understand
Here is the mesh. I can see it. everyone can see it.
Here it is in the level
No one can see it
Wth
I even deleted the actor and re-created it
inside out uvs?
@regal fulcrum Did you by chance toggle it to Hidden in Game? 😃
Nope, I didn't check hidden
and I deleted the BP entirely and re-created it
I swapped it out with a box model I created with the modeling tools in-editor
still, the same result
you can see it at any point when you fly around in editor?
If I create a new static mesh component and move it to be a child of the ItemOverlapBox, then I can see that static mehs
*mesh
and no, I can't see it anywhere
If I move it to be a child of the original static mesh
Then we are back to not being able to see it
its a child of some actor?
Nope. I edited the C++. I am now making the static mesh (original) a child of the box component. I'll see if that makes any difference.
For whatever reason, that fixed it
How could I instatiate a Projectile from an enemy and give it a direction?
As if the enemy was shooting me
watch some youtube tutorial , its the basics
basically just spawn a projectile actor from enemy bp that has your characters location
hardest thing is to pass the location to the projectile
but it isnt too hard
Make sure the timeline is set to loop.
how do i do that ?
that fixes the filcking issue howver it means it never stop moving
make a custom event that stops it
but the releasing of the key already should stop it
looping timeline only stops when you force it
how do i make a custom event that stops it ?
call it when you want
then start it again with another custom even when you need
idk i wasnt following your problem
In Unreal Engine, Timelines are used for time-based animations. This is an example use of a timeline for opening a door.
That might also help
Hello, does anyone know why the Take Recorder cinematics is flipping my Character's capsule exactly like this:
https://www.reddit.com/r/unrealengine/comments/zdv4n8/take_recorder_flips_collision_capsule/
ive done that but now it just stops the camera at a bad angle and then starts awkwardly
reset the angle to 0 when you stop?
and start from start when you start
like reset here
i dont rly know what are you trying to do cus i wasnt following but theres not alot more you can do with the timeline 😄
What is the highest component you can attach to an actor and move it / position it within an actor? Would it be PrimitiveComponent?
nvm, it's USceneComponent
it is the RootComponent
Is it unreasonable to do ~100 lines traces per tick? It seems to cost me ~20ms in the editor, which seems like a lot for just one gameplay feature.
how about sphere trace
are you using draw debug on them?
Are you profiling in standalone ?
I'm just trying it out in the editor. I can try standalone.
Line traces themselves are not usually very expensive, but drawing the actual lines is a diff story
should honestly be easily done. Again, debug visualisation will kill you though
Yeah looks like it's about the same in standalone, with or without the debug lines. I think the cost is to CPU whereas debug line drawing is GPU, right?
Should be yeah. Are you certain it’s the actual line traces causing the 20ms drop?
It is something in this loop, I'm assuming it's the line trace:
yeah make sure you're actually clearing those arrays at some point
also on tick, print the size
It's cleared just one block to the left of the screenshot
I swapped to add unique, no difference
just unplug trace entirely to check if its rly whats causing ms drop
It is. When this loop is disconnected, I get 120fps
Also, I did have a timer thing measuring this loop
Time to remake it in cpp ? 😀
I am considering that, but I'm wondering if it's the physics that's taking a while or what
It's probably the number of nodes honestly
It's a lot to execute on tick so often
On it's own it wouldn't be awful, but x100 it's a lot
sphere trace might be better but its harder to implement
I want to get the Actor that this component is attached to, so that I can affect it's transforms. I cannot use getAttachParent or something like that..
there is no actor that is attached to
It’s get parent (attach) btw
It's a class reference, it's just taking class default information
It's not actually a scene component in the world
And what Cuppa said
right. I cannot use getParent either
You found leaf in the dictionary and you’re trying to ask which tree does it belong to
It is not an instance
Get an instance of it
Sorry. I am coming at this from a Unity way of thinking
You need a ref to the actual component
Yeah I tried to do a sphere trace but I don't think I can make it work for this. I think there's actually a faster way of achieving this by looking for corners, but this is the simplest way. I might try doing this portion in C++ and see what happens
once i needed a semi- homing projectile so i made it by attaching a sphere trace to a forward going projectile so the further it went the more area the sphere trace covered, like just by making the sphere bigger every tick
When in doubt, cpp
But also I believe people make “cone” traces using multi-sphere traces
Ok so here is what I am trying to do. I have this SceneCapture2D_ISO element in my scene. I want to be able to affect the transform of the object itself, and I want to be able to also change it's Field of View value. What is the best way to refer to these in a Blueprint?
How would you make a cone trace using two sphere?
I'm having an issue with my project after compiling. Levels load in "chunks" which will cause actors to pop in sequentially after a level is opened. This causes issue with my saving system as the save will try to load actor data before the actors are loaded, making it effectively useless.
I already tried using async load assets and load stream level both at the start of the game and right before opening the level, but it din't change anything about the load times.
Here's a comparison between in-editor loading and compiled loading times
hi have a question
if i'll add array with MIDs (Material Instance Dynamic) into Set Texture Parameter Value or any other Set for MID it will be applied for every MID in array or only for first?
Sorry, I misspoke. Multiple spheres traces with DOT product filtering
I'm trying to isolate the problem.
It seems any mesh I give to my character flips the capsule
It flips the capsule and creates flipped animations to counteract this flip
God knows what or why it is doing that
generally you can just run it and see if it affected every instance, but i guess if it allowed you to connect an array, then it will execute on every element of the array
i'm working on my character's animation blueprint but got myself stuck on landing animation after jump. i want to block character movement while the landing animation is being played, so i hooked up functions for the landing state (onstate entry and onstate exit) but sadly it turns out i can't do it this way because function calls inside those need to be thread safe. is there any other clean way to do this?
yeah, it applied for every material
thanks
anyone free to jump in channel and share screen real quick, help setup an unclamped pitch camera? :>
Having a little struggle getting some characters to spawn and then move around. When I place them in the world in the editor and start things up they move around just fine but when I spawn them at runtime they just stand there (or hover there). Any ideas would be very appreciated.
based on your second screen, before you do your movement you check for a variable "is picked up" and you dont set it to true after the character is spawned runtime and i'm guessing it's default value is false
or rather true because you check for false*, check your defaults in the organism blueprint anyway 😄
default for IsPickedUp is false yeah, I'll give it a look
The weird thing is the characters don't fall to the ground plane the way I would expect like its not just the move to that isn't working they aren't simulating
you could expose on spawn this variable to be able to set it during spawn
hmm, you are picking them up and placing down, why spawning new one?
I want the functionality of the player spawning and removing the pigs during runtime. The ones running around the level were just to test
so it's not just picking them up and placing down?
Falling requires simulate physics being checked, is it checked for both?
if its just picking up and placing down, you could attach the animal to your player instead of removing it and spawning a new one
As for what seems like a possession issue, you need to go to the details and make sure AI Controller is set to both Spawned and Placed in World
They should be identical just one is spawned during runtime
that might be it I'll have to take a look
That did it! I'm sure there's a good reason why that's an option but man was that annoying XD. Thank you!
Hi there UE Guru's, do you know if it is possible to force the loading of texture mipmap, like with a flush for the level streaming, so that I can have a slightly longer loading screen but with fully ready textures ?
something that I can change at runtime
🤔 async load asset?
hmmm I'd rather avoid having to load every asset individually, any way to do some "force loading all at once" ?
I dont mind if it blocks
Maybe with cpp
I guess I will sooner or later have to plunge deep into cpp programming 😄
This is the way
It is definitely in my pipeline for the next game, the one I am working on right now is already way too advanced to move to cpp
Some things you can do in cpp no matter how far along you are. Others require major refactoring, sure.
I would say most things you can convert to C++ no matter how far along you are.
Now whether you would gain much from it based upon your experience / functionality, that would be a whole other thing
honestly, it's a game that does not feature complex mechanics that would benefits from conversion to c++ performance wise
and I have joined the ship after 5 years of dev, and the original dev is a graphic artist so the code is basically a spaghetti fest that I am combing
this isn't about performance necessarily, but rather things that you can't do in bp
you asked, we answered. you don't have to follow the advice
I have very little cpp in my game rn, just what I couldn't do in bp. Like exposing gameplay tags, or pausing on tab out, etc
each of these those took very little time and effort to implement, despite being a year into this project
ok thanks for your feedback, I'll check about this for texture streaming purposes
I didn't mean to sound like I wasn't paying attention to what you were saying by the way, sorry if it felt this way
i've just made animnotifies and called it a day
not at all, just saying I know how daunting it can seem and I also know very little cpp, but some things you're likely to find a good pre-made solution for online that you can pretty much copy and paste. Having said that, I'm still working on implementing a decent loading screen tbh 😅
Good luck, I've been fiddling with Async Loading Screen plugin. I actually have worked with c++ a lot in my job but within the context of UE it requires to adapt and I'm just not into it now haha
hi guys i want to reuse CancelDialog delegate in other places as well, how can i reuse it without having all these red lines across my event graph?
Drag from the red pin and type create event.
Create the CancelDialog as an individual event, that gets called by the custom events attached to the delegate
a bit gross but should work just fine
You will have to create a matching event signature
ah i see, thanks guys!!
If you can do cpp then just steal lyra loading screen plugin
Yeah I tried that one, but hated it. My loading screen image would load after the loading screen itself, resizing the tip widget, despite forcing it to load prior
good idea but I'm still on 4.27 for the current project, will definitely look into Lyra for the next one, gameplay tags and all
I've been meaning to do that myself but I get anxiety when I think about opening Lyra
The camera solution is the best grab of my life
But yea, kinda have to go through some detours just to get the function that I want
Lyra is overenginered according to lots of people. Their advice normally is to just take what you need.
@frosty heron @hearty rain i might have found a better way to do it, you can give an event dispatcher and make the logic into a function and feed it to the delegate:
I found some of their solutions to be a bit overkill indeed, like the "root yaw offset" stuff
Interesting, looks very clean this way
it does and no clutter with so many custom events in my BP
Doesn't have to be a function. It can be an event. Use what you need.
@frosty heron how do I debug Standalone, I'm losing my mind here with these magical issues only appearing outside of PIE
Sorry I only ever debug pie 😦
Tbf I don't know how people attach debugger to instances too
what's your issues ?
Ask around in cpp, they should know.
I've read you can use -game -debug in the command line but didn't seem to do much
If you have PDB's it just works
Cuppa to the rescue
Otherwise you should be able to launch one of the game configs
This would work for stand alone too I suppose?
well for one, a SKM refuses to show up. Also, a weird camera panning issue that causes it to slow down for no reason until restarting the level or tabbing out and back in
PDBs?
It Should™️
Never had to, so cannot verify, but have done this with other programs before
I tried but idk how that helps me see blueprints live lol
Program Debug Database. Maps an address in the executing program to code from the source.
or troubleshoot missing SKMs
Oh, it won't let you see the blueprints
Debugging standlone consists of CPP breakpoints and Unreal Insights pretty much
You won't be able to properly debug a BP graph
fun times
Not as far as I know, at least
any way to debug a missing SKM? or just scour the output log hoping I missed some needle?
I don't suppose you can see callstacks either in bp
Quiet important imo when debugging
Maybe ctrl + f, type the skm. Then hit the binoculars button and examine all code relating to it
aye but it only never shows up in Standalone
Perfectly fine in PIE
and I know the bp is there because I have code that prints the instance
But not sure what exactly happend sorry I never debug in standalone
Have you tried packaging tho?
yeah, they're identical
So in package the skm is missing?
tried running packed game with -game -debug but idk what that's supposed to do
Maybe something to do with cooking?
far as I can tell, I'll do it again and go through the log line by line. I get warnings for missing stuff each time but it's common styles and whatnot - old refs which I can't remove for some reason even with update redirectors
there's also a weird lighting issue. New layer of problems that only exist after cooking. Who'd have thought you unlock a new level of difficulty lol
after i moved the folder to another location in unreal engine i am unable to "fix up" redirectors as the option doesnt exist
the redirector files exist and the "find target" but no "fix"...
It’s called update Redirectors now
it gives me a bunch of redirector files
i tried once the red button and it would corrupt lots of files
Hit the red button
you sure?
Do you have source control?
The functionality is much better in 5.4
I’m saying worst case scenario you revert from source control
But I haven’t had any issues using UpdateRedirectors
The only time you need to worry is when it says referencing assets
I wish they kept the old approach that 4.27.2 had
fixing up redirs was a lot better back then.
Long as you don’t force delete when assets are referenced it’s fine
But even then with the new one it’s ok
this is inside the player controller
For mp, go #multiplayer
my bad, wasnt sure if it belonged in this channel
Anyone know if this is right
the current speed is in MPH and I obvs need to convert this down to CM/s to feed into the spline movement code
I've altered it do this as doing the first screenshot resulted in a mph of 45 was about 0.6 which obvs isn't right
doing whats in second screenshot though I find it's still doesn't seem to move right as I get a really big value
if you're changing position, you need to add your calculated value to your old distance
i have a function to grab an object and now i want to that i can move the grabbed object back and forth with mousewheel up and down, can someone help me with that?
change the relative location of the grabbed object in the Forward direction of the player or camera
Reason I get the speed as well is cause it could change and obvs i need that to be in the movement spline stuff
can you maybe explain this in more detail? i am new to blueprints
not without implementing it myself and at moment I'm tackling something I need to get out the way as been on it for like multiple days
sorry
i see
maybe tommorow I can throw something together 🙂
you got any idea what going on in my situation ?
where is the actor actually getting moved?
i see you calculate the distance, and the next point which which seems to check
so i use a timer to loop call the function that does the stuff
and it loop by delta seconds
right, but you're never actually changing the position of the actor in this script
unless theres more?
i also altered this as I remeber someone saying within another channel to divide the CM/s by delta time to get it down to CM
I do it there
I have a function that grabs the new location from the spline based on the distance along spline value
dividing is wrong i think
this is my trouble bit haha
CM/s * s would give you CM
well i did try MPH * 44.704 -> CM/s * Delta time -> cm
however that didn't have right results the actor shot through the spline super quick
whats your MPH?
45.0 for example
how long is the spline?
it might make total sense for it to be that fast. you're travelling at over 2000 cm per second
if you set your speed to something slower, like 1 MPH, does it look normal?
How can i remove the dof effetc from my character
So if I times the CM/s by Delta time thats what I get
with speed being at 1
seems reasonable but also bit jerky movement which I wouldn't expect tbf if something else is going on
could be caused by variable tickrate
so it seems the issue might be when the speed of the vehicle is sufficent enough and a tick may be skipped over it ends up jumped along the spline
also, why use a timer?
so I could have it seperate from the tick event
any reason to do that?
also without using the tick event, apart from not calling the code unless I need to I don't think so
ticking the max once part per frame box in the timer might fix it?
using tick for things that should be in tick is fine
shall I try it on tick event see what happens ?
sure. also, i'm curious if setting max once per frame would fix it
i think whats happening is that the timer isn't happening on the current frame. so when it executes later, the deltatime is wrong and it will travel at an uneven speed
it's does do something more positive, theres still a little stutter here and there but doesn't seem to do that big jump like it's one place one frame skips frame and ends up further alang
hmm that could possibly be a possiblty
don't even know how i'd solve that tbf
did you put it in tick?
yeah so on tick I think it may run smoother slightly
I'm gonna work on it bit more tommorow but tbf It's decent for now where I can work on it some more
Gonna go to bed I thinks, thank you for the help not sure what we changed to have it not stupidly speed off haha
changed from divide to multiply made the math right.
lowering the speed from something really high made it look normal
moving to tick made the deltaTime accurate
But I had it multpy before I tried the divide
Also I returned the mph to what it was when it wasn't working
I still have it on a timer however we ticked that max once per frame tick
@frosty heron camera panning issue was being caused by Setting Input to Game Mode and UI on Completed pin, which would break the entire functionality henceforth...for some reason...only in cooked/packaged/standalone
Completed in game mode? Which event is that.
no sorry, the SetInput node I had on the IA's Completed pin for my camera panning
now to figure out the missing SKM and the lighting issue 😅
I wonder why this is suddenly named CharacterMesh0 in 5.4, I feel like it didn't have that 0 before. Noticed it in other people's screenshots too
I know the feeling. For a project I was working on, we had an issue where NPC's would just randomly be destroyed. I never found the actual cause. The only way I knew they were being destroyed was because of logs.
I figured they must be clipping through the floor (not sure why) and falling passed the Z kill limit.
I ended up creating a special box that I move NPC's too when not needed and if they fall through, there was a trigger box that caught them and moved them back up. The issues never happened again.
haha, yeah I've heard of these body dumps, used one myself at some point. Luckily, I am making some progress on these issues. From what I can gather, that char class probably doesn't have enough time to fully load in one tick (it's inside a function), given it's done from a soft class ref converted into a hard class ref on the fly.
TBD but an async load before spawning should cover it (though that comes with its own set of ramifications)
Good look. I hope you figure out the cause. I'd love to know when you do. 🙂
well async load doesn't seem to fix it. I'm gonna have to test for bp corruption 😬
With respect to both keyboard and gamepad input, I was wondering if there's anything that's quick and dirty for implementing a cursor tick (read: selection sound effect when navigating the menu system). This is with respect to a widget blueprint, in case it helps.
also, I want to disable the mouse inputs since I'm thinking multiplatform for this.
How do you all handle weapons in an FPS? currently i've my main hud which holds all the data about health ammo and magazines, then a base player unarmed. I've fiddled with the idea of every gun being it's own character but i don't quiet like that. I tried making guns Pawns instead and placing them in the primary player blueprint but i can't really interact with it :/
I'm tryna NOT use pre made examples to learn but ya bois head is stuc
Why would you make a gun a pawn?
Break down what you want. For example, you want a gun, which is an object held by a character, not something you could possess and manipulate. That makes not a character or a pawn. It needs to be in the world which leads you with two options. An actor or a child actor component on the player.
Unfortunately the latter is broken as hell. So it's going to be the former. As for making it so a player can equip it, fortunately your player has components which you can attach actors to.
If your character has a skeletal mesh, you can even attach it to a specific bone on that component.
The only issue remains is interaction, which is a problem as an actor as it doesn't receive input. But let's go back to the requirements for a second. A gun is something controlled by a player character, not the player character itself, so we could handle the input in the player character, or it's controller, and use that to do certain things with the gun, like on mouse press, call a shoot function on the equipped gun. (Think, I move my finger back on the trigger causing the gun to shoot, rather than it shooting by itself)
Heard, switched my test gun to actor, and threw it in my player BP and made it hidden until its pickup model is interacted with - then when clicking i should simply fire my SHOOT event in my shared interface which the blueprints have - and that event will fire in the test guns blueprint, which is now also visible as i interacted with the pick up?
(also thanks for help)
By throw it in the player BP, do you mean by way of the ChildActorComponent? That is the method I described as being broken as hell. It's really sad because it sounds so useful.
The way I'd approach it is this. You have your pickup actor. Once interacted with, the player spawns the actual test gun actor. It then uses the AttachActor node to attach it to your players skeletal mesh, probably on a hand bone. Once this is attached it then sets an EquippedWeapon variable to the reference of the spawned gun.
Then when you fire of your click event, grab the reference to the gun, and call shoot on it. If you use a base class for your weapons, and make the EquippedWeapon variable of that type, you won't need to cast or message an interface or anything like that
🤦🏿♂️ you did say not to use childactor
Interfaces are mainly useful on implementing functionality across unrelated actors, think interacting with chests, people, guns, etc. That's the only common behaviour they share, so an interface makes sense.
When things are closely linked, or apply only to one thing, inheritance is often preferred. Only weapons are going to shoot and reload, and such, so a common base class that has a shoot event, which other weapon classes can subclass and override makes more sense. If you've got some game where tons of things could shoot. Like you could pick up a gun and shoot bullets, or grab a window out of a house and shoot glass panes at people, then an interface would make more sense.
How you going to use the gun actor without interface ?
with the reference
you have a reference to the gun actor by spawning and attaching it
you just call functions on the reference
but you need to cast it first right?
otherwise you will not get the shoot event
EquippedWeapon is only ever going to be of the base type of the weapon.
You can just call the stuff on it
It's worth noting though, an interface is not a cast replacement, nor is it more performant, nor is a cast expensive, if you've heard any of those myths
hummmm, can you explain?
Generally speaking, if you're following tutorials or reading blogs and they use the words "always avoid casting", "Casting is slow", or "Casting is bad and you should use interfaces." Close that shit and find something better, because whoever said/wrote that does not understand what they are even trying to talk about.
Interfaces are for applying logic to otherwise unrelated things.
Perhaps you want to see what faction an item or an enemy belongs to. They share no similarity other than that data, so it doesn't make sense to use a base class. Instead you could use an interface to take any object, and retrieve the faction information from it. The "cost" of a cast is from the hard reference it makes. This can be bad if you're casting to a class with tons of assets, it's gonna load a copy into memory for the duration of the play session. That cost can be mitigated with code only base classes, or accepted with sufficiently small games.
Casting is for behaviour with a well defined hierarchy, My food items are only ever going to do food things. I can cast to my base class and use the functionality. Nothing else is going to do food things so an interface is meaningless.
You can even hit the "casting cost" with an interface. If you use your interface to return a reference of the proper type. E.g. you use an interface to take an actor and return a "Weapon_Pistol" reference, you've hit the casting cost accidentally by way of that hard reference to a class with assets.
Remember: casting is just a type check. You're asking if this generic reference is a more specific type. E.g. is this piece of furniture a chair? If so I want to sit on it
Thank you!!
No worries!
so if you cast to the gun to shoot, is it fine to cast over and over when pressing mouse button?
also if the gun is destroyed or you dropped it and take another one is the first gun will still be loaded ?
absolutely, but in this case it isn't necessary, as we just store a reference to the base class directly.
And no, if the gun is destroyed the reference gets invalidated. Which is a good point, you normally want to check validity (A cast node does this for you if you're casting each time).
The "Loading" I talk about refers to the class default object. Every class has a default object so that you can instantiate new ones and clones and whatnot. This does not strictly apply to blueprints, because that's where assets are handled. The first gun will always be loaded, no matter what after a cast. You just choose what to load. It's not loaded in the sense of "I can still see it on the ground", it's just still in memory
This is an obvious heavy memory penalty if your gun references lots of assets or classes with assets, because then you're also loading said assets into memory, it could be many megabytes of memory for a single gun.
For a code only base class, it's an order of kilobytes, which is negligable. To show you how negligable it is, all I will say is that the engine already does that loading for every single C++ class. It's a lot, but it's negligable. (It's also why you don't want to reference assets directly in C++)
The cost is also negligable for classes with assets if they're going to be loaded anyway
Something like the player character, it doesn't matter as much
But something which isn't always going to be there, like a gun, or an enemy, can be a bit of a bad move sometimes
Frontloading it all can be perfectly valid for really small games though, you'll not encounter any loading hitches in doing so
At the end of the day, it's all design, you choose the method that makes sense for the thing you're doing
I'm not going to make a base class for my character unless I have multiple different player characters.
Weapons and other things I am because of the memory issue, and because I'm going to have multiple variants, so it streamlines creation.
Unrelated things? I'm going to use an interface. The engine uses interfaces for getting an ability system component reference from an actor for example.
is there a way to get components of class somehow?
I wanna get all point lights
point light components* in 1 actor
There is a GetComponentsOfClass function.
Yes, funnily enough it's the node "Get Components By Class" :P
Just drag from any actor reference
Hm, odd 🤔
I think he meant the class/variant part more than the by/of. 😄
well you can spawn actor from class, get all actors of class and now get components by class
i'd use "of" but when you look for it, you get a ton of different functions
but this one is got to be expensive, right?
okey what about get all class of actor
the one that loops through every actor in the level? likely much more expensive
is there a way of unloading something I casted ?
no, again, following proper etiquette, there's no reason to
Not really
Again, more expensive, but still perfectly reasonable to use. In some cases, even perfectly performant on tick, despite the warning
(try not to though, treat it with care and respect)
I never use these things 😂 before
do you also happen to know about replication?
I have asked a question in the multiplayer channel
not an awful lot no, certainly not comfortable enough in my multiplayer knowledge to give advice in good conscience
I want to make a Tower defence co op zombie VR game
do you think I can make it all blueprints? or I need C++?
generally speaking with multiplayer comes C++
especially for things like prediction
I am struggling with client prediction...
that's why i mentioned it :P
its not smooth I don't know why, maybe Its because of the bp?
doubtful
It's quite possible actually
Blueprints are pretty slow for network logic
Bespoke network logic that is
Stutter is common
I really hate c++😢
is there a way I can debug to see where is bottle neck
Unfortunately it's going to be a skill you need to use down the multiplayer road
Unless you're going extremely simple using only built in things, like movement
Oh I know C++ its just i like the visual scripting better
Oh then no worries, you can expose things to bp and just make functions to use in bp
there is one 100 hours multiplayer c++ course I made before, only to know how to do the lag compensation, but I want a solution in the bps
But to find bottlenecks, profile using UnrealInsights
I don't think lag compensation in bp only is going to be possible
it will be the same thing then
the core logic is just a line trace, is that will still make a difference?
the main cost you get from bp is transitioning node to node.
A Bp function to calculate a fibbonacci sequence is much slower than a c++ one because of all the nodes
I'm more on about the prediction side of things. A single line trace on it's own is going to have no noticable benefits
making your lag compensation in C++ will
okey I will try that
Well should at least :P
but still I don't understand why a bp cant be transformed to a C++ code ?
Again, no expert here.
you can manually convert them 🙂
compared to me.
why aren't automatically converted
after build or something
It's an arduous process. Certain things are allowed in BP that aren't in C++.
They used to let you, but it didn't work too well. The community has successfully made an automatic converter that isn't public yet though.
Essentially because of the "illegal moves", Bp sets up a stack frame before moving to each node. Doing this over and over again for each node in the BPVM is slow. But the BP bytecode that is generated when you compile is translatable. You just need to know how, and it wasn't worth Epic persuing
When you use blueprints as intended, there is no reason to do that conversion because there is no slowdown
Blueprints are intended to be an easy to use interface for designers to make gameplay logic.
C++ is meant for the core systems
Of course, you don't have to do things that way. It just means sometimes you compromise and hit negatives
also, everytime something was converted to c++, everything part of that class would always be loaded. every asset. it bloated memory requirements for games iirc
ugh i can definitely see it turning all actor refs into constructor helpers :P
interesting, so there is still hope
i wouldn't rely on it
i feel like a big part of why epic stopped supporting it was because it encourages a bad practice. you're basically making single use c++ classes, whereas they should usually be your framework where everything else is built on
i also can't imagine the performance gain was that significant in most cases?
It depends, it can be very significant
For average gameplay code, no, unless you're targetting some platforms in which case, yes
For something like fluid flux, that has a ton of large blueprints, yes
It will always be less performant than hand written C++ though
It will also always be uglier, you won't be able to understand or maintain it
It's literally translated bytecode with autogenerated names and a mess of includes etc.
I still think replication can be good in blueprints, maybe there is an issue with my code.
or I just make my game offline 😂
Yes, you should prly not attempt multiplayer with bp only
i'm able to spawn it but it doesn't seem to wanna attatch, where'm i wrong?
Unfortunately I have to shoot, try plugging a reference to self in the parent actor
solid, it attatched! not anywhere near the socket but hey.... small victories
nvm fixed that to
o
get the skl mesh and connect it to parent actor
is there a way I can transfer a project from ue 2.5 to 5 ?
this is a misconception, all actors are indexed and get all actors of a class simply returns the indices
it's not costly at all
Cant download from quixel bridge anymore- showing Asset not available in Uasset Format
any solution ? 😮
Little late to the party eh?
Fab is a one-stop destination where you can discover, buy, sell, and share digital assets. Sign up on Fab.com today.
this is in my playerBP, after attatching the gunactor to my socketcomponent. it's reading None, though my smg is referenced in my variables.
I've tried running this through a shared interface and via casting - which failed. I thought this was whaat Cuppa meant but iiiiiii'm thinking i didn't interpret it smoothly
should i be using actor components or somethin?
Morning!
Is there an easy way to remove the innate "cant jump while crouched" setting?
Uncrouch and then Jump
You may have set the SMGVariable as the "BP Veer SMG" type but how did you set the reference to the actual spawned instance you want to shoot?
yeah i thought about doing the same but when i tested it it felt a bit on the slow side for my specific game
Override CanJump
Override CanJump function
and remove the crouched check
Hi guys. I am fiddeling with blueprints for a few weeks now. Currently I am experimenting with scene components. Basically I would like to create one with a collision box and handle ground states with it (GroundHandlerComponent, check ground collision and set true or false) so I can add this ground handler to any pawn and fire events for ground checks. Problem is -> I really cant find any way to add a bounding box to a scene component blueprint. Am I missing anything?
You can't add components to components, not to be confused with attaching a component. You can only add components to actors. Lets say you add component A,B and C to an actor, you can then attach B and C to component A. Be aware, this is only applicable if the component is a child of scene component.
ok, I tried inheriting from Box Collider Component (which is usueally the root of a CharacterActor I think) to have the box collision but I cant find that in the selection list
It's actually a capsule component for the character.
Anyways, using BP only, you can't actually make a child of the various collision components. You've most likely made a child of the box trigger actor. This is just an actor with a collision component inside with a sprite I believe. Because it's an actor, you can't add it to an actor.
ok that would have been my second guess. Problem is that I need to do some casting on begin play with this approach. (component -> childActor -> castToGroundHandler -> bind events)
So scene components are not really meant to be used with colliders if I get that right
Personally, I would use traces instead of a collision volume. This can all be handled from an actor component and be placed onto actors. You can then have event dispatchers on the actor component that the owner can bind to. (right click on the component and add them from the add event option)
Hi, i’m developing my game and I have a a problem which i can not solve. When I hit the play button my ThirdPersonCharacter spawns in the middle of nowhere. First it falls and after 3 seconds it disappears
Hey, guys.
I want to play a video file on a plane in my level. It works well with the media player and the media texture and the material. However, the video is darker than the original and also the resolution seems smaller. How can I ensure it looks on the plane just like the original?
Another question, I am working with the "SuperGridStarterPack" right now, If I add some assets in a part of the level that I created some materials on the assets are going black. Even after building light... Why is that?
I'm using UE 4.27^^
Try changing your material to something like Unlit if it's not already.
hey,
I have a bug.
when a grenade explodes while the player is facing away and in the air, he doesn't get registered as a hit from the line trace.. any idea why that happens?
ok i will
to slow mo, use global time dilation
to show collision, open console and type, show Collision
to eject from controller, hit that triangle next to the stop button
btw, i tried to pause when the line trace happend, it does look like the trace happend just right below his foot
you're right
you are looking at the bones tho, not the collision
how can i make it target the collision instead of the mesh?
Try, instead of using the forward vector of the rotation, use xvector instead.
i'll try
you can just set the capsule component collision settings to overlap the line trace channel
or if you want to be more accurate and use the skeletal mesh collision, then you have to setup physic assets.
but I think default Unreal mannequin already comes with one
i can also maybe make the line trace go to the spine 3 bone instead of the center of the character
it gives the same result
not using radial instead?
it's a grenade
use a sphere component to detect hit instead?
i want a line trace to detect an object between the grenade and the player
if an object blocks it first, the player will not get damaged
that's fine, personally I would use both
i do use sphere overlap actors
He is essentialy using both already
The sphere overlap actors function may as well be a sphere componet
i guess i can make it so that if the line trace does not hit anything, the player gets exploded anyways because it is opened directly to the grenade's explosion
at the top of my head, I was thingking to just use the line trace as an additional check if there is like a wall inbetween the player and the grenade
you don't want your player to die, when the grenade is at the otherside of the wall
that currently happens
Im wondering what you colliding with exactly, what component? Your line trace is tracing the visibility channel, you may be colliding with the players mesh, and not the capsule component.
It looks as if the linetrace is going through his legs
Can you print the name of the Hit compnet
yea it does
for your second linetrace?
it hits the mesh
Yea thats the issue