#blueprint
402296 messages ยท Page 587 of 403
The cast works fine. Get playerpaw fails. The right character is get and stored. When printing its name, the print says nothing (referenced to None) after first unload/load of a new level
(printing on tick from gamemode)
And I have only 1 gamemode BP used the whole time
EDIT : the print string displays only the reference for a few frames, before the first level load.
Note that I used this system for a VR game that I converted (buuuh) into non-VR. I thought it'd work the same way...
The final issue is I can't get the character BP from sublevel BPs, nor possess the character.
After some digging, it appears my character BP disappears after loading a sublevel. Any idea ?
AIController->MoveToLocation rotates the character towards the target location. Can I disable that?
And AIController->SetFocus doesn't seem to do anything
๐คฆโโ๏ธ The character bp is killed by killZ value and gravity... Thanks a lot @tight schooner !
you should store the last rotation value and force it ? Or constrain your AI with a look at rotation ?
thing is: I do a move order on my pawn but it overwrites the rotation I have manually set for it
Now I discovered AIController->SetFocus but it doesn't seem to do anything. Maybe it's overwritten by MoveToLocation too
What about over-overwriting the rotation just after the move order ? Kinda messy however.
@olive sedge I don't remember all of the settings off hand. If I recall correctly in my RTS ai testing, I just disabled UseControllerRotationYaw, and then ran parallel tasks for move and rotate towards target if they needed to face something.
Also don't forget to allow strafing in the move call.
ok
I can't seem to disable the character facing the direction it's walking. Not even when I disable UseController
maybe if I could set focal point to none ๐ค
That's odd. Do you have any sort of code doing that? Or are you using OrientTowardsVelocity, or something like that?
hi im new to blueprints can anyone help me with it?
Hi @trim matrix you can start with unreal engine official blueprint tutorials playlist for beginners : https://www.youtube.com/watch?v=EFXMW_UEDco&ab_channel=UnrealEngine
This video gives us an overview of the Introduction to Blueprints video series as well as jumps into a high-level overview of the concepts behind Unreal Engine 4โs Blueprint Visual Scripting system.
so you need to watch each video one by one completely in order to understand the blueprints
oh ok ill get started now thx
@maiden wadi it works with the fresh unit so yea.. Gotta find out where I went wrong, thanks
I don't know of anything that can affect that besides the OrientRotationTowardsVelocity.. Or whatever that setting is called. Or the UseControllerYaw/Pitch
@trim matrix you may also want to check: https://learn.unrealengine.com it has much newer content
That or some form of update on tick or timelines. ๐คทโโ๏ธ
@maiden wadi I'll just create it from scratch
Hi, I got this as a level blueprint to spawn an actor on input. I want the last spawned actor by that script to be destroyed before having the new one appearing, on a single input pressed.
'But I'm having a error text saying 'acces none trying to read property'
whenever I use the input.
why ?
@solemn parcel it may be that the input is called again while the actor is being destroyed. Right click on your Bouncy Ball get and choose Validated Get. After you have called Destroy Actor and before the Delay, set Bouncy Ball to null.
To set it do null just do a Set on it with nothing connected to the input pin.
Hello @everyone! I am trying to individually change the material of multiple static meshes when clicked on. I made a level blueprint where I referenced all of the meshes individually and used an on clicked event. But it's too long and I also need to bind this to UMG which I can't do in a level blueprint. Could I just put all of the static meshes under one actor blueprint ? Could you please help? Any suggestion would be greatly appreciated. Thanks!
Anyone that could help me? Im trying to set this value in the even graph, but cant manage to get a reference
@atomic salmon Don't know if it is exactly what you meant but did the trick. Thanks
i need help, when i click on this actor, i can see a gizmo attach to it, but i don't see any gizmo actor or gizmo component attach to actor, i mean how to add gizmo to any actor?
@solemn parcel yep that is it. In addition I was suggesting to set Bouncy Ball to null before spawning the new actor but in this setup it is not needed
in other words, how to attach gizmo actor to any actor, so i can scale it properly
Hi again! Pardon me, I would have a question.. I have the ref to an actor, and everything seems right, but when I try to use the Set Actor Location node, with Teleport enabled and an entirely different coordonates from where he is... he doesn't move, I don't have any errors in the console either
If i create a bag actor instead of using a component, how would I store it without it being in the world? as it would only need to be in the world if the player drops the object (at which point it would have a decay timer added to it)
also on the component, if i setup a constrct to set its size, in the structure its still just a object reference, the question was how do i create a component to stick it in the reference for the structure, that's the part im stuck on there.
I did it boys, i finally made the branch that is true AND false
Hello all - I have a scaling factor that I would like to apply (multiply) to only one axis of a component. How do I do this ? Here's what I have :
(in other words I need some way to have access to all the 3 transform pins and affect only one of them, as opposed to affecting the whole transform)
right click and split pins or build the vector then attach it.
In terms of fishing, what would be the best way in 4.26 to implement a fishing line from the tip of an attached mesh to an object? (am currently using debug draw line)
@worldly karma if you do split the pin, keep in mind you still need to pass a value to all 3 pins.
@orchid garden oh, thank you so much ! Had no idea about the right click to split pins, that's perfect
would you mind clarifying how to do your other solution (building the vector) ? I suppose it's possible to manually create one, just don't know how
(this worked perfectly)
@cold raft : wondering the same thing as I have a bowstring to setup. Curious to hear suggestions on this.
@worldly karma
Excellent thanks, I like the clarity of this
make vector comes in handy if say you calculate everything for the vector in another function or ahead in your chain, so your only passing along 1 variable (single vector) instead of 3 (3 floats) to get your end result on the scale.
yeah I like the look of this, it's more, hmmm, explicit somehow
here's the result FWIW
ah a helmet light flare ๐
as all helmets should be ๐ Kojima/MGS style
eye candy is always nice in games.
indeed ๐ thanks again for the speedy/straightforward help, really appreciated.
meh was a simple thing ๐
well that 's the thing with BPs - I knew exactly what I needed, just didn't know under what name/UX paradigm Epic decided to hide it
my problems abit more complex... and im trying to keep my project strictly blueprint.
Good luck ! I wish one day, Epic would stop spreading around the whole "with BPs you don't need coding, therefore it's easy for everyone" lie. That's just a fallacy (but hey, I understand it from a marketing standpoint). That said, back to work now ๐
it is easier visually, but its still coding.
the only way I manage to make them readable personally, is to make them go from left to right
as opposed to speading them around in both directions
hence, closer to the readability of lines of code
@trim matrix you mean like ? lol
I believe there are some ways to make this read better, by forcing oneself to declare a variable each time there is a temptation to make strings cross
(if that makes sense)
that's the only way I manage to make them not make me feel dizzy when reading them
i do my best to make them less spaghetti like once i get them working like i want:
looks like you'll be the right person to ask my questions about datatables later ๐
those are just a couple functions lol.
been alot of hair pulling during this project.
@orchid garden - what is the project you are working on. Looks like an inventory system
my latest issue i can't seem to find a resolution for though... I have equippable bags, so the player can stick items in the bags... but they need to be able to unequip the bag, stick in it their inventory and it keep the items in it, or be able to drop the bag to the ground and be able to keep the items in it.
All the items use the same struct for storage, and i though perhaps a component in the stuct to store the inventory items sense you can't nest the same stuct inside itself (endless loop), and the component uses the stuct in a array.
but... i can't figure out how to add the component to the stuct.
@cold raft yeah currently working on the inventory for it ๐
add the component to the stuct inside the blueprint that is, so that i can actually store stuff in it. its in the struct, just can't use it for anything...
@cold raft this is the full inventory panel:
@orchid garden - are you keeping storage componants separate from items? once you drop a bag, that storage_component gets destroyed and a 'bag_item' is spawned. Then, when you equip a bag or spawn a chest - that bag 'item' is destroyed and a storage component is spawned.
Nice interface!
on dropping a bag it would spawn a actor and add the inventory list to the bags component then destroy the stored object.
I'm probably not explaining it properly to what the problem is... when i create the bag object in the inventory, it has a reference for a component but thats it, no component in the reference, so trying to store anything in it just gives me a invalid object error.
this is whats used to create the bag in the inventory:
its the sturcture thats pretty much useds for all stored objects in the players inventory
i tried using a world object as the storage (container) but that opened up a whole new world of problems.
container was a component originally.
the original stucture was more like:
https://cdn.discordapp.com/attachments/221798862938046464/788917081755746304/unknown.png
but the component is the issue there.
(image is from a earlier post)
Anyone knows how can I change the mouse sensitivity at runtime? I do not ask for Player Controller's pitch/yaw input scale because it's rotation only and I want to change the mouse cursor sens.
@trim matrix you mean like....
https://youtu.be/9iwiL4kUF9U
Welcome Unreal Developers
In this video we're going to learn how use a slider widget of the UMG UI to change our mouse sensitivity inside the game we're creating in the unreal engine 4.
Unreal Engine โ www.unrealengine.com
Blender Foundation โ www.blender.org
GIMP - www.gimp.org
@orchid garden dafuq, looks promising. Will check this out, thanks!
Nah, unfortunately that's exactly what I did already. He is changing the players pitch/yaw input scale so his camera turn is faster/slower. What I am trying to do is to set the mouse pointer sens. Let's say you have an RTS game where you want to move your mouse cursor faster/slower in 2D.
I can do it by changing my global mouse settings in Windows but I am trying to find a way to do it inside UE4 game.
so... your wanting to change the windows mouse senstivity via unreal engine? don't think i've actually seen anyone do that, might be something you'd have to do in c++ rather then blueprints.
@maiden wadi might be someone to ask about that one, he's pretty knowledgable
@torpid oasis well... changing mouse sensitivity in-game for RTS games is pretty common I guess?
Thanks anyway. ๐
@trim matrix 3 Prong Gaming did a whole RTS series, maybe there is something in it covering that if its common in RTS games? just a thought...
https://www.youtube.com/channel/UCkIkWiM9gbAPe8MSrAahuqw
New to my channel, Unreal Engine 4! Learn tips, tricks, techniques on how to create your own video game!
Go check out a friend of the channel, Matthijs de Rijk, a 3D Artist who has helped with some models for my tutorial series and allowing me to share them with you to download: www.mrtherich.com
https://www.facebook.com/MrTheRichArt
If there...
Will check it right now, thanks once again. ๐
sry i can't be more help
@trim matrix a lot of the cursors you see in game are not windows cursors, but custom one you can fully control, including sensitivity by establishing a relationship between the windows cursor speed (input) and the custom cursor (widget).
software or hardware cursors?
This is the place to show, share, and link to your stuff!
that is software, hardware cursor was added later
@orchid garden I may not be understanding 100%, but I believe the component inside the struct may not be working because it's not directly attached to an actor
@vivid fog yeah thats the problem, you need a actual component to reference, but setting up that component and being able to destroy that component on the fly is the issue i'm having.
and the component you want to create/destroy is the bag itself, or its contents?
the bag itself is the struct, the component is stored in the struct that holds the contents contained in the bag.
Would it be possible to create another struct for the contents of the bag?
rather than relying on a component
i thought about that as well... but then i'd need to convert the items from one struct to another then store them into the bag struct, and also when displaying them i'd need to convert them back to the other struct then display.
the inventory, cooking, forging & crafting system all use the same struct for items.
having the items the same struct simplifies moving them between containers
Yeah, working with multiple structs is pretty tough in my experience. It might be worth creating some functions to handle that conversion process or streamlining it somehow. The only reason I'm suggesting that is because I can't think of a way to involve components like this
I've had multiple "identical" structs before where I had to do a lot of pin splits and functions to get the data to move from one place to another (also for an inventory system but especially for a quest system I made)
may need to rethink my whole bag idea.... or inventory storage.
Good luck, and make sure you've got backups/version control. Working with structs in UE is crashy as hell, and one time I even managed to make my project un-openable ๐ฌ better safe than sorry!
heh yeah i know, using a seprate project to work on the inventory till i get it working properly like i want.
i think my problem is im stuck in a paradox lol.... (nesting x stuct in x struct)
Nested structs can be a headache (especially if, god help you, you're nesting struct arrays lol). Unfortunately I haven't found a way around doing that in a lot of cases. Maybe someone else here has.
i guess i could just make it so that if they have items in the bag they can't unequip it they can only drop it, and if a full bag is dropped they can only take items out of it not pick the bag up until its empty.
One thing to think about GeekyGek, is that unless your items in your game have modifiable statistics (like, say, weapon durability) - you often don't need to store a full struct for them. Just store the ID number.
yeah they have durability and some have spoil timers
And then, if you need to get a property for that item, you can look it up in your DataTable or DataAsset for that item.
Even then, if you have durability and spoil timers, that's... pretty much all you need to store.
ItemStruct:
- item_id
- durability
- spoil timer
And they can all be the same struct.
even then im only storing the info in the struct i need to save, i.e. name (renamed item), condition (used for both spoil timer or durability) and data table row
That's good.
container was just a attempt at making bags that could be filled and moved to inventory.
im even using a shared component for containers, and shared functions for moving stuff between, dropping, spliting, etc the items contained in.
that way i don't have mulitple objects with the same functions, just a singular component i can use to change a function.
saves on size, and simplifies finding bugs.
Hello @everyone! I am trying to individually change the material of multiple static meshes when clicked on. I made a level blueprint where I referenced all of the meshes individually and used an on clicked event. But it's too long and I also need to bind this to UMG which I can't do in a level blueprint. Could I just put all of the static meshes under one actor blueprint ? Could you please help? Any suggestion would be greatly appreciated. Thanks!
How do i add blend time to the activate and deactivate nodes? like you can on the set view target with blend node https://gyazo.com/ca97eac2e67cefcf07cd24528b6ced20
You can't really blend the 'active' state. It's a boolean. It's either on or off.
How should i do it then?
Do what?
look liek trying to swap between 2 cameras, one for normal and one for ADS
https://i.gyazo.com/thumb/1200/ca97eac2e67cefcf07cd24528b6ced20-png.jpg what i am trying to do here is an aim down sight system and it works exactly like it should i just want it to be more realistic and add blend time
could either just move the camera to position using a lerp, or just use the blend node
that will swap the active camera anyway
If you wanna have a set position for the 2nd position could just make a component and move it to that location that way is easier to finetune
Or you could use a Transform property. Those give you gizmo's to move around.
then use a timeline or timer to lerp it into position and use ADS speed to change how quick between different weapons/stats
if you really want to use 2 cameras, just remove the activate and deactivate, and put the blend node there, target current camera, view target new camera, then blend time to how quick you want it to move between
@mortal wharf
@woven wing Think you can help me with yesterday's URL button thingy?
Can't make it work
@ocean radish Thanks mate, i'll go with the blend node since i am using only 2 cameras
And I'm convinced that your approach has to be weird in some way to require what you're trying to do.
Consider making your clickable objects into Actor blueprints, so they can do something like this:
but each needs to have a unique number that stays. not re-generated every time
u talking to me?
No, I was talking to machmouchih.
right
what you trying to do sparks?
I'm not sure. Sparks is really cagey about their actual intentions.
You won't explain what you're doing. You've explained a problem with your solution for what you're doing.
But not what you're doing.
simplest things can somtimes be the hardest in bp ๐
I have a BP I can click to launch a URL. every apartment has one of these and refers to a unique website of that specific apartment
OK.
dafuq is a guid?
A GUID is a universally unique ID number that can be generated on demand.
I need this to be a number
Why?
the url ends with =<int>
Change that?
if your apartments are going to be number based for the url, why not just store the number in the clickable object then pass that to the routine?
explain?
They are, they just don't want to have to set them manually.
ah
there will be a ton of aprtments
so I wanna duplicate the BP instances around and have that INT increment respectively
that's all
Wait, you want to be able to duplicate them? Not create new ones?
I got it working (see construction script image above) but the numbers get messed up for some reason when re-opening the map
Like, you have one assigned to '5', and you want to duplicate it, and for the original to still be '5', and the new one to be something else?
That's not actually simple.
Start with 1, duplicate to have 2, duplicate again to have 3
1 stays 1 throughout , etc
All I want is not having to manually punch in numbers hundreds of times
i was just thinking if each clickable object had a variable for the apartment number, you could do something like:
They have that.
ok so store them into an array and set there numbers based on the index? instead of iterating through all actors?
That's what I have
But you also want the numbers to be consistent. You want apartment 5 in your map to always be apartment five no matter how many new objects you make or how you make them.
yes
See, if you were making new ones, and not duplicating them, this would be easier.
why?
Because when you duplicate an object - it copies the values of the properties of that object.
So if you set 'apartment number' to 5, and then duplicate it - you get another 'apartment number = 5'.
but if done properly in the construction script?
The construction script gets run every time you build the object.
That includes every time you move the object.
And every time you reload the object.
Or stream it.
this pretty much does the tricks except the numbers change sometimes unpredictably so it's not so reliable
when I duplicate the BP it does increment
Right, they change whenever you move the object, reload the object, or stream the object.
it will increment but be very unreliable and if you delete one it will mess all the other numbers up
You could do some kind of global operation that assigned each apartment number.
So what's the right way to do it?
if the numbers are all unique and stay there, I don't mind
They won't stay there though.
hrm... so if im getting this right..... he's building a array of the objects in the scene then wants each door to open a specific url every time from that array?
They will change when you run the global operation.
If you want to be able to keep adding or removing objects and to keep old objects assigned - then you have a problem.
but obviously every url corresponds to a specific apartment so they have to stay there
Yeah, that's why this isn't a good solution.
Maybe there's a way to just duplicate them all around and in the end press a button to assign them random uniqe numbers?
You should change your website to take a guid, and use a guid.
if thats the case.... (a array of objects ) couldn't you just sort the array by the object name, then use the index of that to get the proper url?
This is doable.
If you just want to assign the numbers once, and they're static, and you don't add or remove objects.
That's totally doable.
ok how?
Make an editor function like Datura told you before.
Get All Objects Of Type, assign each object to it's index in the array.
Datura's way doesn't work. it only assigns to the specific BP instance I run it on
If you go back to that conversation, they realized this, and provided a fixed version.
seems like a aweful lot of complication for a simple thing
this?
So what to do?
You need to get the array element and set the property on that.
Right now, you're just setting the one object's property.
sorry I don't understand
@trim matrix Did you ever figure out that sensitivity thing?
Yes.
not working
What's it doing instead of working?
so hard to explain
hmmm
So first I disabled the construction script I had right?
Yeah, you would need to do that.
now when i click the function button it needs to number them all from 1 onwards right?
ill just show u screenshot
Yeah, that's what it's doing.
Don't forget to save the level.
I did not, I was told it's always changed on the operating system level
Would it not just be simpler to make a editor function that spawns a new apartment and sets the int when you click it?
I mean they only change order if I assign number again
how can l create a microfone input and change intensity with how strong is volume
I mean it's highly destructive if we ever change stuff
Of course.
but it's the last resort solution atm
is there really not a simple solution to this?
No.
The correct way of doing this is to alter the website so that it uses a GUID.
And make a GUID when you spawn a new object.
if all the clickable objects have a unique name, can't you just shove them into a array and sort them by object name?
I have no idea about that GUID stuff
Yeah you could do that.
But duplication would fuck with the names I think.
Mmmmm
No it should be fine.
if you had two objects with the same name, their order would throw off the order of all the others after.
Yeah, that would probably get you closest.
Or you could sort by position, if the apartments aren't going to be moved.
they won't be moved
but I need a more practical guide to your concepts, being the noob that I am in BP
@trim matrix Well. Normally you would.. Let me try something really quick though.
@maiden wadi thank you!
well there's a simple solution - get the position of the clickable object, and construct the number of the url from the objects position.
Butts. It's been a while since I sorted something in Blueprints, and I remember now that it's a huge mess.
I think the best way is to stop duplicating and just make a button(editor function) that spawns a new apartment and sets the int then. its only ever getting set when you first make it then, not trying to set them all at once, or any of that stuff
How can it know where to spawn ?
or do u mean spawns at the same location and ill have to move it
well you dont have to, you could store the last one and move it based on that if your only ever going up
Ah, now I remember. Sorting in Blueprints is pretty much impossible without the LE Extended Library.
jesus
I might just stick to the latest solution then. this is starting to be all too messy
so when you duplicate a apartment, what are you doing with it? just stacking them?
what do you mean?
in terms of in the world, your duplicating an apartment what are you doing with them once duplicated?
did you see my screenshot?
..
just placing each actor on its respective apartment balcony
i just don't get why your going through all this effort, are the apartments being dynamically spawned in?
so the guy can click at specific apartment to be directed to its corresponding web page.
But i can't connect the ads camera to the new view target and the normal camera to the target
it is in the first person character
no, why ya'll have such hard time with this lol
Changing the website to use either a GUID or a string (so you could use the object's name) is definitely the best option.
Like - far and away the easiest.
On an order of magnitude.
jack Idk what a GUID is or how to generate it. On the backend side we'll need to assign each apartment webpage with its corrsesponding number from the one in unreal so it works. numbers seem like the easiest way to go
They aren't, as you can see.
But yeah, I'd recommend using their name.
If you don't know what a GUID is, use a string.
And in Unreal, you can guarantee that names will be unique and persistent.
because of how your doing it? i mean the only real reason to do it that way is if the objects are being dynamically spawned in, I just can't see why you don't add the number for the apartment to the clickable object as a var and when its clicked pull the number from that object to jump to the proper url.
Even if you duplicate them.
They literally are doing that Geeky, they just don't want to have to manually assign them.
yeah. literally that
imagine going through each manually and assign its number. there are hundreds
Change your website to have the last part of the URL be a string.
ok?
Then use "Get Object Name" to get the name of the object.
Use that as your final part of the URL.
everytime you duplicate your actor its will be actor1, actor2,actor3, how they will be named, there you go got your unique ids for the website
Not in a way that you'd find easy.
I see
why not?
that's a possibility worth trying tho
ikr
Well, it's because you're not very good at blueprints.
there has to be a way to extract those numbers and there is our solution
There is a way, but it won't be easy for you.
And the best option is to just use the name.
@ocean radish does that output a number?
it returns just the number in string form, then should just be the number left and convert it to int, its rough as if you change the actors name it wont work anymore so bear that in mind
couldn't you just ....
i know there is a way to grab a string from the end terminating at a specific character but i can't remember it....
(they have '_' s in the name)
plnety of other ways of doing it, just the one i gave although the least robust is the easiest to follow
i mean there is a specific function for it
Quick one: my yaw is not yawing haha. It's a character class. Worked fine on a Pawn class, then I switched to Character class and it no yaws no mo
Any tips
i ran across a problem before with trying to get a float value to only show the last 2 digits, and it was a single function to make it happen.
using ramas or LE plugins?
Who, me? @ocean radish
no sorry @orchid garden
no not using any plugins
@trim matrix This is about as close as I can get at the moment, but quite honestly, it feels terrible. It doesn't really work well under 0.5 sensitivity so you would need to keep them from lowering the sensitivity too much. Larger sensitivities seem to work fine. The movement itself is great, but it has a serious problem of that it clamps the mouse to the game viewport. Obviously not a problem in fullscreen, but a lot of people like to game in WindowedBorderless these days. May still not be an issue there. The real big problem is that it 'sticks' to the border. So you'd need to figure out some extra math to glide it along the border points without sticking to it.
It's quite possible to make it work with some drawbacks. Possibly just needs some iterating on. But if you're fine with those drawbacks, you can certainly make it work in engine.
ah the one i was thinking of was loat specific.... but....
this should just get you the last characters from the object name from the first underscore:
@maiden wadi yea, so that's basically what I had in mind - keep track of last mouse position, find delta between frames and multiply by our "sens" to override mouse position at each tick. Thanks anyway. I thought maybe there is an easy way to do such thing. ๐
Hah. Yeah, unfortunately RTS is a bit of an undefined area in UE4. Very easy to create a lot of the tools, but that's the cost of an FPS first engine.
oops forgot @little cosmos
yep works like a charm, just tested it ๐
My Yaw on my character is not operating. The axis is giving proper values, just the character is not yawing. I tried SETing the orientation to rot, also added yaw input, which worked but too fast. Any tips?
That feeds from the tick*
@orchid garden Thanks mate!
i like reusable simple functions (like doing that search) that way if i have something else i need to use the same thing on, i don't have to stick it in a second time, can just use the function from a function library ๐
I tried that a couple of weeks ago
I think you only get these random values that you then have to scale to make sense out of them
Would love to get the same values that windows gets on the mic. But haven't had the time to look further into that
l cant undearstand it alone if anybody have time to explain it l will apreciate it
@gusty shuttle have you looked at this video by Unreal? https://www.youtube.com/watch?v=XHHAjRVBc9Y
(00:05) - Intro and Project Settings
(02:04) - Main Inputs
(03:24) - Character Blueprint final controls
(06:30) - Add Controller Pitch & Yaw
(08:46) - Testing
(10:00) - Providing touch commands
(12:29) - Mobile Preview
and also how to see current value of my programming when pressing x. This does not work?
I don't have the editor at hand at the moment, but I think there is something in the contex menu that show up when you right-click the thumbnail.
tyy ๐
@hollow drift If that prints nothing, then either that class does not have input enabled from a player controller, you're not pressing the right button, or the right button is not assigned to the DebugButtonX input settings in the project Input settings.
why cant i possess a pawn after servertravel?
he got lost in the void of www
can l change my texture media into a specific image?
when I apply a SetActorRotation on the Z value (Yaw), my character always goes to 0 first and then to my intended value
is this normal?
should I maybe only rotate the mesh?
What do you mean by "my character always goes to 0 first"? Like if you set its position to 0,0,0 ?
no, as if I set the rotation to 0 first
could you screen your blueprint?
if I dont interp, the character just spazzes uncontrollably
I do this on tick btw
and btw, you can see it in the video: it's only on move order
@olive sedge I think you should do something like that:
the Rinterp is far better to interpolate rotation
@bold moat same result
and how do you get your lines to be so strict
(It's a plugin I made called Electronic Nodes)
To my actual problem: do you know why my character turns to 0 when I call MoveToLocation?
I'm not familiar with that, why not a SetActorLocation ?
I feel like the "MoveToLocation" does a bunch more that just touching the location... But I admit, I never used such node ๐
I'm looking in the code right now to see if I can find what's up
//TODO: This is still an awful way to do this and we should scrap this task or do it right.
doesn't start well
Hello group, I am trying to make a plugging (never done one) that yields a blueprint that can be used in any other blueprints. This asks for a series of imputs and automatically adds objects (meshes and variables) to the hosting blueprint, in addition it should modify pre existing objects (from the host bp) .
The main goal of it is to be able to use it anywhere, and make it plugg and play.
My question is, what is the best way to tackele this? at the moment I have been trying with an actor-bp, that is spawned inside the hosting one, but it has been a hell to then modify objects on the hosting one.
Should I use any other type of BP for this? should I tackele it in a completely different way?
Thanks very much in advance ๐
what's a good HH:MM:SS implementation?
i tried Get Game Time in Seconds running on tick and parsing the output to HH:MM:SS but thats very unstable
like incrementing minute 10+ times when seconds hit 60
even with DoOnce
@coarse forge What exactly are you trying to do?
hi
so.. in my log tick.. i have a flag to see if its being held or not
that triggers the emissive control or not
this bp has my hold and drop logic
where.. Actor Being Held is Actor, but not explicitly the log actor
cast the actor to log actor
plug the as log actor into set
@elfin inlet that gets too tightly coupled
@coarse forge can only logs get picked up or can other items?
Maybe, I just need to see from the logs point of view if its the one being held
like call get player->actorbeing held or something
then check
The log doesn't need to know about the player
Right now you're trying to do
AActorPtr.BeingHeld = false;```
void AGopherWoodLog::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if(!bBeingHeld)
{
//Emissive Str
float currentValue = previousValue + (stepValue * DeltaTime);
MaterialInstanceDynamic->SetScalarParameterValue("Emissive Str", currentValue);
previousValue = currentValue;
}
else
{
MaterialInstanceDynamic->SetScalarParameterValue("Emissive Str", MinGlow);
}
}
When you pick up the log, set a bool or enum and reset it when you drop
You have to cast the actor pointer to the gopher log.
sure, thats sorta what im trying to do
my player has Actor, since it could be anything they pick up
thanks for all the help btw
If it makes sense to have a base class that is pickupable, add the state and events there
Otherwise, use an interface
So your reference would be of type Pickupable, not a specific subclass.
OR
You call some functions ok an interface that the items implement. I'd do the latter.
sure, right now I'm setting and checking tags
Tags.Add("CanInteract");
Tags.Add("CanPickUp");```
In my game I have an interface Interactable, and call StartInteract and StopInteract.
A door would open, an item would get picked up, a button would press, and a character would be talked to, all with the same call
that makes sense
Hello all - in a struct, what is the correct input type for Animation BPs ? I've tried Anim Instance but that doesn't seem to do it (and the color doesn't match, as these are white rather than orange) :
@coarse forge to start with you can have a base item class with those tags and custom events Pickup, Drop, StartInteract, StopInteract, and just treat all items as BaseItem
AnimInstance class?
that does seem to be it - mind explaining the logic behind this ?
Don't think you'd normally reference the AnimInstance reference. Based on what it appears you're doing, you'd want the class so that you can create an actor with the appropriate meshes, materials and animbp.
I suppose I am just not clear on what an AnimInstance actually is then ...
@white lynx GetSubstring should work for you if you just want to trim off the left side.
Ah. Forgot about the chop calls.
just wanna say thanks to those who gave suggestions on how to tackle my backpack issue still some work to do but its working so far:
https://youtu.be/amYJG2nDvuo
Looks great Geeky
It sounds like you could do this with a component.
What is your actual use case for this?
I want to make a wound system that is plugg and palay, so it can be inputted in any other actor BP like enemies or stuff.
In it, a secondary mesh is created to display the wounds instead of relying on material changes for the original
OK yeah.
I will look into components, thanks you ๐ฅฐ
Aaaaah amazing m8, didn't know of them
Can a component implement an interface on behalf of the actor?
They can implement an interface, but there's no automatic signal passing.
So you can't call like:
actor->InterfaceFunction
And get one of it's components to automatically grab that.
Booo
You can use tags to do that, kind of.
So you could call actor->GetComponentByTag('woundSystem')->InterfaceFunction
Hm ya that's pretty slick. Are the tag systems combined now or is there still tags and Gameplaytags? Haven't messed with tags in a while
so i started testing my game in multiplayer. but the 2 players couldn't see each other
so i switched them to client mode which made my screen space widgets go away
Hi, i'm trying to make a different effect based on 2 projectiles after an Event Hit. Is there any alternatives to Branch that could offer multiple inputs related to their similar outputs ?
like different impact particles?
Here is different effects : one with Add Impulse, the other with Add Force
I'd like : If Hit Event, check if it is hit by Projectile1 or Projectile2, if it's P1 then Impulse, if P2 then Force
I'm still new, and I just can't find an alternative to Branch for this
is there any blueprint node for me to identify left and right pawn movement?
once you get a reference to the owner of the component, you can implement anything to that character via the component :
@harsh fox you mean like this ?
You could use a switch, but I recommend you don't do it like I did in the example below - instead create an enum of bullet types and set each of your bullets up with a variable of the enum type that you can then feed into this switch.
@dawn gazelle Thanks for the info, i'll do this !
That kinda defeats the purpose of blindly firing and forgetting interface calls but just getting components which implement the interface works fine.
Then it looks all nice like this:
@dawn gazelle I'm working on it ๐ Thanks !
thats just to implement it directly to the character, i have interface calls that are fire and forget, but some still need to know what to fire them to.
switch on string works good for testing though, but enums give you a consistant across your blueprints to work with:
i like the ammo type idea, mind if i use that? lol
You mean the types of ammo? Go for it ๐
heh yeah didn't think of that when building my data table but that would be something to add in for damage multipliers ๐
great way to start the day
hopefully those are repeat errors and not individual ones ๐ฌ
ouch 38k errors even for a repeat thats high, some tick or timer
@dawn gazelle @orchid garden Apologize for all the questions, but how can I make the Switch recognize which one of the 2 projectiles hit the actor ? I mean, at the Selection node ?
from a hit event
Nvm I think I found what I needed
i am currently stuck with my bp. I could narrow it down that my collision box is not getting the values from the colliding object
basicly when i move the ship over it should read values from its bp waterdroplet below
but it seems not to read it. any idea why?
Don't bother with the GetClass and the == and the 2 branches - you have casts there that have "Cast Failed" which you can pipe into the next cast which ends up functionally similar. Like so:
good tipp^^
Hey guys, how's it going? I been reading about how cool unit test are, in Unity and C#. Is there something similar in BP?
Why not try doing a print after the casts as well, just to see if a collision is actually happening?
Sadly no, there is no testing library for Blueprints.
trying different things... idk why its not checking
๐ฆ
How to get an actor recognize by which actor it is hit ?
What do you mean by 'recognize'?
how do I check if there are any collisions with actor? I know there are oncomponentbegin(end)overlap but it will not work if collision already exists
@woven wing Get a ball to detect by which kind of projectile hits it, to bemore precise
Using your collision volume, call "ComponentOverlapActors"
@solemn parcel with collision box and:
"on component hit" > other actor
sounds good
thanks
You can do this in two ways. The first is to put your logic in the projectile class. So in your collision function, you would cast to the parent class of all projectiles, and then call a "DoHit" function on the projectile.
As long as your projectiles all derive from the same class, they can handle their own logic that way.
If you want to do the OnHit logic inside the Character being hit, you can do it using an Enum.
Create an Enum that contains the types of projectiles.
Create a variable on your Projectile classes called "ImpactType" or similar that is of that Enum's type.
Then cast to "Projectile" and read the property.
Either way, your projectiles should probably be in a hierarchy.
isn't my way to do so is easier?
I'm assuming they're already doing that, and they want to know which projectile type 'other actor' is.
Because 'other actor' comes in as a generic Actor reference.
then it can be "on component hit" > break hit
Not really.
If you want to know the type, you either have to cast to the type, or I guess you could get the classname and split logic based on that?
I'm assuming they want to have different types of projectiles do different things. Fire projectiles do Damage Over Time, or ice projectiles slow you down etc.
or you can just override function )
Ah, you mean to do that inside the projectile?
Yeah, that was the first option. Put the logic in the projectile.
no
I mean override "actor hit" function to take projectile type
I think the collision events aren't easily overridden.
@dawn gazelle tried to make it on cast succes but no reslut
yeah you must know some c++ stuff for that
cast failed would be too messy, since i am moving a ship from a non valid tile to a valid tile:
Either of the ways I mentioned are much easier and can be done in blueprints.
๐ค
So you're not getting a "Hello" printed?
sounds reasonable
no
ship is not fully in place, but green is set to true so ship is allowed to go there
That probably means you don't have the collision settings correct.
issue is, it is depended on ships individual coordinates (intvector, set it up myself)
i have the same setup for the pawn (yellow) but checked everything
dont see anything missing
the only difference is, that i start outside of any valid tiles for pawn
pawn can go to "J"
Move the print string to before the cast - see if you get anything when moving between them.
once i moved it does not seem
hmm
does the tile has no collision itself?...
sec
no, its set correctly
uses too the same mesh...
You sure about that?
yes
'Cause "Block All" means it functions like a wall.
And it seems like you're trying to Overlap.
both bp use same mesh
same colsettings
but apparently on the waterspawn it recognises it (red) but water(white) it does not
also just tried with overlapAllDynamic, same issue
Are your tiles Dynamic?
If your problem is 'My overlap events are not happening'. The problem is probably in how you've set up your collision.
I'd try making a dummy object with a collision volume on it and ram it into your ship - just to confirm that your ship is able to recognize collision overlaps.
it works for a similliar setup for the pawn
i checked the settings 2-3 times now if i missed something
cant find anything
Right, but did you make a dummy object that has a collision and ram it into your ship?
Try that.
@woven wing @last walrus I'm gonna be honest, i got a little lost here. 1/ Create a BP Enum with the different projectiles. 2/ Create variable for each projectile that is named after the onnes specified in the Enum. 3/ Cast to projectile and read the property ?
What you call hierarchie is using some kind of switch/branch ?
I'm really new
Ah, no trouble.
A hierarchy, in this case, refers to a hierarchy of blueprints. You can make a 'child blueprint' of another blueprint.
The child blueprint will have all the variables and functions of it's parent, and you can 'override' a function to change how it works, and add new properties as well.
We refer to collections of classes that have this kind of parent/child relationship as a hierarchy.
So if you had a BP called, for example, 'Projectile_BP' and it had two child blueprints like 'Bullet_BP' and 'Fireball_BP'. That collection of three BP's would be a hierarchy.
@woven wing the dummy collision has read all objects it has hit including the ship. The ship has send a "hello" back as it has been hit with the dummy
@woven wing Now I remember this. I got the point about the parent/child hierarchie
Totally forgot that it was possible with BP
It's pretty handy, just don't go too wild with it. Deep hierarchies can get troublesome, but in this case - pretty useful.
Nice! So that means the problem is probably in the tiles.
Yeah.
ty a lot^^ this narrows down the ice
: )
issue not ice^^
ice has been planed, but not implemented yet (bad programmer humor)
Do you have a collider set up on your tiles?
yea
sometimes visuals help, all my pickups are children of my pickup master, and the pickupmaster contains all the variables and functions needed for the various pickups, in the child classes i just need to set the variables so it knows what the child is:
no
Fairly certain they need them.
i see
interestingly it worked on the red tile without a colbox too^^
confusing
but now working
ty a lot^^
@orchid garden If I may, what do you mean by 'setting the variables so it knows what the child is'
when i open one of the child objects i get this for mine, i can change the static mesh, and the variables show up under 'Default' so i can set the variables just for that item
On the left is a Parent Class called "Bullet". It has a Variable named "BulletType". On the right is a child blueprint called "IncenBullet" it too has "BulletType" variable, but only on the right side can you set it.
(i just noticed i had 2 vars that needed set to private that shouldn't of been showing in the child lol)
๐
okkkayyy
now I start understanding this
overhaul
@orchid garden @dawn gazelle So Know that i've created the variable in the projectile class, and chaged that variable to different numbers for each child. How can I make the actor hit by one of these projectile detect which one of these projectiles it was ?
I'd really recommend against using a number.
Enums are real good at this.
that detection will be used to activate a switch/branch
In your collision event, you get something called Other Actor, cast that to your Projectile class, and get the variable from that.
(Also why you should use an enum, makes it look pretty and easy to understand, rather than just a number)
Could also do it this way, but it's not as clean and you're getting the reference to the specific bullet object class (which could contain additional information) rather than the parent class reference (which wouldn't have specific information of the bullet), however, you can cast forward from the parent to the child as well.
That's also a lot more expensive.
For most games, probably not a problem.
But checking an enum is an order of magnitude less expensive than doing a Cast.
Som
so*
I was trying your ways
until I tried this one
and still not working
I only have the 'Impulse shot' text
There is probably something I don't get, and I apologize for taking that much of your time guys
The component Hit event is on the sphere collision
If the _2 projectile is a child of the first one, it'll only ever fire the first one.
@dawn gazelle It is a child
so this is a curious question... i have a event to setup to play a sound on all clients at the triggering players location then execute the action (eat, drink, equip) but.... the action is happening before the sound plays, so even though it triggered the event first, the function continues without the event having to finish? probably a dumb question but....
So put the one without the _2 last in the list.
@dawn gazelle ffs. You telling me that it is just a matter of order here ?
It worked
In your case, yes.
damn
Since the child inherits from class FirstPersonProjectile, the "cast" would see it as valid.
That's why you, in cases like this, usually have what we call a 'base class' which isn't used in the game.
So you would have a base class of 'Projectile' which nothing actually shoots.
And then 'Bullet' and 'ShotgunShell' and 'Banana' would all be child of 'Projectile'.
Banana rounds OP.
oh so better not use a parent when it has multiple childs ?
It's more that a hierarchy creates an 'Is A' kind of relationship.
So your 'FirstPersonProjectile_2' class IS A 'FirstPersonProjectile'.
So when you cast to 'FirstPersonProjectile' it succeeds.
This is a good thing.
๐ฏ
the cast method seems more painful then enum
I agree.
And that's more painful then having the projectile classes handle the damage internally. Remember, they get the OnHit event as well.
yeah but if the enum is set in the porjectile classes....
you could just cast to the parent class, and grab the enum of the projectile... then do the math
All I have to say is a big thank you for your time guys
Need to join the one waiting for me in the bed, it's time
sometimes just sitting and reading whats going on here can be a learning experience ๐
@orchid garden Really learning ๐
Ay need some ideas
I set my capsule half height in order to crouch
But it happens so fast that the player stays in the air for some time
How can I calculate how much the player should move downwards to compensate that?
@rough wing I think the character movement component has some sort of crouching support already built into it
Yeah but I've got a system of my own and I need to make it all custom to add some other stuff
Then just use a timeline to drive the size so it doesn't shrink instantly
I'm gonna try to make the player go half the height difference but not sure if thatll work
Thats an option too
Or you can instantly shrink and also move it by half the shrink size if you need it to be really snappy
Damn I actually solved it
height difference * 0.5 * world delta seconds
Multiplied world delta seconds because my timer runs on that
how to add additional values to an already generated map?
(sorry, forgot to connect, after complete it goes to exec to the second loop)
when i read the value, it only reaches my 51 elements, then 52 index should be my second set of tiles
uh.. getting tired. Here i store my array whereby it does not store stuff where it should
i have a "Loop" in front of my spawn actors whereby i calculate which tile gets generated where. all those outputs i want to catch and put all into an array for later use
So you have two separate maps that you want to join?
yes
well not two array
there will be the same problem for maps
but for the moment i just want to connect the array together
i know append... but dumb quetion
can you twice add something in an array
does it magically just ad the new entries behind or overwrites it
In an array, sure, you can have multiple copies of the same object in the array.
In a map, the key must be unique.
ah
ye the keys are unique
basicly i generated a new intVector grid on top of my map
so every intVector is unique
i think i did a mistake again -_-
it actually stores it, but of course its on pos 6
I hate it when things get stored on pos 6
sorry to bother, i thought i had found the mistake

so what are you trying to do
but discussing the code to that would be super complicated^^
you can drag and drop the ship from one tile to the other
i set the tile to "can be accessed" -> 1
okay but what do you want to do
like what is your intention
explain it gameplay terms
not in code
so just move the ship back and forth?
what do you mean tilespawn?
i set here the color of possible tiles to be move to
at the same code i set it to be accessed
here i check if it is allowed to acces
think perhaps here is the bug
first i thought it does not store the desired tile
but thats rubbish since it gets colored in
and it uses the same map
have you tried debugging?
(the map was created in customgamestatebase from an array)
hmm
waait
if i set the cast in front of the branch...
nop
everything flies up to space
Is WaterTileSpawn a child of WaterTile?
If the WaterTile cast fails, which it would if the tile is a WaterTileSpawn, then it does nothing.
it does fail sometimes
have you tried debugging it?
as long my mouse is not over the tile. A gate is activated and condition checks when it is allowed to pass
but yes, nothing happens with watertilespawn
so must be something around cast
trying to debug
use breakpoints
watertilespawn cannot be casted i think
do hit under mouse cursor, then as it has been suggested earlier directly to cast
Wouldn't it make more sense to make your Tiles have a single function "CanBeAccessed" and have all the logic to check if they can be accessed in there?
Then you wouldn't have to mess with all this casting and specific properties on tiles.
thats what i am already doing
i change the tiles on click on the player with some boolean math that they should be accessible (boolean
Then why are you casting to WaterTileSpawn, and checking a property called "WaterTileSpawnCanBeAccessed"?
That seems a really complicated way of calling a single function.
because each single tiles has this property
so each single tile can be called individually if it should be accessible or not
i have a limitted movement range
He said earlier his base class was gridgenerator
each time a player gets clicked it calcualtes which valiable tiles is nearby
and both those tile types are children of it.
its super complicated Oo
It shouldn't be.
code is all over place
^^
tell me better XD would love to ease up stuff
would y mind to join the support voice
ill show you around
thats about the size of pawn and ship movement
This is part of the reason you're failing. If your cast fails on the first go, which it can if the tile is WaterTileSpawn, it doesn't proceed any further. Even if the next step says "False" and then casts it to the other, it would never reach this far. You need to connect them using the red line I've drawn.
What's the difference between a 'WaterTile' and 'WaterTileSpawn'?
And I'm assuming grid movement, how are you getting grid movement length?
(I haven't made a grid game in unreal, so I don't know if they have dijkstra algorithm built in)
thats my famous algorith of doom
and i have it 3 times
just here
this is just to calculate where to move the ship to
i have one for pawn for two different movement types
But uhh...
and for the grid
lawd
Oh dear.
I think I once saw a jackson pollock painting like that
What if you have islands, or other non traversable grid tiles?
it does
leme try
sec
yep
@dawn gazelle my most welcome brain superir human beeing solved it XD
it was the cast... i need to think that it ofc failed so i need to take the other route...
jack
Are you using... A*? What algorithm are you actually using?
come voice ill explain you how to do grid
Because not to put too fine a point on it, your code is scary.
until you have to refactor ๐
if someone knows it better, please help...
oh no
i have to write a map generator some day, a proper one
but at the moment i have given all tiles a intvector
and i calcualte int vectors to generate the map
You probably could've defined the size of the tile (like 25x25 or whatever) and when traversing the grid, all you need to input is the specific tile reference (like 2,5), then multiply the reference numbers by the tile size and move the ship to the new position (X50, Y125)?
I might be simplifying what you're trying to do too much.
ye perhaps, i thought of this method too
But that doesn't account for like... imagine you had a movement speed of 7, so you can move 7 tiles.
You're next to an island that is 4 tiles wide, but 40 tiles long.
You click on the empty water on the other side of the island.
It should take you like, 8 turns to get there, but without a pathfinding algorithm... you might just be able to sail across the rocks?
but it has one advantage
You need to use a path finding algorithm.
I was assuming, based on your images, that you were making a monopoly style boardgame.
lets say i start at x0 y0 and want to go to x1 y1. with my code i can go straight to it and dont have to make a complicated vetor math i think...
or path algorithm
idk, havent worked with it yet Oo
Only if you have no obstacles.
WELP
If ships can move through each other and there are no islands, then you can do it simply.
below is a random tile ( and guess what, its also super complicated made XD)
which spawns in and depending of it you can get eaten, find gold and stuff
But if the ships need to be moved around, or there are multi-tile islands... you need a pathfinding algorithm.
also you can go in a 7 like i chess
my script solved this problem
every tile which is of type X can be set to "can be accessed"
so moving to this tile is only allowed when its flagged as can be accessed
the whole range of movement is precalculated
I mean you have a pathfinding algorithm technically, but done by brute force
so your running time is something like n^2
actually it might be worse than n^2
XD
n^2 is the best case scenario
what is nยด2 ?
how fast your algorithm is
(Number of tiles to the power of 2 execution time.)
Is each island traversable? I can't tell if this is actually a problem. Like - is this like civilization, where there are landmasses, or is it more like a boardgame, where a tile might be an 'island' tile.
But there's no concept of ships being blocked or unable to move?
I mean if it's turn based you will probably not feel it
So you could have two adjacent impassable tiles that your ship needs to move around?
Because I will be really surprised if your movement code for that works properly.
Super shocked.
brute force success is still a success
it's not a cheap success but if it works it works
Sorry, I am cooking rn, so I can't stream.
I don't think anyone is interested in watching the stream no offense
you have to sell your gameplay
what do you mean by sell gameplay
you have to show that your gameplay somehow is interesting before people become interested in your game
from what I've seen I'd not want to spend time watching a stream about it
at the bare minimum you need to explain, in concise terms, what your pitch for the game is
asking people to join a stream is a bit of a faux pas
ah i understand. I was just curious why you were talking about how unncececarely complicated i did my stuff
well we talked about if it mattered
and wanted to know why. i was just like need to solve that think. dont know how but thats what i did
but tbh I'd say this is good enough as a practice run
Well i still can try^^
and if you want to make a real game out of it start from scratch
there's plenty of resources out there on how to make optimal pathfinding algorithms
most importantly, in a game, especially a game like yours, planning is more important than execution
there is a thing called technical debt
which is basically how difficult your code is to maintain, and how long it would take to rewrite core parts of it to expand functionality
you may find that rewriting your current code could cost more time than writing new code from scratch, for instance
i see
this is why many companies spend huge bucks on system architects to come in and plan/design a system from the ground up
I am trying to find a good paththinding.
A* is the gold standard for pathfinding
i see. But also viable for 1 tile movement?
pathfinding algorithms don't care about the length of your path
they just do a process
so most likely they'll do the same process for 1 tile as for 150 tiles
just less iterations
i see. i assume i need to redo the tilegeneration whereby i dictate how big a tile is
from thereon it calculates the path according to tilesize where i want to go
yeah I don't know what you've done so far but defining tile size is basically the most important element
if looped throught all avaiable water tiles, took with boolean the ones i needed accordint to the player position
think the a is deffenetly more efficient
@odd ember ty, i am already looking up a algorythm. Thats exactly what i wanted to know^^
just a last question if y can drop me a bone. What is the best approach for a map generator?
Or i just build it myself getting an image as sourcematerial whereby it calculate map according to color value of map
Wait - your ships can only move one tile at a time?
yes
In that case, pathfinding is irrelevant.
opinions diverse^^
If you are only moving one tile at a time, then pathfinding is not important.
I was wondering. When using the "Create Dynamic Material Instance" node to modify the material's parameters at runtime, does it actually create a new one? Or does it use the original material instance in that slot but just makes it dynamic? The node has always confused me because wouldn't there then be a useless material instance floating around in memory that isn't dynamic? It sounds inefficient but I don't exactly know how it works.
Has anyone got the closest 2 actors before?
(In an efficient way which doesn't use multiple loops)
One loop should be enough for that
There's a node that gets the distance for you
Get Distance To
In that case you need 2 variables to store them or an array
If you wanna store them
Or just do multiple checks with 2 returns of closest 2
If the found actor is further away than the 1st, check after if it's further away than the 2nd, if it is, Set
I just thought about another solution
2 variables
and each time a new "closest" is set
I simply push the first closest to the other variable
Im making a game where my friends face flys at you and you have to shoot it but I cant figure out how to change the spawn locations of it if someone knows how to or can help me that would be great this is my first time doing this and Im really enjoying it
@quiet kettle it creates a new, unique instanced material. I can't say what ramifications that may have on memory though. It does have ramifications on draw calls โ each unique material in the scene is another non-batch-able draw call, afaik
Once you've created a dynamic material instance, you can (optionally) save the output object reference to a variable and apply that to whatever meshes and etc. you want.
so it basically creates a material instance at runtime that doesn't itself have a disk location... I suspect if you don't save any references to it anywhere, or otherwise apply that material to anything, you can manually run Garbage Collection and it'll clear it from memory.
I never tested this but I suspect that's what would happen