#blueprint
402296 messages ยท Page 820 of 403
this is basically part of rigging process
you telling what bones influence what parts
for weapons probably yeah
they're not too difficult tho, as it's a mechanical thing
and for the rest ?
as I mentioned before, Mixamo has some decent character animations
https://www.mixamo.com/#/
@timber knoll I have 1 blueprint, that I can change to be 4 different types of dice (only 3 types are being used at the moment) Each die has unique faces and location in the map, 9 of each in a tic tac toe arrangement. 2 Teams (currently). All of the information of what was rolled, where it goes on the tic tac toe board, what type of dye. Everything is sent to my widget to update what you see on the widget. Im trying to get the information to correlate to update the widget with a texture of what was rolled. Ive done it already but it ends up being an infinite set of enums that I have to change like 1 thing on each of them
but depending on your needs you might need to do some custom ones as well
yes but it isn't for the hands
what do you mean by just hands?
you want reload/shoot hand animations for FPS arms only?
that will have to fit your weapon, so either IK setup or custom animations there
yes
ok
and how do i do to have 2 different cameras
like in fps mode i see only the hands but only the character shadow, and then when i switch tps camera i see al the character
@chilly geyser I think you wanna look into data assets or tables. You basically want each die to know what it's state and position are so it can pass the desired information directly to the widget without all those enums.
google UE4 data assets/ data tables will get it done?
Will get you started
thanks
well then you don't need only hands animation ๐
then you need a full animated character
yes :/
because then how do i do
there is no other choise right ?
Can somebody help me. I am trying to make a new location with the loop but it makes only the 1. target. How can I do it for as much targets as I have?
how can I call an interface event inside a Widget from my pawn? I only managed by casting ๐ฆ
Hey yall, quick question. Is it more efficient for a pawn to cast to all actors of a class or have every BP instance cast and get a ref of the pawn?
Usually just like any other interface via the message version of the function
Make sure your widget implements it though
Yes message but without target?
Why without target ? The widget is the target ?
yes the widget is the target
Oh lol
call a function from pawn to widget ๐
I am generally confused
If I cast and create a reference to the widget it works....but it's what I want to avoid ๐ of course
you need some reference to the widget
And typically widgets are player bound, so getting and storing a reference is .. the way to go about it ?
Atleast thats how i see it
preferably not in the pawn directly but it'd work aswell
the best would be from the player controller ?
"best "is relative
playercontroller is pretty commonly used
that or the hud class
both easily accessible
because I handle its spawn and stuff from there...but since I'm using widgets with animations on score and stuff....I still don't know where the 'best' yet
You'd probably want a dispatcher in the pawn
which the widget would simply bind to
ofcourse, it still requires a reference at some level
exactly...haha I'm trapped
Just cast it. Read up on why casts can be bad, donโt just assume they are.
in my case it's not bad, because it's already loaded I guess...I wanted to understand more about interfaces and play with it around
Will you use this interface event more than one place?
nope
If it's already loaded, then Cast
Just cast it. You defeat the purpose of interface if you just use it once
I currently have a pawn that Id like to allow to pass through certain actor bps on key press. So to turn the collision off on the actor bps would it be more efficient to: cast to all objects within a class (turning off their collision) inside the character bp or pass a var to the actors by casting to the character in the actor bps. I hope that clears it up a bit. I apologize if it isnt, I'm still fairly new.
Just be sure to not have a rabbit hole of casts leading to one another
Ye in general my question was like...how to get a reference like in this case, I don't have any performance issues, just to know more ๐
but thank you guys!
You can do a GetAllActorsFrom(?)Class if the list amount of actors do not change ( they exist all the time )
If they change and get spawned having each collider registering itself on the player is safer ( it resembles more a system design )
In speed terms, it is difficult and profiling is your friend
If you would have cpp knowledge such things are a good use case for subsystems to decouple the logic from your player though
Sounds like a scenario for a dispatcher really
If its turning of the collision on all of the desired actors at once
A manager can easily become handy as well
Dispatcher seems a bit bloated for direct messaging but yeah ofc you can bind to one
Yeah it is, wasnt sure if they ment 1 to 1 or 1 to all
But it makes control flow harder to read, but I guess that is personal preference
From what I understood it was 1 to All
1 pawn to All ASomespecialCollider
Thats correct, it from 1 to all
how do I make it so my wallrunning character jumps off if its moving too slow?
I appreciate yall, I got a lot to google now.
using dispatcher for my global "toggleborder" command as an example
it also jumps off after 2 seconds as you can see
So I can easily just broadcast the message to whoever i've decided needs to react to it
Interfaces are useful in like an interaction system. You donโt want every interactable actor to be derived from the same class, so you create an interface to communicate with the other classes
^ I usually do everything from a master class instead of interface, but I can definitely see scenarios where that makes things... difficult.
- i have an inventory, and when i delete a stackable item it works great, but when i delete a non stackable item it delete all the items of that class.
- i think it is related to this photo, how can i delete just one item from an array instead of all items of the same class
Doesnโt sound so scalable, especially with a interaction system.
Well the top dog really just works as an interface
Just has the desired functions and close to 0 variables by default
Like in our game we have a power outlet that is custom static mesh component. That we can place on anything and it can be interacted, it has the interface in it, so with your system you erase the possibility of component interaction.
There are really only benefits running an interface instead of a parent class.
For interaction atleast
I did an interaction compoment in a project aswell, felt more flexible compared to a parent class.
Using an interface in my latest project, but i keep walking back and forth on what it should do and handle
We donโt use the interaction component.
No, we donโt use any component for our interaction system.
What I was saying we can interact both with actors and components. We first check if the component we hit has an interface, if not, check the actor.
Ah
The power outlet can be placed on a plant, and you can suddenly drag out a cable from a plant.
I see i see
why this no work?
I just watched a video on Data tables and assets, It says you cannot set the values only get values from it. I can minimize some of the code but ill still need some of those values to change pending on what was rolled. Ill see if I can figure something out. Do you have any other suggestions on something I should learn to help do this better?
when i make an actor that is a ball with simulated physics
and it falls down and hits the ground
how can i get that? 
like in unity you have OnCollision();
Can you show the code of your Remove Array Element function?
there should be an option on the actor that you can just click simulate physics in the details panel
sure but i want to play a sound effect and spawn a little VFX emitter when it hits the ground
i wanna have like the signal when it collides
add a blueprint with event on overlap or event on whatever youre trying to do
You have a table/asset with all the info you need and read from it, and do your logic based on it.
So if you need a particular image in the widget to show the position of a dye, you have that position correspond to the index you want in that dye's array of ui images
It's just a way to organize and access data quickly. You shouldn't need to change any of the information about the dye on the data table/asset, just update It's current state
Here are my editable variables that I currently have
I'm trying to envision what you're saying and how I would do it. Might take me a minute.
(in green correct calculations, in red unreal's calculations)
UI can't use Timelines, as they're ActorComponents
@trim matrix Consider using the GetRealTime node when you start the cooldown. Save a float as GetRealTime+CooldownTime=SavedFloat. In the widget's tick function you can just do SavedFloat-GetRealTime to get the remaining duration of the cooldown.
nevermind I had lost a node in the forest
hmmm so it seems like ActorBeginOverlap works, but only on other actors 
and not on the floor
What are you trying to overlap the floor with?
hey guys, so I imported a working car to another map. But now for some reason some input buttons are not working - W and A. S and D work perfectly
why could W and A not be working?
@dawn gazelle this is the code for the remove array function.
how can i make it remove only one item from the array instead of all item of the same class
can someone help me with a drag and drop thing,
use RemoveIndex, but you need to figure out the index
Ok, so the issue is that using an "item" to try and remove from an array of structures is finnicky - you have to have the exact data within that structure. If you have more than one of that item, you'll end up removing them all, there's no way around that. It's probably working ok right now for your stackable items, but once you have two stacks with the same quantity of item, I imagine you'll run into the problem with that too. Instead, you may want to consider removing items from your array based on index of the item you're looking to remove rather than the structure of the item.
This is on my on Drop in the storage slots for something like a chest.
as you can see there's a Component Move Item.
im so confused haha
This runs on the drop comeing from the third person char. Then it runs a Move Item in the inventory component.
An example, if you have a slot-style inventory, each one of those slots would exist as a reference to an index of the inventory array. When you perform say a drag operation, you would store the index of the slot you began dragging from. The drop function to trash the item, you would pass through the slot # of the inventory. Then when you want to remove the item from the inventory, you just remove the item at the index. Your array will still stay the same size, just you're saying remove whatever is at index #.
Last part. This is what happens and should happen, I don't think it setup right.
This should add the item(s) to the storage and remove them from the players slots. I keep getting a false return on.
i dont know how to add the index thing to my item or to the version of inventory i made from the tutorial
This is what should do the add to storage.
The item itself doesn't need to know the index. The index is just a spot you want to point to within the inventory array.
Any UI you may be using shouldn't be storing the item info for example - they would only store the index of item stored in your inventory array.
Your UI can read the item that resides in your inventory array by the index.
my inventory slots are an array so i dont know witch one holds what
is it possible if i stream and show you my inventory setup and you can show me what to do if you have time of course.
Are you still asking about this?
yes
well i was using static meshes, forgot to activate the button tho 
There is. It works the same as C++. It removes all instances of matching structs.
Okay. Does what you posted above work, but it removes too many things?
it works on stackables and remove only one item but when the item is non stackable it remove all items with the same class
like hp potion isnt stackable and i have 5 when i remove 1 all are gone
Yeah, cause all of their data matches. So if you Find the index of the first one and remove just that instead of all five, it works.
its like its not just emptying a slot but all teh slots that have that same item
Remove will remove all structs from the array that match your input.
RemoveIndex only removes that specific index.
how can i add an index to an item
Why would you?
how can the array know the index if the item doesnt have one
sorry if i asked something confusing
Go here.
Drag off of your Array and type Find.
Drag off of the Array again and type RemoveIndex.
Set it up like this.
you have no idea how bad this made me feel i was considering watching and making a new invetory system but its working now.
thank you all so much you're life savers
do i need to do the same thing to add or just when removing ?
Hi, So I have this problem that prob is simple to solve but I just cant figure it out, basically I tried to make a stamina system and as long as I had stamina a while loop will deduct stamina at a certain rate per second, but I get after like a second of running a infinite loop error what do I do to fix this or get something alternative for while that repeat doing this?
Use a timer to deduct the stamina.
i used a timer to call for the function that does the decreasing
What is happening though - you don't have an exit condition for the while loop. So, the loop will run forever.
and inside it i put a branch to only decrease if its above 0 so it will stop there
While loops are traps.
Hey yo! I created a custom Scene Component where I want to display a Static Mesh.
Is there any way for me to display something in the editor just for game designers?
As you can see, it shows nothing (as expected) - but I'd like to be able to display something in there โ๏ธ
Clues?
No necessarily just in the viewport, but also when looking at the world before game... there's a checkmark you can check on components "Hidden in Game"
ie. I have these displayed, but they don't show when the game is started.
I'll just inherit my Scene Component from a Skeletal Component
I think I expressed myself incorrectly, @dawn gazelle
I created a scene component as shown:
@winter garnet https://github.com/xyahh/UE4RuntimeTransformer
And as you can see, there's nothing being displayed
The widget where you are doing the cooldown thing.
Oh. Whoa. Wait. This is for gameplay code?
Why do you want the Barrage Cooldown to not be affected by time dialation?
This definitely should not be handled in a Widget. If you want the same thing, I recommend doing that same thing in the Character's Tick function instead of the Widget.
Yeah, but Widgets should not handle gameplay code, they should just display what is happening. Your character should handle it's own cooldown logic.
Right. And you want this cooldown to not be affected by time dialation, right?
Then you'll need to change that timer in the Character to a tick function. Or a Timeline as someone suggested earlier with IgnoreTimeDilation checked.
Yeah.
Timer is entirely useless here. You're looking to set a float of RealTime+CooldownTime, and then you check on tick if that set float - real time is <= 0. If it is, then your cooldown is done.
Tick runs once per frame drawn to screen. It's DeltaTime will be modified by the time dilation, but the event will still run just as often. So if you're not using the DeltaTime, you can still use it for non time dilated stuff like checking your float against RealTime.
@trim matrixYeah, and in all reality, you might not even need Tick.
Widget can use Default and Remaining time to get it's data for display. Other code can use the IsBarrageAvailable.
Completely time dilation independent.
Btw would advise putting a Max(x,0) behind calculating the remaining time
Custom function.
This
I fount out that the issue I'm having is in the inventory types. I can get the info on what item is getting dragged and from Where. How do I set where it's going too. Whats the destanation of the item. Or Direction.
Is there anyway I can check if the engine culling is working for the instanced static meshes that I'm spawning? The amount of meshes is large but only 1-5 are ever on screen, but there is a considerable performance hit, and I'm suspecting the ones off-screen are not being culled
What is a considerable amount of meshes?
I dont even actually know how many there are, probably a couple hundred
The performance hit is not noticable on PC but it is on mobile
Each one is around 4k triangles but I just figured it would be fine since only 1-5 are ever on screen
Well, the logic still applies. You can set the cooldown where ever you like, such as at the beginning of the hold or after it ends or halfway through on button release if that stops it, etc.
I made a level system, kind of standard, but I want the levels to be represented by names not numbers, how could I make the numbers become names (of my choice)?
Can use a data table. Then query that data table.
I tried to use array, but it didn't work very well, the level 1 got all names from the array and the other levels had no names at all
oh ok, thx ,3
Its not the containers fault^
โค๏ธ
Its flawed logic..
so I got an issue. On the first row, the cast to Main_PS works as it should. On the second row, the cast to Main_PS fails. Anyone know why and how I can fix this?
Have to create it yourself.
You have to create it yourself. Click the function and add an Output, or drag from the minus node and drop it on the return node.
\
what's the input of the forEach loop?
a array of player controllers
Definitely need to ditch the idea of using controllers to identify players.
GameState->PlayerArray houses all playerstates in the game. You can get a list of players from there much easier than controllers and on any machine. And if the controller of that player is necessary, you can call GetOwner->CastToPlayerController
so you can get a player controller from a player state>
regarding player controllers, does someone know if there are cases where more than the pc0 exists on a singleplayer game? e.g. with VR Controllers or Gamepad connected
or does unreal wrap them all on the same playercontroller?
so you can get a player controller from a player state>
Player Controller owns the playerstate. So you can get it from GetOwner and casting it.
awesome the playerstates work
ive got a little question. so when i press 1-3 the character design changes. everything good. but if the player press 1 (he got the first character) he should not be able to press 1 again because he has already this char. when i press 2 he get another char und then you can switch back to 1st char. how can i code that in blueprint?
Hi, I'm appending some strings together in a UI Function and I need line breaks. I've used "shift-return" in other blueprints before but it doesn't work in the UI function (where I bind the function to a text object). Anyone know how I could do this? I suppose I could get the "shift-return" string as a reference. But if you know a better way please let me know. Thanks
How could I set a Map value by key?
so like he cant press 1 if its already "selected" because there is a effect that pops up every time
he cant press 1 if its already "selected"
I've highlighted the important part in your statement.
Use a variable and track which character he has. Then check if that character is already being used and if it's not being used then continue.
Generally speaking - if you just talk out loud the logic, you will arrive to your answer.
I've got this BP that's just a scene root and a plane mesh, and the problem is, I can't select it in the level editor. Clicking just selects whatever object is behind it.
What's the best way to make an object like this clickable?
Grab it from the world outliner instead
I have to keyword search it each time then because there's so much shit in my level
That's exactly what I'm trying to avoid
How often are you moving it?
Well, I'm deleting it and replacing it a lot as I'm making it, once that's done I've got the 4 child versions of it to place in level, each of those will probably have to be corrected at least once probably twice. That's just my test level though, it'll all repeat when I make the actual game level they're in
So probably like... 20-30 times, minimum.
Some stuff like lights, volumes, etc.. are just easier to grab from the the outliner. You can add a 3d mesh above it in the BP or something as a handle while building but I really don't think you can make it more sensitive to selection in general
Heyyy! I am wondering how could i make for each loop for array with make array? Any ideas
Like that?
but it doesn't work , i want to make for every target the same thing. Right now is doing only for the 1. target
i would like to make it for as much actors as i want
No, you're definitely doing that for all three. Your issue is that you're doing it for every component all three times.
Hi everyone, is there a way to spawn a textbox widget with text in it and all the text is already selected (something like a "ctrl + a" after focusing the widget), like the player has just to type to override the existing text
Oh yes sorry did not see the channel, thanks
are you able to discuss this now?
Is there any way to prevent UObjects from being garbage collected other than assigning them to variables?
That is the entire basis of the garbage collection system, so no.
Out of curiosity. What are you trying to do with UObjects that you wouldn't want to put them in variables?
nevermind, got it
@maiden wadi
Pretty much I have an object called StartMatch (yes, not a noun) that when initiated, it displays an (async) countdown of 5 seconds before actually starting the match. Sometimes the GC was collecting it before the countdown finishes, so...
But I fixed it by creating a Set of Objects to temporarily prevent from GC on GameInstance.
Can i use the scroll wheel for inputs?
Any reason you don't just use a widget or something you could throw away?
@winter garnet some object flags like ASYNC prevent it
maybe also RF_Standalone (not sure about it tho)
but the Set might be better as you can keep track of them, and you can purge them all easily
the player is starting with the start player and not with its pawn, how do I solve this?
how do you smotth floats?
????????
Change it in the gamemode
How do you smooth out floats?
it's already set but it still doesn't work
Idk what that means. "Smooth out floats"
The gamemode is set in the project settings or world settings?
instead of the mgoing from o to 1 immediently, you could interpolate between the m to make them smooth
disable these options
Not what that is called..
Those are snapping options
Which one is it set in?
Project or world settings?
Thats world settings
In this case the player in the level must be set to auto possess player 0.
ok how?
Look at the pawn properties
Open the player blueprint, under the class defaults in the pawn section
YES
Set auto possess disabled
thank you so much guys
does anyone know how to rotate a vector to align with a normal
you can convert a vector to a rotator, and then use that rotator to rotate the other vector
how do you do that in blueprint
Just multiply the normal by the vectors magnitude
Tada, the vector is now aligned with normal
The progress bar widget doesn't even exist?
You gotta be specific. When you say the bar doesn't appear at all, what do you mean?
Place a breakpoint in the widget BP where it fetches the CD duration and check where it's breaking
Are you sure or is it just filled to 0 percent?
I bet it had a transparent background.
Just start putting breakpoints all over and figure out where it's broken
Start with printing the value on the character to see if it's even working over there.
No errors doesnt mean working
breakpoints help you step through code to see where it goes wrong
It means you need to dig around your code and use print strings and break points to figure out what the hell is different between this cooldown and your other three cooldowns
Hello everyone! What's the best way to see where/how a function graph is called? When I "Find References" with right-click, the only result is the function itself
@turbid cedar there's a button to search for references in other blueprints as well
@trim matrix do you want cool Downs to slow down or not when time dilation happens?
For game design, I would want the cooldowns to respect the time stopping
ctrl shift f
yeah cause otherwise you could just slow down time and spam it
There should be an option in the right side that says something like 'in all blueprints' with a goggles icon @turbid cedar
fair enough ill take your word on that
By the way you can get game time ignoring time dilation
but you still need to use breakpoints to find out exactly where things are going as unexpected
If anyone else needs to know, you can search all blueprints with this button here
damn didnt know that ty
ok
so progress bars only work from 0 to 1
so at 4 till 1, its gonna be full
then its gonna jump to empty
Ding ding ding we have a winner
been there done that
what specifically isnt working now
step through it, see at which node things go wrong
breakpoints help you visualise what happens piece by piece
cause it happens waaaay too fast at runtime
Show how you tell the bar it's fill percentage.
Nope it's not that.
Show where you set the bar fill amount
Probably in some widget
That looks like it isnt being normalized to go between 1 and 0
you can still manually set a float above that value
but im not sure why
Is it possible to bend a skyscraper mesh during runtime in any way in UE4/UE5?
@trim matrix divide time by max time to get the 0-1 range
And you still have not showed where you set the bar fill amount
Percentage always requires a division.... 1 / 1 = 1 = 100%. 6/6 = 1 = 100%. 2/6 = 0.33333 = 33%
Current value / Max value
Is there any "Need to know" when using this method to spawn an actor from an UObject?
anyone in that can help with a drag and drop.
Just ask the question. Unless that was the question
could anyone tell me what is the '0' on the B input in this image?
when you drag something from like the players inventory and then you want to drop something, (Like into a chest). How does it know where it's getting dropped at.
might be better off in #graphics
ok, I'll try in there
Is it possible to set the parameters in a material from blueprints?
You use the OnDrop function in the widget that is receiving the drop operation.
Yes, that tells me where the drop is coming from. what tells it where's it's going.
Is there a way to change an UObject outer from BPs?
@dawn gazelle
The thing receiving the drop operation is the thing where it went.
so if I hold the drop over, like the chest. That's tells the on drop detected where's it's going. Is that right
Press hold mouse -> OnDrag -> Create Drop Operation -> Move to other widget -> Release Mouse -> On Drop on Receiving Widget is fired
ok, some where this info is hidden. any idea how I can get this info. or to set variables to it.
What info?
The drag and drop operation itself?
No, I mean the info on where the on drop is dropping the item at.
When you're letting go of the mouse, the thing receiving the drop would fire its OnDrop function. You handle the drop in that object, whatever it may be.
You can cast to different classes of operations and only process the ones that it's meant to handle too.
If you wanted to pass data back, then your operation would need to pass a reference to the thing where the drag originated from, and the OnDrop on the receiver could then call a function on the source widget referencing itself as the thing where it got dropped.
ok, well sorry I don't under stand what your saying. How ever I did get it to work from what your saying. That's just a little hard to understand. Thank you
No worries, it's a bit hard to explain @_@
Yes, it is hard to do too.
This doesn't work the way it should work.
I need a simple sample of just how to do this. anyone know of a video. Something like pickups get added to the inventory (Player). Then you drag and drop them into a 2nd inventory. (Chest). Any ideas.
I have the following classes Foo Bar (child of Foo) ChildOfBar
Foo has a component, if I modify things on the details panel of this component I can still edit the component through Bar but the details panel is empty for that component in ChildOfBar is this normal?
I've had the one where it says I don't have the input pin I just made.
Resetting the editor usually fixes it
That's odd. You can try deleting the generated project files (intermediate, saved, the other one i forget) and let the engine regenerate everything
Can a player have both an AI controller AND a controller with WASD movement? I'm trying to make it so that the player can move with WASD, or automatically move to certain characters (enemies/friendlies) and either start attacking or open a menu on LClick
Can I get a Variable for World in ue4?
And would like my variable to be a dropdown to pick from levels I've made
Hey guys, currently trying to get a little health bar on my widget component and it isn't showing up whatsoever. It does show when its set to world space, but screenspace just doesn't work. I'm on 4.27
Are you ever adding to viewport?
Normally I never had to do that for widget components. I am starting to discover its based on when my character spawns in.
Basically my setup consists of choosing a class, and then spawning, which means the main player doesn't actually see it, this apparently makes it so the spawned class doesn't see it either.
If you're adding to screen space then you have to tell it which screen and add it
Alright, I'll give that a go
3d widgets in world space already have it added to the widget component directly
Ooh, I see.
Ahhh okay, yeah that worked. I was trying to reference my old Tower defense game that used this same method, except the enemies were spawned after the player was, so thats why it worked fine there.
-Im new ish to unreal engine and I have a Issue
So I have A Sword Class blueprint that is responsible for my taking and doing damage components in a few places. I'm wondering what the best way to make is so It casts the weapon that is in use Because right now it only casts to default sword
2 examples
For further explanation, If I duplicate this class and use it
it does not work Because its is not specifically the DefaultSword class
Should I make a parent class and cast to the whole class
and make the weapons the childen
-I hope my problem makes sense
yep exactly
Im gonna need to figure that out
You want a BP interface call from the weapon to the hit component and use that to pass the damage of the current weapon and do whatever
You can do the casting route as long as the info you wanna access is also part of the parent class
So having a damage value for each weapon would not work as part of the child class
- So would the logic for the, lets say weapon pick up need to be in the Parent class and that just gets inherited to the child
Also blueprint interfaces confuse the hell out of me
What
Parent class can be called MasterWeapon
On master weapon, you have a variable called WeaponDamage
Now every child of MasterWeapon has the WeaponDamage variable automaticly
you know I make a Child class of the blueprint and the variables were not their
You do not need them if you dont want to use them
I get generally the info I need tho
Hopefully I can string it together tomorrow
thanks
Damn
Is it ok if I DM you? I've compiled a bunch of blueprints for you on blueprintue and don't want to jam up this channel with a huge post.
just sent a friend request
That's at least 3 concepts. I would build things in this order.
- Inventory Component that can store items.
- Functions to remove and add or transfer items between InventoryComponents
- Drag and drop functionality that just calls the function made in step 2.
Don't start with the UI until you have the interface for the UI to interact with.
That's why I always cringe out of my skull when I see a tutorial starting with UI. Start with your data, then add your behavior, then add fluff/UI/UX
having trouble getting my projectile damage to work
this is what should be run when the projectile hits my character
^theres my projectile code
ive tried so many things and been stuck for days and just havent been able to get a read out from the print string
hey quick question, does a pawn have to be possessed to use the AddMovementInput node?
believe so?
that looks right... that is: Overlap > Switch Has Auth > Cast > IsValid. What's the collision setup?
overlap all?
does your overlap event ever execute?
yeah a lot of the strings execute
let me guess
let me see
alright thx, just checking
put a pawn on the level, put AddMovementInput on its Tick
its not a difficult test
that never gets fired
I have it's not working
but it's not possessed so i'm double checking before I try that,,,
it should print 20 in dark blue but nothing happens
also this is its spawn in the character bp
projectiles aren't one of the classes that can typically send RPCs
only objects owned directly by a player controller can send or receive client RPCs
hmmmm
if you try with an object that doesn't fit that constraint, you'll get a "No owning connection for..." warning in the output log
for a listen server host though, that shouldn't matter
yeah and didnt work on listen server nor on my ai
so the damage node doesnt fire
but everything before and after does
you also have a wrong wire connected to DamagedActor
it shouldnt be other actor?
you connected get owner
dafuq
well it dont work either way lol
prints both of my strings in the projectile bp
i should add that the damage system works fine with a sword blue print that i have
that is dedicated server running
switch to Play as Listen Server
then try shooting with the host
oh i switched it back to Dedicated. i did the listen host didnt work
generally
you want to send RPCs through an object owned by the PC
so it only works when sent by the owner of the listen server how do i fix that
your PlayerController, PlayerState, PlayerPawn or anything that had owner assigned as any of those
you do have a weapon actor?
i have a sword actor yeah?
this is a magic fireball projectile tho
well, if you move the server deal damage event inside say Pawn
your third person character
then access it from the projectile and call it on the Pawn
it will work
as Pawn can send RPCs
oh thats smart
so use the get player pawn
call the event?
uh no
you should stay away from those GetPlayerSomething[Index} functions
there is another thing
overlaps happen on server and client
the moment your overlap handler passes through that HasAuthority check
your execution is server side only
so you don't need RPC to start with
you can just connect ApplyDamage to the end of that overlap handler
ok so i just connect the begin overlap directly to the apply damage node?
im just a lil confused
how would I make a trigger notice an object as a player?
i do believe you did break your projectile spawning a little too though
as your logs past the switch authority should never start with Client 1
unless that client spawned the projectiles locally
it did
in which case it has authority over them, but they aren't replicated in any way
my client spawns them i believe
HasAuthority != IsServer
yeah
you'll want to calculate the projectile location and trajectory
then RPC that to server
and let server spawn them, replicated
its not an approach i would consider for a production level game
ok so im still confuzzled. what do i change to my code to make it work
yeah this is just a prototype
InputActionAttack -> you calculate the position and velocity of the projectile -> you send a Server RPC with that information -> Server RPC spawns the projectile
and then the damage should work correcto?
yes
why is this bad for a production level game
Lag
The projectile won't appear on the clients screen until the rpc makes it to the server and the replicated projectile makes it back.
and then client ping on top of that
got it
thx
Well that IS client ping but yeah.
Ping + processing
i meant shit internet kind
So probably ping + a frame
how would I make a trigger notice an object as a player?
On overlap, cast overlapping actor to YourPlayerPawnClass
hi guys , Why Get Actor Forward Vector giving me a forward vector in Local space ? definition says it gives you in World space
Value is always (1,0,0) no matter you move it , or rotate it
should be (1,0,0) in relation to the actor
that would be it's facing direction in world space
Alright , Thanks Very much !!
could some show me how to cast overlapping actor to YourPlayerPawnClass on overlap
Can a player have an AI controller and a normal controller (WASD on the keyboard to move) at the same time?
Hy can ayone help me i want to launch my character where my line trace end
Start with Suggest Projectile Velocity and Launch Character
hey guys anyone knows how to make a single key toggle between multiple custom events ? what I did doesnt work because it calls both of them at the same time, and I want it that each time I press they key it toggles between them
i.e: Press "change time of day" once, it fires of the "dusk" event, press it again and it fires the "night" event and so on
Flipflop
or a switch on byte/int where you increment and reset it at your discretion
if its just two events then flipflop
DOH
i knew it, i just forgot the name >< thanks so much man!!
@gentle urchin thanks so much
I had brain lag
No problem!
You can also make an enum and the switch on that enum. Its useful if you dont wanna have to remember which time is 0 and which time is 1 etc
Good point^
Im so used to not having enums in my dayjob that i tend to forget about them ๐คฃ
erm Dart maybe lol but dunno if it's used for games
as far as I know, maybe they've introduced them now!
programming languages for logic controllers based on older IEC standards
Not sure when Enum was actually added to the supported data types in IEC 61131-3, but it doesn't exist in GX 7, but does in Codesys 3.5 atleast
when I was in Finland we had to use (and still have to use) a programming language that is completely dead, but the elevators there in small towns only use that language. There is no support page, no nothing since at least the 80s or something lol. So that's another language still in use which probably doesn't have 90% of features available today haha
Morning peeps, looking for some help. Wondering why my Main Menu UI won't remove itself once I load into the next level after clicking "Enter" on the widget. It's a basic menu at the moment, so I didn't expect to run into this problem. Main Menu lvl uses basic game mode with no overrides, and the Alpha Level uses Main Game GM, so my game's UI appears but the Main Menu UI itself doesn't disappear
Widgets gets cleared on Open level,
so no need to explicitly remove it
It sounds like its being created again in the new level
Yea that's what it looks like... I removed the Remove from parent node n the problem persists. I don't have any code for this UI in my player character so idk where else to look xS
Right click the create widget node , find all references
Then clikc the binocular on the right side of the search bar
Should give you all create widget events , if there are several..
If not double check that you're using the right classes..in the gm
Wait what do you mean by main ui shows, but not mainmenu ui?
Perhaps i misread the post ๐
Mainmenu levelbp spawns a widget , which might be the game ui ?
Makes more sense if its main menu widget, so i guess thats what it is
Cant see which bp your code resides within
I have code in the uh, main menu lvl to spawn the UI, then obv the code in the UI BP itself to close it once i hit enter
just the player HUD as far as I'm aware, I'll revisit it in a sec here
Oh uh... yea character UI, esc menu and inventory so far
it's my first project lol so going with basics
Yea i just checked them, they all call the proper widgets with no random references to this other UI
Should I not use begin play in the level to create the widget?
Add a print message
That says "i got created now"
See if it triggers again after open level
alright one sec
yep, something's going on. the string prints when the alpha level loads
Now to source the culprit...
I was thinking maybe the game modes but I checked. Just a default game mode used in main menu lvl and the only thing changed in the alpha level for game mode is the player character
is it normal that on a new empty level (I litterally just created the landscape and set a directional light) I have 64 unbuilt objects???
ah my bad ๐ I thought it was counting in a different way thanks!
on an empty level, with no game mode or stuff when I hit simulate the engine crashes, what could cause this?
Is there a way i can hit a key to export the last 5 seconds of gameplay as mp4?
In editor or in runtime?
at run time
im looking for a way to facilitate early player feedback
and take my own clips for trailers at runtime ๐
if i do something like this, will the condition read the updated value each time, or it will keep the same boolean state that was read the first time?
Well, since putting editor code isn't really allowed for shipping, you'd have to go the C++ way and using third party libs (FFmpeg seem to be a good choice) to assemble videos from frame renders of demorec, and if necessary, record the audio in separate pass
each node is real time afaik @spice smelt id expect that to update. have you tried printing out inside the loop to check?
when in doubt, print everything ๐
does the condition ever stop?
but didn't get stuck so not sure if infinite loop or just unreal being unreal
wdym?
just set it to false and run it again.
if it doesnt crash, then the loop is crashing it
condition for the branch, infinite loop as you said
ay ok infinite loop confirmed ๐
@icy dragon ok thanks! I'll look into it. familiar with ffmpeg but not so much C++ ๐
(sorry for confusion there)
lol somehow i forgot the while node exists, problem solved ๐
Hey I have a problem with removing foliage instances, or changing the transform of instances. I have it working, but I get a lot of lag when there is a lot of meshes (grass in my case) and I harvest one at runtime. Its exactly the same issue as this guy. https://answers.unrealengine.com/questions/464484/view.html
but the only answers are from 2016-2018 and they seem to be that there is no answer. Is there any updates on this?
Anybody know if there's a way to default to opening blueprints in the Full Blueprint Editor? I'm getting tired of it starting in data only mode every single time ๐
Hi everyone, I have an issue regarding widgets. I build a search character widget that needs to be accessed from other widgets across the game, I thought the solution to that would be to just add the search char widget as a child of the others and access it from there, but the search char widget contains instantiated buttons that need to add text to the search widget. They populate their scroll box ok, but when clicked, the button throws an error saying it can't access the widget.
Using V.26.2. Any help on this will be greatly appreciated, I've been struggling with this for two days now.
Hello devs, I am not sure where exactly to ask this question as there is no channel specific to optimization. Let's say you have a car and the material for the brake lights needs to turn on emissive every time the brake is pressed. I see 2 options: 1: Change material instance to a copy that has emissive on or 2: keep the material instance but instead adjust the emissive parameter from 0 to x amount using a parameter collection. Which one is more optimized and why?
Add a node into the blueprint like begin play but don't attach it to anything?
Or at least, connect it to it's parent's begin play in case it's a child class.
@errant sage I would imagine changing the parameter would be more performant because your gpu is handling one fewer material but someone more knowledgeable than me should probably confirm haha
why do i cant drag the variable ?
Ehh how do I turn on the collision of my skeleton and access its value?
Your code you've shared seems like all it would be doing is setting whatever text value is stored in your "Search Button Text" variable from your I guess button, into the "Search Result Text" within "UI Tanda Database" widget which should work without any issue, so long as there is a "UI Tanda Database" widget that exists, but this wouldn't update any text fields of widgets unless you have their display bound to the variables.
Not sure if this is relevant, but if you're nesting widgets within other widgets, sometimes you need to remove and reinsert the widget if you made changes to the coding behind it.
do you know ? @dawn gazelle
Have you tried compiling
yes
Just remake it by dragging of a pin and promoting to variable
The text display is bound to the variable inside the tanda widget. And yes the code shot was from the button, I should have said. When I click on the button, the 'No widget Found' string is fired, so I assumed that the widget was just not able to be recognised as a child of another widget.
it is a way but how could i fix my problem
Maybe try unchecking Top level only on the get all widgets of class node?
Wait am I looking at it wrong or do you wanna place a variable from one class in the event graph of another graph
Thank you so so so much @dawn gazelle
That's not possible you'll need to access it another way
But maybe I'm not seeing it correctly
Not super familiar with ue5 ui
look i can't even drag the variable that he made to me
Looks like a bug to me
Dividing anything by 1 is basically pointless as you'll always get the same value out.
1/1 = 1. 2/1 = 2. 256/1 = 256 etc...
Current value / Max value gets you a percentage.
Eg 1 /1 = 1 = 100%. 1/2 = 0.5 = 50%, 2/4 = 0.5 = 50%, 1 / 4 = 0.25 = 25%
a bug from un5 you think ?
Maybe I dont have a clue I'm sorry man
ok i'm going to use the pin actions thank you anyway
The max value of the bar is 1. The point is you're trying to convert something that isn't equal to 1 (your maximum cooldown time) to equal 1 when the bar is supposed to be full.
If your cooldown is 6 seconds, you know that it's full when your cooldown timer is at 6 seconds as 6/6 = 1 = 100%.
If your cooldown timer is at 3 seconds, then it would only be half full as 3/6 = 0.5 = 50%.
Hi all... I'm looking into ways how I could change background elements (these are props like box,tube,sphere,, but they need to be randomised. Would this be BP thing? or more in the line like Foilage volume perhaps,, with Foilage Types.. make different type...and the simulate in the Procedural Volume. I just need it for different BG... but need different setup. Thanks so much. ideas welcome.
Can anyone point me in the right direction? I'm trying to implement a camera system with more than 2 positions, but I'm having trouble making a counter that will loop between them.
I'm trying to get a First person, a close-up over the shoulder, a regular 3rd person follow, and a DISTANT 3rd person follow.
The main hurdle is the camera switching.
Array or switch
Or for the distant camera you could just adjust the length of the spring arm with a lerp/timeline
SetViewTargetWithBlend
just so you're aware as well, catering for that many different cameras will make your environment look weird to scale
I'll figure that part out if/when I figure out cameras
#YOLOcodeIdkwhatimdoing
first person and third person alone will need different sizes
nevermind the other different cameras you want
maybe consider what cameras are actually relevant for your gameplay
So how exactly does it make the scale look off? Is it the camera FOV? Cuz that can be changed right?
I'm thinking of the cameras in RDR2 and GTA
the camera is part of the player character
so if the player character is in third person, you can have issues with entering new rooms in buildings for instance, because there will be situations where the character has entered the room but the camera hasn't
so you can end up having the character hit the wall on the other side of the room before the camera is inside the room
Oh that
Pretty sure the spring arm can be set to squish in to fit if the player has like a wall to their back
nah spring arm won't solve this for you
Also Advanced Third Person Camera has blueprints for turning things transparent between the player and camera
professional projects have this problem all the same, and they require difficult decisions about scale being made
doesn't matter
you're still going to have that problem
it cannot be solved by code alone
Yes but games actually do have 5he 3rd person camera squish in to avoid objects
Like it is a thing that can be done
Just a matter of figuring it out
that doesn't mean they haven't already scaled the environment to fit
well good luck if you think you can single handedly solve a problem that is one of the core game design problems in the industry
I like your bravado
Ignorance is bliss! :D
But probably set it so that if the 3rd person camera squishes too much it just smoothly slides into the close up or even 1st person mode until there is enough room
Does anyone know if there is a way to use an integer counter to dynamically add slots to an array? I am using a 'Do N' node to spawn a beam particle a certain amount of times and I need to keep them in an array so I can destroy them after a delay outside of the function.
you cannot solve this issue by "camera squishing"
this is what I am telling you
it doesn't matter what you do with the camera
there are other factors you have to take into account
actor Object Reference is not compatible with the Player Start Object Reference?
correct. they're not compatible
But in this tutorial
tutorials aren't flawless
they are often made by people who don't know what they're doing
you can change the array type to be of the PlayerStart type
Idk maybe it's because I'm not experienced enough, but that just doesn't really make sense. I also don't know if this matters, but the FPP and TPP models are the same, no floating arms. I want the full body awareness effect.
yep you're not experienced enough
so you can either listen or fail and understand why on a personal level
your choice
Thats work Nice..
I'd listen but I want more explanation. Like why can't a camera solution be enough? How do games with proper real life scaling do 3rd and 1st person then? Because they seem to pull it off just fine.
I'm just confused because many of the games inspiring me to mess around with unreal do what it seems you are saying is impossible
if you would listen you would read what I said which explained the situation
very few games do real life scale
I don't know of any on the top of my head
they make it seem real life scale, but it isn't
See that's the elaboration I was looking for
Not to someone who doesn't know
either you want to listen or not
Also it would be cool to see an explanation of how that "scale trickery" works if I haven't pissed you off enough yet
everything I've told you will allow you to figure that out
it's literally right there in text if you read it
I'm trying to get the direction to my pointer and move there, but when I start moving in X/Y my direction start to flow in every direction, someone knows a way to fix it ?
@odd ember
Like I said, maybe it's obvious for someone who has more background knowledge.
You have been giving me some of the fastest responses to questions I've ever recieved so believe me, I'm trying to follow what you're saying.
But really, there's 3 things you've taught me.
- Players can hit the other side of a room before the camera enters
- Changes in scale are done to help this (What those changes are and how they still look normal is not explained)
- Other factors are involved (No further explanation)
I'm simply asking because I don't know. I'm looking at what I see in games that have been produced, and I'm looking at what you are saying and there is a disconnect.
You're bridging the gap but not completely, and you are getting frustrated with me for not understanding an incomplete explanation.
I'll gladly watch a YouTube video instead if you have a link, because so far I haven't found what I'm looking for.
I believe the return node stops execution of the function.
Do you need to use Do N? You can do something like this and you'll get the returned array of items spawned within the function.
well think about the problem that I've laid out before you. I've not explained it deliberately because you can think about the problem to understand how to solve it. I don't know your exact specs for camera either, so it's not like I can give you a 1:1 solution that will work for you. like I said, the environment plays a role. those are the other factors. FoV can play a role as well, since it's a function of how much screen real estate you are giving to the player, and at what distance.
if you are expecting a finite solution to one of the most common and arguably, one of the greatest problems in game design, then you are in the wrong business.
this is generally also known as the "3C" problem - camera, character, controller
Is there a way to make a loop with continue in blueprint?
while(...)
{
if(...) { continue; }
...
}```
hi, can someone explain me how to create and inventory? (WITH HOTBAR) i want to learn how!
That's not specific enough to just be a question. There's a million write-ups on it. Find one and follow it, or do the right thing and try to do it on your own, only asking for help when you actually get stuck
Okay! thanks
I think the add node is what im going to need. Im using the Do N for a couple reasons, I originally had written each spawn emitter out individually and it was getting to be a hassle so I figured the Do N would help me reduce the amount of nodes I was having to add. The second reason is that i'm making a system where I can add new types of weapons as easily as possible, so for shotguns and burst guns that spawn 3, 5, or however many bullets at a time, I can just plug that number into my function and have it spawn the needed amount of particles, etc.
as you can see here, my original system worked, but was not efficient
what ill do is create just create that local variable array in the function itself so it creates and updates everytime i run the function. Should do the trick, thank you very much! @dawn gazelle
You'll need to get rid of the Do N and use a for loop. The return node stops execution of the function.
Of course this won't stop sequences. If you need that sort of power, you need a function to return from.
I have a reroute that loops it back already. It fires the correct amount of bullets and particles, it just doesnt delete them all because they werent all getting added to an array
or rather, the array was only 1 item and i wasnt sure how to use the integer value to increase it during runtime
Yeah that was the situation
Guess ill go the subfunction return route, thanks
hi everyone! i've added a dialogue system to my game that checks from a data table for the text but now i want to add in a simple quest system like spyro where the dialogue only changes if certain conditions have been met (i.e. the player collects a certain amount of fish or kills all the enemies on the map) can someone help explain how i'd start going about this or does anyone know a good tutorial i could follow to learn?
it worked btw, i plugged the counter into the for loop last index that adds to a local array and plugged the array into the output. Thank you very much!
This logically doesn't make a lot of sense.... You have a Do N node that will execute the logic N times. Then at the end, you have a loop doing nothing I'm guessing N times as well?
there might be a redundancy, all I know is that it's now working and everything is being updated and destroyed properly
rounds per shot is the counter that replaces the input from the function you showed in the screenshot
Do it without a tutorial. Start by thinking about how you'd define a quest, how you'd detect when an objective is satisfied, and from there it's easy
As with almost everything, start with the data. Make a Quest struct and think about what information should be in it. Start simple, quest objective handling can get really complex really fast.
ok i will do some research, thank you!
You'll probably want some sort of central handler which can filter and keep track of all the events. Like for a kill quest, everything that dies would tell the handler "I died and Player killed me at x location". The handler can then check if any of your quests are tracking that mob type etc and update stats accordingly.
can I call a construction script on another externally?
<@&213101288538374145>
:no_entry_sign: SHA3DOW#6851 was banned.
not sure if anyone has encountered this but I have a custom scene component ive placed on a blueprint with a child box component. When I place this into the level it wont let be change the instance of the blueprint's box component size, it'll just snap back to the default. Any ideas why?
trying to change the box extents but they snap back to 32 each time
Would it be wise to create a BP of a lamp and a light together?
oh no, haha, just want to keep my lamps, etc, organised and don't want to have to put a light for each and every lamp manually.
Hey! does anyone know a function to know the name/string of the sublevel an actor belongs. Actors are not spawned, but they exist in potential sublevels that could be loaded or not (since they are procedural).
I don't find a simple way of getting that data, while you can easily see it in the outliner while playing/simulating.
Ah, thank you, good to know! I wasn't sure if this was the standard way of doing it, or if there was a better way.
Can someone show how to use soft object ref sample in a bp?
Do you have sample link?
I read somewhere that it helps in loading
hey, thanks for the answer. It is basically a AI spawner that is part of a streamed level. The owner of the spawner gives a null, and if I get the level spits out the persistent level, never get the name of the streamed level.
When you have hard references, you are loading those things into memory Soft references prevent you from having to have everything loaded into memory all at once.
Thank you. But are soft object ref. usually used for textures?
They can be, if you have a lot of them.
I tried using it in a bp (with skeletal meshes, code, etc) and use soft ref.. then used the asynch load asset node then cast... but it fails always
So i got the impression that soft object ref are just for texutres/cosmetic
I dont why
What type of soft reference were you using?
I'll open my laptop ๐
Hello, does anyone have an idea why enable input node doesn't work for me? I have a stun mine that's just begin overlap, play montage, disable input, delay and enable input. The other nodes work fine but the input is not enabled at the end.
So you're having the mine disable the input of the player controller on their controlled pawn, then trying to enable input on the player controller's controlled pawn?
Yes, so from begin overlap I cast to my player character and that goes into the input nodes target and the player controller input is my player controller
like this one..
it always fails
Dummy Var is already soft ref object of "Cartridge OG"
ahhh
sorry
Cause you didn't wait for it to load.
let me reedit
Hi, I need some help. I'm an API developer and I'm experimenting with JSON data with unreal. I'm using varest to make the request but I want to move the data to umg widgets. Trouble I got is that the request works fine in blueprint because can make a callback when is done, but I don't know how to do that with a widget, How do I wait for the data to be downloaded to then show it in the widget?
This works just fine on my end. Perhaps its something to do with how you have the play montage hooked up?
sample
You can use an event dispatcher that can be called when the data is ready. Have your widget bind to it.
still fails
just a sample blueprint i just made just now
I'm not sure if my UE4 is broken
it just a defaultsceneroot
are you sure the variable has a value?
So it doesn't make a lot of sense I don't think to soft reference a blueprint.... Blueprints get instantiated when you need them as it is. you'd use a blueprint class soft object and feed into a spawn actor node.
I believe.
the variable has value of "none"
could you elaborate your statement?
he's not really right, you can soft reference a BP if you want, you can soft reference most anything, but doing so can be meaningless if that thing is already in memory in your game environment, which I assume is what he meant
Blueprints aren't really objects in the game world.
There are actors that are spawned in, those are the actual objects.
Flaming, that soft reference variable has to point to something....
it can't be none
hard to find good soft object articles/youtube vid.
it doesn't give me any choices
Because it's a topic that requires other understanding and not just hooking up lines to make something do something neat. You can't get easy youtube viewers with that.
i'm trying to understand it. As I've checked that it helps in loading
Do you know what a Class Default Object is?
no... really no background in coding
To understand soft pointers, Class or Object, you need to understand what a hard pointer is, and what the CDO is, as well as a vague understanding of how Unreal handles garbage collection. Without those three fundamentals, we could talk all day about soft object ptrs and you won't get it.
i understand class, object, and hard and soft reference. I'm trying to review structures
that's why I'm trying to implement soft object ref. on my bps
as i've recently learned that casting would load a lot of things if not properly implemented
and recently learned about soft object ref. so that it won't load all things at once
That did it!, thanks a lot. Here some info about event dispatchers for anyone who needs some quick intro https://www.youtube.com/watch?v=sEcoWGrF1Hg
How do I use Event Dispatchers in Unreal Engine 4?
Source Files: https://github.com/MWadstein/wtf-hdi-files
The problem you're having is that the variable is empty. Your implementation of the Async node is generally correct.
I've watched the unreal "demystifying..." video but I can't do it for a soft object ref of a Actor BP. Casting always fails. Now, i'm having impression that the "async load asset" node is just for texture/material
The reason the variable is empty, the reason you can't select anything to put in that field - you'd have to tell us more about that variable, what type is it?
No that's wrong, you can async load lots of things
Hard Pointer is a memory location. When you create a new object, you store it as base data in memory. Hard pointer is a number id that lets you find this data where it's stored in memory for that instance.
Class Default Object (CDO). For every object you intend to instantiate or use, there is a CDO. To spawn an actor, it's CDO must exist as spawning is largely copying this CDO into a new instance.
The reason you need to know this is because when you don't point to a class or asset via a hard pointer in Unreal, the CDO will be garbage collected. Thus nothing to copy. When you use SoftObjectPtrs or SoftClassPtrs, they do not hard reference the object's CDO, so the object can get garbage collected. This is on purpose. So to use that actual object, you have to load the CDO, and this is what your Async loading is doing. Soft pointers have a path to the location on disk where that object is located, and it uses that path to load up the CDO so that you can actually use that object from them on. If you then do not use it, or you remove all hard pointers pointing to that object, the CDO gets garbage collected and released from memory.
A blueprint soft reference is similar to a standard object reference, save that the item isn't loaded into memory automatically.
If you have a variable of an object, let's say it's of "ThirdPersonCharacter" type, that object isn't automatically populated with a reference to your "ThirdPersonCharacter" blueprint - you have to populate that variable yourself with a reference to an actual spawned "ThirdPersonCharacter" that exists in the world. Third Person Character objects don't really exist unless the game is running, once they are spawned, then they exist, and they can be set in ThirdPersonCharacter variables.
So, now if you're dealing with a soft object reference of "ThirdPersonCharacter" you have the same issue - you still need that thing to exist before you can actually reference it somehow, but again, before the game starts, Third Person Character objects don't exist. So a soft object reference to a Third Person Character can't exist, as you have nothing you can set to them.
If you were dealing with a Skeletal Mesh.... Then you could absolutely use the soft object reference as it's referring to the mesh object that your project contains, so it exists. It's not specifically an object in your game, but it is an object that the engine knows about.
The complexity of this topic is also the reason people are so uppity about Casting in general. Casting is perfectly fine if you understand what you're doing and how you're setting up your classes.
Flaming try changing that variable from a Soft Object to a Soft Class
should fix it
yeah.. that's why I've restructured my BP to have more interfaces and now maximizing my options by studying soft object ref.
Interfaces are largely pointless and a terrible direction. All they do is create more work.
interfaces are commonly used and will work fine for what you're trying to do
Relying on interfaces to solve the problems that you should be solving with a correct inheritance chain is just bad programming.
It really doesn't matter if you have 10,000 core classes loaded if they don't reference heavy assets. They're tiny little miniscule things that take up nearly no memory. The only time you need to worry about avoiding that is when you start adding meshes, materials, and whatnot to classes and then casting to them. Which is why you don't do that and you create a non visual base class you can cast to.
on this one. The Async loading actually works. It's when using "cast to" that it eventually fails. I'm wondering why it fails.
you sure you're casting to that class, or a parent of it?
yes. It's the same
Did you ever set a value in that soft pointer?
just made sample here for the topic
off the COMPLETE node
no.. this one I cant figure out
What is CartridgeOG
I downloaded a level from online and im trying to play with a character in it. The level has a cinematic camera thing going on when you start the level, but i want to disable it. Any ideas?
What type of class is that?
change the variable to a SoftClass, you have it as a SoftObject
It's just a blueprint...
yeah this. One... I just made a Actor BP just to discuss soft object here
But what is it? What are you using it for?
it's really just a sample blueprint
Okay. Lets take the discussion somewhere more theoretical to give better examples.
I assume you want to Spawn an actor from this? In which case you need to stop ignoring me and change it to a SoftClass instead of SoftObject so we don't all have to sit around arguing about this all day.
You can't use blueprints directly as soft references and async load them. It doesn't make sense as you normally spawn blueprint objects from the class.
You can use blueprint class soft references, and use the "resolve" to get a reference to the class, then spawn the blueprint object you're trying to use.
Take a game like Fortnite. Every player character is the same. You all play with the same class. The only thing that changes is your skins. So there's no point in soft classing the character class. Instead, you SoftRef the Skins, the skeletal meshes.
On the other hand, consider a traditional fighting game or a game like Overwatch where characters can be insanely differing but still have lots of similarities like taking damage and such. You do core gameplay work in a core Character class. But inputs, moves, meshes, etc you can place in a child of your core character class and softref this new child class and only load it when you need to.
For the first, where you're soft reffing assets, you use SoftObject pointers. For the second you use a Soft Class pointer.
tried this one.
Like Datura pointed out, your Cartridge is a class, like the Characters I mention in the second example.
Class is still empty.
What is the variable value set to? It's probably empty
yeah... @maiden wadi and @mellow folio . This one I don't know how to set a value
fudge.. I feel stupid
thanks man
I mean it doesn't work on object, but on class it did
i could sleep now
how can I get a world location from a relative fvector and an actor ?
thanks
soft references are mostly for loading classes
I could just add vectors but it'd ignore rotation and scale ๐
No they're not? You load assets more than you load classes.
I just want to "apply" a transform to a vector
@maiden wadi @dawn gazelle @mellow folio can I add you as friends? Perks is sometimes you'll get dm from me asking UE4 stuff
In fact, with the rare exception of changing your child classes into asset classes like I mentioned for a fighting game or whatnot, you rarely soft ref classes.
You can use the GETFORWARDVECTOR, GETUPVECTOR, GETRIGHTVECTOR nodes and multiply them....but I hitnk those come off of rotations
really there is no way to convert a relative vector to a world vector?
Transform Location
yeah sure
thanks
thanks again. Will sleep now.. 12:46am here
I kept looking for vector but I should have looked for location ๐คฆ๐ปโโ๏ธ
Haha. To complicate that it messes with me in C++. As it's named Trasnform Position there.
oof
Transform it.
relative to world is just the relative + the actors world location
is that a question?
xD
lol
np
for super simple Cooldowns, I like to just save it as a Float Variable as the time when the ability will be ready again, so it's just Cooldown time + GetGameTimeInSeconds
Then "IsCooldownReady" is just a function (Is GameTimeInSeconds > Variable)
But like I said, this is an ultra bare bones approach
Is there some automatic overflow for the GetGameTimeInSeconds ?
never used it
sounds safe enough tho
guess nobody plays long enough for overflow anyways ๐
I don't know what overflow means, so no, definitely not ๐
oh nvm
Yeah I don't know how they handle that
but I assume it's safe
I'd probably just use a regular float for the cooldown but the result is the same regardless
Why dont you want it to change with time dilation ?
Sounds like they want a solution that ignores time dilation
for whatever reason
Stop time on others?
or time in general
I believe Delta Time ignores time Dilation, watch that video
so himself included
there you go, you need time dilation ๐
then its not all time.
There's custom time dilation.
thats what your stop time should do
Stop time -> Set Custom Time dilation on all affected actors
?
you dont set it on UI
Who's cooldowns
ITS NOT AFFECTED
๐
No.
Not when you use custom time dilation.
Custom time dilation is specific per actor.
No
Thats the node, but no
Wrong target(s)
I think global time dilation overrides custom ?
define everyone
everyone in range?
everyone on the map?
unspawned actors?
In range -> you need something to check your range. Collision volume perhaps.
just make them
๐
Hey everyone very simple question here
I have this level up logic here at the end of my AI
and basically what im doing is increasing the players base strength per level
No exp overflow ?
In the character
Thats the next issue
after this one
anyway I need to signal after the level up has taken place
Not seeing anything increase base strength based on level
to recalculate the
Yeah Ik. I had it muliplying but the issue is
After a levelUp has been done, just call a "Calc stats" function?
I need a signal to crecaculate that strenght value on level up
which handles the stat math ?
the CalculateStats would be called on beginplay/load game and whenever a stat would change (weapon equipped, level up, weapon unequipped etc)
hmm
this is in the Player
RIght now I have on picking up a new weapon it rests based on the default strenght
this might be a architecture issue more then anything
And I also dont know how to Call a function form one blueprint then make it run on another
You want a dispatch I think
I think you have a Weapon doing damage, and you want it to recalculate its damage when the player levels up
Yeah its Weapon damage + player damage pretty much
and player damage goes up on level
Ok, go to the character and add a Dispatch
call it LevelUp or something even more generic like "Recalculate Stats"
Then Call (The LevelUp Dispatch) inside your character's Levelup logic
Does the weapon strength increase based on player level?
The player strength does. and Player strenght + weapon strength is total
Yes, a dispatch is a type of event, that other events can "BIND" themselves onto.
So the Weapon wants to BIND its RECALCULATE event to the character's LEVELUP dispatch
Thats what i thought
Perform that binding at BeginPlay of the Weapon, or whenever the Weapon gets a good reference to that character
Im gonna need to watch something about this
