#blueprint
1 messages · Page 10 of 1
I get it now
Internally the array knows the size of the element
Thanks for teaching me the tongue
And index is just the offset memory location
i need a little help with some math i can't get my head aroud. I am making a system where i check with a ui image if the player is on that part of the screen. if it triggers i do X. to make so i use the "is point in box" node. but for some reason i cant get it to work, the debug prints tell me that the player and the image are in 2 completely different places. The alignment of the image widget is 0.5 0.5 so it's origin is at the center of it. I have no idea what's going wrong
So to fetch the memory area with the actual element it just does Index *SizeOf(Element)
This is an Array, Each Page is a Element, the order is the Index
I probably just add confusion 😂
Nah you actually dont
I get all the logic but the lingo isnt there yet
Its less messy if you play around with some array of another type
any other type really
Yeh ive used float arrays and structs a great deal already
Right
just using int array now cause its important i find out which element of an existing array to use for another calculation
Yeah I get that^^
so i think im set now with the example Ryck provided :D
Oh but for final clarification, should I initialize a "temp max list" array in order to reflect the amount of elements in the list im comparing it to? or does that happen automatically during the add node here
If its a local variable its by default empty when you enter the function
Yeh alright but the temp max list array in this function would only have two elements right?
It add elements as needed, how ever many matching Max Values there are will be the number of elements in the Return array
But lets say there are two matching max values, will the index numbers then be 0 and 1? Or will they match the index numbers from the Array you pulled the max values from?
Array in {2,4,5,1,1,1,5}
Indexes are 0,1,2,3,4,5,6
Max Value is 5
As it loops, it grabs index 2 and 6 (Because their Element is 5)
It adds to Temp Array the 2 (Index0) and 6(Index1)
The return array has 2 elements(2 and 6), 2 index(0 and 1)
Again, super hard explaining an array of index refs 😛
haha
i dont get it why do ppl spam nude stuff in 2023
like ppl dont know where to get it ?
Why does "GetComponentsByClass" give me null? It never returns anything. If I have an Actor, and create an ActorComponent for it in blueprint (not in editor), and I try to retrive that component using the method above, it doesn't work
Show how you are useing it
Create how? Show code
I cant show it its complicated. Even if I showed it, it would be hard to understand
adding actor component isn't complicated?
Then we can’t really help lol
I have an ItemActor. Some of them I will create "AC_Storage" for it, some don't have it. I will create that component in the blueprint (BeginPlay) if the DataAsset says it has an inventory.
But if I get that same actor, and try to call "GetComponentsByClass", given type "AC_Storage", it will give me null.
If I prevent adding AC_Storage to the ItemActor, and call "GetComponentsByClass", it works fine, it gives me an empty array.
Still haven’t rly answered the question of how you’re “creating” this component
I create the component via "AddComponentByClass" in the BeginPlay. Target is self (ItemActor), class is "AC_Storage"
Are you adding the component on begin plan and immediately checking for it ?
why use GetComponentsByClass? you can add a variable to your blueprint, store a reference of that component in the variable and access it directly.
might have to wait a tick
Yeah you’re already doing that
The component is added in begin play, but I have to manually pick up an item with a keybind to try and add it to my inventory. By then it takes a few seconds
I might try this solution since I can't even use GetComponentsByClass
You said the ref is saved when added, why not just check if your var is not empty (isValid)
Ironically, isValid is the first thing I tried, and it still fails. Doesn't work with null values somehow. My code runs fine without errors, but it runs as if the variable is null, when I know its not null. And if I close the game, it gives me errors, saying that GetComponentsByClass is null.
Blueprint Runtime Error: "Accessed None trying to read property CallFunc_Array_Get_Item". Node: Print String Graph: TryAddItem Function: Try Add Item Blueprint: AC_StorageHandler
Huh
IsValid is the whole point of checking if null or not, it’ll never throw that error. You’re doing something wrong and we can’t see your code
Well the matter of fact is, GetComponentsByClass is returning null when it shouldn't. The code that follows can't work or breaks because of that
do you only have one ? can you Get Component (singular) ?
But , when you spawn it , just save the ref
how do I rotate an item around a specified axis? It's seems trivial tho Relative and World rotation both absolutly don't do that
I have one, I tried using the singular version, but it doesn't imply it will allow childs/subclass of that class.
did my solution work?
Haven't tried it yet but will try it tomorrow since im about to go to bed. I hope it works
By using get component you can avoid hard referencing the actor that holds it entirely
Which is normally a good
Avoid hard coupling
Wut?
GC is smart enough to recognize that if the owner get's destroyed, sub objects can also be destroyed.
Get component by class + isValid checks if it’s on the actor, afaik.
Hey guys, I did this tutorial to animate mesh along spline https://www.youtube.com/watch?v=iAay5SGeN80
It all works, except for when i animate keyframes of the blueprint position and the animation won't show in sequencer
This video will show you how you can create a spline based animation rig (like in Cinema 4D) inside of Unreal Engine. We will cover the basic setup of the spline and how to create an empty object that you can attach level actors to, for quick animation.
Shout out to Ares9323 on the Unreal Engine forums, for the help figuring out the final step...
Bps arent smart enough to avoid loading the classes you cast to
And the tying of classes together still happens , even if the object were gced
@worthy tendon I'm not getting errors with your solution, so its working, thanks! Its so dumb that I have to save an array of Components, instead of iterating them from the Actors. I still got other bugs to solve
Youd want your systems to work with as little specification as you need to avoid relying on stuff you may or may not have later on
If you accept generic actor, it will work on any actor having this componemt
Compared to just the one type you cast to
Yes. that is right but if that class is not large it really doesn't matter.
Tying classes together always matter..
Actually, Kazem I went back on your solution. I finally figured out the bug as to why GetComponentsByClass wasn't working. I was iterating from an Actor Set which I turned into an array. For some reason, I'd always get no components when calling that method.
I turned the set into an array, and GetComponentsByClass actually works now. For some reason using a set of Actors, or getting an array from that set, removes the ActorComponents from its copy? The original would still have it, I'd imagine.
Sets don't place nicely I think. In the future if I want a "set" of unique entries, no duplicates, then I'll just stick to an array, and use AddUnique instead.
Thanks everyone for the help!
Another thing to keep in mind is that get componets .. iterates a very small list of components and has no significant cost at all
~~Only possible issue this way is if you have multiple matching components ~~
it does. I agree with you, but it really depends on the project. im still not sure why GetComponents didn't work for tacticaljr.
Realistically, the cost of built-in functions is not gonna be an issue for most of the people here
Yeah you don't want to use a variable to hold components, since then you'll have to always update that variable, and if its outdated, things will go wrong. I think its better to always get components via GetComponentsByClass
It didn't work for me because I was iterating through a Set of Actors. Somehow the set didn't include the components. But when I changed it to an array, it worked
As long as you know theres only one comp, its totally fine
If theres several you'd need some additional logic
This doesnt sound like the actual reason
But if it works 🥳
Strange, I often use sets and use the 'GetComponentByClass' when I convert to an array without any issues.
Hey guys,
question related to SaveGames:
I do have a Zone(ill call it "BuildingZone") that when you enter you can build buildings (Like a farm, a blacksmith, a windmill etc) this data obviously needs to be saved so the BuildingZone has a variable with the SaveGame-Object I made. (Name of the Building, Vector for the position, Inventory for the building etc)
Once a building is placed I go to the BuildingZone and get the SaveGame variable and get the structArray inside of it and add a new one to it.
Now when I interact with the building I need to access(and ultimatively change) those variables inside of it. how would I go about this so that the building knows, for example, that it is index 4 in the StructArray(Within the SaveGame) to change its variables?
Hi all hope your well🤗 Really basic question, how would I get an Ai charecter to move to a specific location? The picture is my setup and the actor isnt moving at all. Any helps appreciated. Thanks
Do you have a nav mesh in your level?
Yes cos I have some AI actors randomly walking around
Is the destination reachable on the nav mesh?
Yes I checked by placing a secondary actor where i wanted it to move to
I would have a function on the save game object for updating the relevant building data. It can just loop through each building in the array and set the corresponding array index with the data it gets.
How would I set this up? Im still in my learning phase😵💫
"On the save game object"->BuildingZone where the SG-Object is on i assume?
oh wait no, you mean this:
tips on how
u screwed my post up haha 😄 nice to see you still workin btw 🙂
but how does this function know wich is the right index of the building it got data from?
y=
¨ha
well thats what i did before but that dont work
that just reduces the distance between the targets
i want the self "starting" point to start 200 units away from the self
do u guys emulate lag when doing multiplayer
it's not multiplayer proof until you add some lag
as in if lag compensation is not done, then some function can be useless
doing 200- from that node give pic 1 result
I mean Im asking both of u since u guys do multiplayer in bp
as i dont do competitive stuff my answer is NO as idc if something is slightly delayed etc 🙂
it's got nothing to do with competitive stuff
try to add 50 ms at least
it does 🙂 Idc if the arrow hit the player /enemy 100%(on client side), i only care what my server says ^^
yeah not even about that
no clue about this btw 😦
u guys should introduce some lag even if it's tiny bit
ask in #multiplayer , just trying to save you guys some hours
If you have the list of actors, you would just use the loop index as you loop through it.
Cold Summer how would we add some lag ?
once my prototype is done ill consider that advice,thx 🙂
Net emulation, wait
that's the thing tho, if you are developing MP game without lag you are doing it wrong imo
ah
you will find a lot of stuff that was working in a lag free world suddely don't work
Any help for this please?🙏
hmm so should u add it to the server only or all ?
what a good like default setting ?
Hm, okay. I have added an Integer to the BuildingStruct and one on the building and just compare those two for now. eventhough it wasnt your answer, it was inspired by yours,so thanks 😄
150 afaik
but that's too much even for real world
good value for test however
should the target be server only or all *
hm ok ill do it
ye thanks, fine with me 😄 ive got so many things to worry about,lag is my last concern for now, im 10month into unreal so i got loads of months ahead of me ^^
it's not about lag in a sense of delay. When things are not predicted even sprinting will look jitter and unplayable with 5ms added
well it's really up to you if you want to do it or not, but I would at least ask the wise ppl in #multiplayer if you should add lag or not when developing mp game
Took a break and came back to reading it; I completely get it now lol. Was kinda hard to wrap my head around, thanks for sticking with me 🫶
Lag is less of an issue in turn based
Most is state replication and thus can be done on clients without much worry about being remotely in sync
Games like Civilization can be played over e-mail
Agree with turn based being an easier mode in mp, but take stuff like character rotating or throwing an axe, wouldn't you need to interpolate for the clients, movement wise
in a lag free world you wouldn't need to
but when testing in packaged mode suddently they jitter and stuff
The lerp would be local
Yeah
The server only sends the delta
how would one know when to interp when they are in a lag free world tho. Would be nice to emulate real situation to at least see the problem imo
but yeah maybe it's not needed and im wrong. Haven't actually done much any mp to preach
You recieve the delta package, apply it locally
This ofc assumes local gamestate is equal to the one of the server
Which can be a bit dangerous if its competitive, so one can take measures to avoid any... fixing.. of local data
Think of it like chess
hello, i would like to ask for help, So the problem is that:
There is an weaponComponent blueprint and in that i have one bullet hit location variable(Vector) and i pased that variable using interface and cast to an human ai controller blueprint for use. But in human ai controller i am getting 0, 0, 0 for x, y and z but it print the location/reads the data in variable in weaponComponent properly.
So if anyone knows the solution for above, Pls help me!
Is it possible to build in delays (e.g. 200ms)?
give context?
like do something wait 200ms then do smth else
Delay?
yes
i mean use the delay node
I want to make skill for one of The players in my game. He must see other players trough walls. How can I do it
First find a way to see through walls
i would imagine post process and stencil would be involved
the rest is just applying the ability to toggle the see through
Try not to double ping. There’s an event onPossess you can call from the AI controller and check if the controlled pawn is the one you want before running the command on it. You can always add like a 1 second delay on your pawn’s begin play before calling the move, to see if that’s what the problem is. Otherwise, double check your pawn’s default settings to make sure the AICon is auto-possessing it right , and if all else fails there’s Visual Logger. There’s an #gameplay-ai channel btw
Thanks. This is the part I dont understand. Below is my set up for my other AI to move around randomly and it works perfectly. Why would it be more complex to move the actor to a specific location? Surely the principle for it would be the same?
When should I use a function and when should I use a custom event?
You should use function if you keep doing the same thing multiple times
when chosing between custom event or function. Consider if you have output. Custom event can't have output
Function on other hand can't have latent action. Eg. Timeline
that's pretty much it imo, kinda easy to know which one to use
Oh okay thank you
Personally i prefer functions over events even without returns
Hate cluttering the event graph 😄
And im not a fan of collapses
Me: (silently) hide my collapsed nodes
Good thing Im not gonna chevk your code 😂
I don't think you want to, even I get lost once I left the project for a week
I'm like the only one that "codes' in the team. Had to scream in caps and red color to my self just to remind me on how to not f up
Oof why would you put AIMoveTo on Tick?
Go to #gameplay-ai and watch the 3rd pinned video
You need to learn BTs
It will move to the location, pause and then walk around a bit more
It serves its purpose
lol
Its just for background ambience
You have a delay on tick
It works the way i want it to i dont see what the problem is
No need to be patronising
that's not how it work if I can give my 2cent
I wasn’t trying to be patronizing, trying to teach you how to do things properly, but it seems like you’re not interested, so that’s fine
I'm not making an enemy btw
Just a random NPC
I already know how to set up movement for AI
Putting delay on ticks doesn't work the way you think it does
I do be suprised if this work
I can send a video if you dont believe me. Practically all the youtube videos teach you to do it this way
Most youtube videos don't really teach anything proper and can be harmful in many case. That's just my personal opinion and I am not patronizing or trying to be suprieor. I consider my self bottom feeder beginner
To make NPC that move around every X seconds, I would use BT
and there is no use to tell the A.I to move every frame.
Simply feed the A.I Target location when the timer is up
Damn. I just let myself forget lol
Then i improve on getting into a project again
at least you don't have fish brain, I forget things rather quickly
Btw anyone have artifact when scaling up? I am setting my skeletal mesh component back to 1,1,1 but there is this one frame where the skeletal mesh appear taller
Don't know what else I could try
Thats what I was trying to avoid, but I guess Im gonna have to go down that route. Weirdly enough the Random movement works fine but the move to specific location doesnt work at all
Ensure the location is reachable I suppose, you can also break the movement result and print the fail condition
I hard coded Specific location in the past, it work just fine on my end
🤔 maybe try smoothing it out instead? It’s too choppy like that anyways
But nice art
like interp?
Yeah
Will try that, thank you 🙇♂️
now hear me out that you can make an interp component for size and rotation and then everything else can set the desired rotation/scale to the component and the component will interp to it
hey there is there a way to put kind of a notifys in timelines ? i got 3 sec curve and when it reachec 2.2 secs i want want my player to play some animation , how can i achieve this ?
timeline has a thing call Event curve (or something similar i forgot the name)
you can add that there, in the selection list where you usually will create float/color curve
got it thanks a lot
I saw someone using it a while ago
like custom exec pin
@lunar sleet Interp removes the artifact 👍
Nice!
How can I do so that if a line trace hits the first person character that it actually recognizes the it? The first person character doesn't really have a mesh so I don't know how to do it...
When the collision happends (eg hits the capsule component) it will return the actor of the component it collide with
look for hitactor when you break the hit result
Drag from that hit actor and cast to your FP char bp. If cast succeeds, it means it hit the correct class
So, I tried that but even though that it does hit the first person character it doesn't seem to work. I enabled simulation generates hit events on the capsule component too
any clue why im getting this error
Does anybody know how I would make a makeshift grapple hook? My idea is send a rope object where you are pointing. Then pull the player into that rope against the wall or whatever the player grappled too but idk how to do that
yeah, your character reference is not set
or there is attempt to access it when it's not set
I suggest doing it on blueprint init instead of begin play
hmm okay one sec
check the trace channel and check the collision settings of the component you are trying to hit
Did that, and it all looks good to me
What’s telling you it hit? I don’t see any red squares
Did your cast succeed ?
hey guys what does this mean? iv never had this message before - https://gyazo.com/e2c2e82f6d04a936c6c5979be02c2b9d
Sounds like an out of date pin
if im making a game that's pretty much identical in single player and multiplayer, does it make sense to only allow client/server play rather than client/server and standalone?
I complied and the message went away so strange
Not sure what this means really
Server is listenserver?
How would I communicate between a User Interface and the Level Blueprint? I tried using a BPI, but the level blueprint never seemed to recieve the call
well theres a bunch of logic that changes if you're in standalone vs client/server. im thinking itll simplify a lot if even in single player there's a server open
the server is hosted by the client. idk if im under a misunderstanding in how unreal works.
Better not to use level bp
I don't know where else to use tbh
What are you doing ?
I need a button on the user interface to interact with the world itself; Setting water height, etc
Unfortunately not; the gamemode and playercharacter are both C++ Classes, not BPs
Like… you made your own cpp extensions not blueprint editable or wdym
I'm doing this for a school project; I had to use one of their templates, the gamemode and character are both C++ classes, everything else is BP
Its really annoying, because so many of my issues would be gone if gamemode was a BP class
Fair enough
i guess another way to say this, is there any major drawbacks to always creating a session, even in single player mode
Are you allowed to create c++ base class for the widget?
I have a function here that takes a hit result, and then returns the result
the problem is that the function is returning false, while also returning the name of the object i want in this following code
I believe C++ is encourages / preferred; however I am woefully unprepared for C++ over BP dev haha!
Don’t use == for this
ah, what would you use then?
Cast to the right bp
Make a custom actor called EnvironmentActor and put all the environment stuff there.
I put my sun, sky, skylight, fog, water, post process volume, everything inside an EnvironmentActor
Press button -> get actor of class EnvironmentActor -> do the thing
you can of course cache a ref to it at startup but it makes zero difference for something like this
Yeah Adriels solution is way simpler
is chat gpt right on this one 
So basically move this (+Additional missing code for the UI-World interaction) into an "EnviromentActor"
You don't need to cast, you'd just get actor of class YourEnvironmentActor then you'll be able to do whatever with it
I'm clueless when it comes to multiplayer & replication but IMO. If the session means you need an internet connection I would presonally be against it
level BP is a bit of a trap, nobody really uses it
I can see why
Thanks👍 I think i discovered the issue. On the ground the actor moves fine, but it doesnt move if it is even slightly in the air. Is there a different Nav mesh/setting for an actor to move throught the air?
If I'm using a seperate actor over LevelBP, how would I handle the on actor overlap collisions?
through
you'd think if you make a lan session this wouldn't be true
Hey, I have a question (maybe a stupid one). To what blueprint should I load my savegames in my main menu for ui. So i can see in what level the player is.
same way.
Overlap -> get actor of class -> tell it something
I know nothing about Flying movement for A.I. probably ask #gameplay-ai guys, they would have more clue
There is no flying nav mesh / volume I don't think
There is not
will do👍
You need to have the capsule on the ground at the very least
how flying is this thing? Like flying units in Starcraft or actually flying in 3d?
you might have to write your own Logic/solution but I don't know much to comment
It'll be referring to having the server run locally and the player connects to it. Minecraft for example does it. From a development perspective, if it works in multiplayer, it'll work in singleplayer as its just a server behind the scenes.
My hacky af solution was to change the relative location of the unit mesh but not saying you should do that 😅
Just a random flying NPC just moving from one location to another nothing special
What if something is in the way?
Insert explosion
Then you are f-ed 😀
That’s why I faked mine with the relative location 😅
Done this so far! I don't think it works though 😦
That scream is concerning x_x
well I just don;t like the use of Get Actor of class
More of a gasp
some people are okay with it, but I rather avoid it alltogether
I've never attempted to do a collision without directly referencing it so
As long as you’ll never have more than one of those
Yeah but the moment you want to expand, you will have to go back to the code
have it too many and you might go through many bps
nightmare scenario for me
That node will just pick the first one it gets hehe
Yeah, there are a few. I'm basically making a rising-water system
How would I get it to reference a specific one?
Don't like being tied to a promise that I can only have one of the object in the world
Then get actor of class will 100% won't work in your case
as it will get random water from the world
wtf are you actually trying to do here.
What BP is this code in?
That seems like an expensive way to do it. One way I would do it is on begin play I would have those things sat there and then call what you have after begin play as a function from the other node without having to get all actors of class.
Expensive is kinda irreleavant probably wont cost u a frame imo
You could do get actors of class and for each loop but uh, it’s not that much better
EnviromentActor
You wanted me to do the collision by getting the actors right'?
Why would environment actor have a collision?
It doesn't, which is why i was asking why i was moving it into the enviro actor xD
IN SOME TRIGGER:
Overlap -> get environmentactor -> tell it to do somethin
IN YOUR UI:
Button Press -> get environmentactor -> tell it to do something
ENVIRONMENTACTOR:
Got told to do something -> do the thing (raise water or whatever)
telling it to do something would be a custom event
HOWEVER; I need to reference specific actors in the level
that's fine, the environment actor can do that
it's the orchestrator
it's the thing you tell stuff to, and it directs the water and sun and weather and whatever else
I would have it actually contain the water but that's up to you
Hello there, looking for some help if anyone can give it:
So, Got a Player character with a Actor component.
Got some Enums that sets weapon range and with that sets a weapon damage.
But got some error code when doing some debugging stuff.
Image 1: The code.
Image 2: The cube that is taking Damage from the Player.
Image 3: The Actor Component Code that is called when the player presses Left Mouse Button.
Image 4: the event being called.
For image 3, the last branch, i found that when it is false - for debugging purposes - it does call the string, but gives the error.
On True, nothing works.
Will I be casting to get the enviro actor?
Do you know what casting is?
vaguely. I know its not for communication
Casting doesn’t get stuff, it checks if a ref you gave it is the right bp and lets you access it
It is for communication
You won't have to cast because you'll already know it's an environmentactor
However; every time i've tried to use a BPI its calls are never recieved
you cast to go from general to specific
If you have an actor, and want to do environmentactor stuff, you'd cast
How do I get the enviro actor from the UI?
Interfaces are a bit different
Get actor of class
I've only said it like 12 times
You say "hey i want to get a ref to an actor in the world of class EnvironmentActor"
and it looks around and gives you one if one of those exists.
get ALL actors of class will give you all of them, not just the first one it finds, but you shouldn't have multiple environment actors anyway
and if you didnt put one in your level it won't give you one as there's nothing to give
Damage victim is not set (Null pointer) hence the error
The get actor of class is actually so useful, I didnt even consider it
Does get actor let you immediately access the bp’s innards then?
Trigger:
Overlap -> cast otheractor to yourcharacterclass to check if it was one of those -> succeed -> get actor of class environmentactor -> call MakeWaterGoUp on it
UI:
Button press -> get actor of class environmentactor -> call MakeWaterGoUp on it
EnvironmentActor:
MakeWaterGoUp -> do the actual water going up logic
SomeOtherTrigger:
Overlap -> cast otheractor to yourcharacterclass to check if it was one of those -> succeed -> get actor of class environmentactor -> call MakeWaterGoDown on it
There are multiple actors of "water". They will all rise in different stages
That's EnvironmentActor's problem to deal with,
it can do the orchestrating
Its basically a series of inter-connected puzzle rooms that flood.
How would I specify which water to raise without the levelBP's specific actor references
You're putting the cart way ahead of the horse
How many waters are there that can raise independently?
At the minute; 4
And on what condition do they raise?
Bool: "Is Rising"
I mean what's the trigger
Id have them subscribe to enviro manager, singular
What happens in the game to make them raise
And provide all the fantastic controls in the manager
Then you probably don't want a global manager
just make a Trigger and Water actor
Trigger has a Water ref
Oh wait. Yepp ignore me
you can set it in the level
each trigger tells its water to go up
or just make 1 actor which contains the trigger and the water
I'd probably do that tbh
See, everything already works as I want it to; water will rise when you enter a space. I'm trying to make a checkpoint system, so I need the water to reset back to its original positions after an event is called
globally or per-space?
If you still use level blueprint, that;'s not the way
Globally
Nope. It hits another object far away.
It goes right through the player
Check your collision
then no collision happend, check your collision settings
You can do that with a 3rd actor class
you already said it looked correct, but I bet it's not
Oh thank you, donig a quick refit that did work!
By chance could you help me again, it seems the Damage INT - which is set on the weapon - doesnt change from the default value.
Which im a bit confused at since Change Weapon Range works, and changes the variables - so it is indeed called from what i know.
Apologies if its a bother, and if you need other images i can provide.
First image being Setting the weapon range.
Set weapon damage is the second image.
3 total actors
GoUpTrigger:
Overlap -> tell MyWaterActor to go up
GoDownTrigger:
Overlap -> get all actors of class WaterActor -> tell them to go down
WaterActor:
do the going up and down
This seems very strange ill admit
the "GoDownTrigger" would be the UI Button
you probably want a struct if there's some actual reason you're not just putting stats in the weapon class
same logic applies
get all actors of class water -> tell them go down
Why not let the weapon itself define its damage and range values ?
to link a SPECIFIC trigger with a water, you'd just have a variable on the trigger MyWater and set it in the editor once the trigger and water are in the level
Apologies, i dont really understand that, is there a source for it?
I have simulation generates hit events settings and for collision presets I tried block all and the default one for first person character. And that is for the capsule collision component.
You can do a print string after the set to see if it's actually being called.
I have to agree with others, these are strange setups. I would re-think the design choice before you go too deep with this
Eject from your character . Open console ~ , type Show Collision
Mainly due to being new to Enums BluePrints and just testing the waters, and believing this to be the fastest method to just test if it works.
if u are trying to check againts capsule component, select your actor -> select capsule component then show picture of it's collision setting.
Also show the trace channel
oh i see, the set up in itself is odd.
Well i'll see what other methods there are.
Shouldn't use ENUM to set damage, Enum is useful to describe state.
Guess id still recommend (and argue) that a weapon handling its own logic, is both faster, better and more scalable
Char simply tells gun to start fire
Gun knows range and damage and spread and whatnot
you should have a weapon component that takes in all sort of weapon. Each weapon will have their own information including damage
how do i cast to a pawn bp inside a anim bp?
Get Owner
Why a component ?
How would you do this; I presume the way i've done it is horiffically wrong haha
Nvm 😛
Well guess it helps keeping the code reusable for other actors 🙂
So it actually makes sense
I piggy back Dynamic Combat System far too long, I don't even know anything about setting up my own Combat system
Try get pawn owner
Try get Pawn owner
Greetings! I have a more of a "design" question. In my core functionality, player can construct buildings. When interacted, some buildings can offer crafting. I am using DataAssets for storing informations. For example, i have a BuildingDataAsset for every building type (with information like size, name, cost etc). I also have RecipeDataAsset for each recipe that can exist. I also have a ActorCraftingComponent that I attach to Buildings that offer crafting.
So, my question is: Where should I define which Recipes is the Building with Crafting system is using? Should it be a:
- Property array on the CraftingComponent? (Array of RecipeDataAssets)
- Make a UCraftingBuildingDataAsset and make the DataAsset from that class, wchich will have a bonus RecipeDataAssets property?
- ???
Ideally, I would like to define which recipes is the building using in the building data asset, but then again I dont want to have a property with recipes there for all buildings (which may not use crafting). My fear is - if I (for example, by mistake) delete the CraftingComponent from that building, all my defined Recipes for that building will be lost and I have to manually pick them again. What would be your approach?
I actually changed it to a for each loop, and i think i got it!
okay now the problem here is every 7 IS VALID comes one IS NOT VALID
So i suppose on that train of thought, how would you set the weapon in it self.
If it was done by a Weapon handling its own logic, since my current set up is:
1 = fist
2 = Pistol and so on so forth.
Would it be custom events that do a boolean instead?
Since i was imagining Enums would be used to state which or what weapon is selected.
Being a bit new im a bit unsure how to visualise what you mean at times, apologies for that.
you can see the printed string at the top left
You just need to set it once
dont do it every frame
but i need to check every frame for the variables
Yes but u dont need to set every frame
You set once, then you can just grab it on every frame
this is not setting, it's getting. It is only set in initialize
yea no worries fam
For a start debugging in anim bp is like... lots of issue afaik
Yo anyone know how to use the base 1st person movement and add a sliding feature to it? I cant find a good tutoiral for it for 1st person
it should be the same logic, 1st person or 3rd person. Most likely just doing stuff on the capsule component
OK ty
the thing is one NO every 7 frames wouldn't be a problem really but the entire point of this anim bp is not working
Look. I have a vehicle which has a roof skeletal mesh component. This roof should close or open on button press. If it didn't finish yet but pressed again it just reverses at the point it was. How can i achieve that
is there a way to get the next row in a datatable?
@frank sundial https://www.youtube.com/watch?v=-iaw-ifiUok&list=PLXJlkahwiwPmeABEhjwIALvxRSZkzoQpk&index=5&ab_channel=delgoodie
what I would look at for my need but might be overkill for you since it's done for multiplayer
https://discord.gg/uQjhcJSsRG
https://github.com/delgoodie/Zippy
In this video I create the slide mechanic in a custom character movement component. I also demonstrate how to create your own custom movement mode and give you the tools to extend movement beyond just sliding.
0:00 Intro
01:24 Overview
03:30 Setup
05:57 Slide Implementation
29:09 ...
Hacky way would be getting all row names from the data table. Then you will have the index >_>
Nah that would still be an issue. Try not to look at what's printed in your anim BP.
Play in Editor then see if you actually get a NO
yea that's what i checked. It gives one no every 7 frames there too
Check if you set it somewhere else in your anim bp.
Then try to have only one bp that use the anim instance in the world then try playing it in editor again
once it's set, it should never be invalid, unless the vehicle is destroyed or the ref was set to something else
there is only one bp using that and it's not set somehwere else
is there a way i can do this without anim bp? @frosty heron
well then I am out of idea, that never happend to me
for each loop
you're just getting the first one there
i would love to know that cause I literally don't need the anim bp for anything else really besides the basic set up for this vehicle
it's an array
If youd have multiple weapons equipped at the same time id store them in an array and use an index to define which one to call the event of
All of them would have the same event "TryFire", which checks if the weapon got ammo in the mag, and whatever else that would block it from firing
If all checks pass -> FireWeapon
The way I would do it is to use montage and that require anim bp
yea but how exactly
The main thing is the animations. Its 1st person with the default movement for the 1st person template so how would I add all those animations in?
animtations are my weakness
dont u already have the animation
I do, yes
you will just play montage on button pressed
and how to reverse
have another montage that play the anim in reverse
also the roof should stay at the state after the animation was finished
and set the start position of the montage to the current playing montage
ehh no
Wrong person sorry
oh mb
So you need 2 montages. The reverse montage would be the same anim but set the playrate to -1 that will play it in reverse
I was watching this one but it has the animations and evertthing in it so idk if it would effect anything https://www.youtube.com/watch?v=unOExKGUMTw
You can purchase the completed project files here: https://ue4tutorials.gumroad.com/l/realisticslidingsystem
Mixamo to Unreal Converter tool: https://terribilisstudio.fr/?section=MC
This is the start of my parkour tutorial series. The first video will be a realistic sliding system. This shows how to do sliding with more functionality and reali...
animation is just cherry on top
it's something you can apply after you get the system working
unless you have collision in your skeletal mesh and there is something on the way
if you need prototype animation anyway just go to mixamo
Ok so this is what my nodes look like for it (not done yet had to go eat) but in the video he has all sorts of nodes for the animations. How would i avoid adding those until i get the system working?
or do i just not add them in
you can just follow the tutorial 100% though I have bad opinion on most youtube tutorials
Hm hm i see, thank you and to @frosty heron for the tips and advice.
I was intending to somewhat mimic Doom and imagined they werent seperate items - alongside wanting to test how Enums work while working on a project.
because the animation side (visually at least) is handled in anim bp
Ok
Enum is useful to describe state, but when it comes to weapon/items you want to work with data table, struct, etc.
i dont know if its just me, i rarely find use of enum these days, now that we have gameplaytag
They probably are separate actors in doom aswell
Its a design that works pretty well imo.
Encapsulates logic into the owning classes
Ok so follow the tutorial but dont add anything with animations? Is that correct
I'm gameplaytag virgin 😭
That should be fine imo
ok
Time to get gameplaytag laid
It's rough to begin with but then...
the actual sliding part prob just change the capsule height limit
and do some stuff to make the capsule slide along surface
when it gets loose
If you loved C you'd do it
I shall follow the footstep of my lord and savior @remote meteor
I see i see, well i can give GameplayTag an attempt.
Thank you.
just another pleb struggling with creating a generic effect actor that i can use for both projectile and explosions
You don’t need cpp for gameplay tags really
I use tags for everything
My quest system
Some for exposing the interface for AI but that’s it
I do start learning Data table and struct for weapons
Has channels, which is just gameplaytags
imagine a system where you can just add weapon by adding a new row in data table
So integrating other systems to it is super easy
the most i have used out of a gameplay tag is when im doing POI on a map
god damn it saves so much thinking
Is this the same system for GameplayTags? for clarifcation.
Or more so you mean Arrays and the sort - and i presume Struct is that link that was shared prior:
https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Variables/Structs/
I think he just meant that you can replace Enums with GameplayTags. When it comes to creating weapon system, you probably don't need either?
GameplayTags will be useful for abilities maybe, there must be ways you can utilize it , no comment on that part from me
Sorry i meant data table not arrays, i more so was asking about what you intended by:
I do start learning Data table and struct for weapons
imagine a system where you can just add weapon by adding a new row in data table
Since i'd say im a beginner coming from a more art point of view.
Adding weapon as a row in a dt is limiting
Its far more flexible having it as a separate class, child of AWeapon
imagine a system where you can just add weapon by adding a new row in data table
i did achieve this in my first game, it works well if your weapons are kinda like the same weapon but with different parameters
having child classes will expand the flexiblity part alot
can do alot more custom stuff specific weapons
@vernal snow And then I discover better ways
Trying to optimize my game with culling, my questions are:
Will culling effect multiplayer?
Will culling effect ai pathing / cull the enemy ai / enemy spawn points?
Are there any better ways of doing this?
change certain behavior, without needing to squeeze all of them in the base bp
listen to the wise people and do seperate classes
now I have to go in the corner, cry, then go back and re-think if I should re-do my system
depends on what kind of culling you are talking about? if your mesh is not like 10k units wide, they should be fine
on the render thread, it would calculate object based on their bound whether if they need to be rendered, and it only affects rendering, not game logics
Thank god I'm not touching the combat part yet. I just remember my old project using Dynamic combat system uses classes for weapon...
Forge forward
Dont look back
Gonna look into that, it's nice cuz we can have our own custom logic one each weapon
I see, so similar to how i presume a Master Interact would work for child classes but changed for weapons
What's wrong with classes per weapon?
Exactly, its awesome.
Nothing, I will do that. Just got a brain fart
If you do it in a dt youd wanna provide a template actor the weapon type aswell
Not 100% sure ; just going to watch some tuts to go over it to help the game's smoothness; if culling only affects rendering it'll probs help a lot.
Also thanks !
So you get the flex... but then you end up separating parameters and classes for little reason
A nice simple system is a struct and class.
Struct is what's stored and provides the stats and some data
Weapon class is what interprets the data and is what is spawned in the world
is your game chugging hard? also try to not optimize blindly, profile your game and find out exactly what is taking a long time
chugging; but not too hard yet; its more than it's quite a big map and if a players not going to the other side andy time soon i think culling it off would be good
Would you happen to know any videos that touch on this - not for weapons precisely but on the whole in general?
that's great - will watch over the vide; thanks again bud
Not really, maybe anything that does items as structs
Alrighty, thanks anyway 🙂
those culling are done by default, for rendering it is
i have seen some practice like increasing tick intervals for actors that are far away from you, but personally i think thats a lot of work to do
Maybe a good inventory playlist?
After backreading I'm thinking of revamping my weapons system
I don't really do videos, just know the basics and it'll be fairly obvious
reminds me of back then when i start unreal, the first thing i did was indeed inventory system
hey adriel how is your car project going
Same here. Worst one i ever did 😂
Some tutorial for unreal 4.7
somehow it lasted for the whole project until release
🤣
i started from 4.19 i think
Fair enough, I'm still grasping between best practices
Weapon classes is the way to go then imo
refactoring my firearm system from delay based to timer based was also a thing
Lyra probably does this ?
uhh if we consider GA as weapon class yeah i suppose
Why do you connect is not valid?
the weapon system in lyra is waay too modular 😅
What about the shooter sample
idk thats what i see people doing
now that i dont remember..
I doubt it
If the flashlight is not valid then you can't do anything to it
setting something on something that doesn't exist will result in nothing
but why does this work then
i knew it, widgets
does anyone know how i can add in these characters to replace third person default character?
That node is just saying if Inventory widget is not valid, Create one for me
do you have a better way to do the flashlight btw?
Gamemode
While for your flashlight logic you went.
If my flashlight not valid, set flashlight intensity to X
something along the line of
if it already exists, use it instead of recreating it
alright will give that a snoop
depends on what you want to do and the scale. I will try to replace those flip flops with actual boolean
game mode changes a pawn class, however if you just have SKM, and need some animation, you might need to do a new ABP for that cute creature
which one would i switch it to? the top one? or default pawn?
oh its not showing.. D:
Thank you for your earlier help; I've actually fully completed the checkpoint system by using the get all actors + for each loop combo, and it was super easy since, so thank you!
whichever one is the default player pawn
Gotts be child of pawn class
not sure why but this select node just keeps picking RED
Is yours child of pawn?
why did you chop off the one part of that window that says what is what
yea i cant find the character in the pawn selection
What is it's parent class?
Those are just meshes
you didn't make a character class
haven't*
you can just swap out the mesh in the default 3rd person character BP
😆
ohhh, i have never done this before with a new character imported
oh alright!
will give that a go
Start with just replacing the mesh in the BP you already have
or make a copy of it and swap the mesh
alright, now its in, now i gotta figure out how to have this monster moving lol
start by looking at the animation setup for the template character
if you want to use Manny/Quinn's animation, then you can look into retargeting
or if you have your own animation, then you have to look into creating the ABP for it, also can reference from ABP_Manny
ABP as in Animaton Blueprint
nope i dont have ny own animations, maya etc are too hard for me rn haha, willl focus on those later date
well you just shown your own animation though 😆
oh i thought you meant if i created my own
You want to make an AnimBP
Start with just a blend space from Idle to Run
@trim matrix Right click your cute monster skeletal mesh. Create Animation blueprint
or this!
oh okay thank you
im quiet new to this character setting up, so i have started with idle, is there any quick tips for me that can set me up? and do i need to do all these in one blueprint or in multiple? e.g: walk, run bps
One
Look at the default 3rd person anim bp
alright 🙂
now we use this
it looks like they use multiple
Your first draft of the anim bp should just have a locomtion blend space feeding into the final pose
that blend space would blend from idle to run based on speed
oh golly is there any good videos on this? im a visual learner i struggle to learn off just words
videos - that you can recommend
oh i see what your saying
how do i get the locomtion?
uh
You'd make a locomotion blend space
Those are blend spaces
make one of those for your little dude
alright 🙂
thank you for taking the time to help me!
do i right click on the skeletal mesh again too?
nvm i figured it out
do i need to make a 1D or a normal blend space
hey there im trying to blend the upper and the lower buddy
but its not blending and when the anim montage play the lower part isn't doing the movement and just plays the anim montage for all the buddy
layered blend per bone
you're telling it to play the montage over the entire body so that's what it's doing
can you explain a bit please
you need the montage player to feed into a layered blend
so it can play only on upper body
its on the spine not the pelvis
you'll want 2 montage players if you want full body montages
This overwrites everything
so i change it to the spine ?
oh wait
managed to make it, not sure where to go next
I only see one animation in that blend space
look at the example blend spaces
yeb its working sorry that slot defualt shouldn't be there❤️
thanks for the help
arent these the animations?
Are there any good references on applying world coords to spline points?
Those are just the assets you have avalable for that skellington
drag idle and run into the blend space
alright
blend space blends between animations based on numbers
you want to blend from idle to run based on speed
alright
are those links still relevant if its a older version?
sure
im using 5.1
they didn't redo the entire engine, the concepts are the same
wat
or do you mean put the blend space in your anim BP
Animations go in your BlendSpace1D which goes in your AnimBP
ohhhh and then how do i have them be working in game?
except yours will be a 1d one not a 2d one
have the example anim BP up for reference
alright
thank you!
hey @faint pasture i have successfullly added in my character etc from that tutorial, it is successfully able to be in idle, but when i move it doesnt run or anything it just stays in idle, not sure what i did wrong here
show your code~
are you sure that cast is working and properly setting speed?
yea i figured the speed might of been a bit odd, i was just following the tutorial and they did 500 for the max
but the original default was 100
you should try breakpointing that speed variable and see if it's properly being hit
Should get in the habit of doing print strings when casts fail as well. Just a tip.
Print out the value of the speed as well. I'd wager it isn't going to the value you think it is
breakpointing?
oh printing? yea i can do that
let me see
Breakpoint = select node press F9
In the sample project CropOut. When you select a player and move the curser to move them, what is it called when it shows the visible pathfinding?
sorry i dont understand
this is my first time doing this importing, animation blueprinting for a new character
and this is also my second unreal engine game so im still learning
I believe that was a question for the chat 🙂
oh sorry aha
I don’t rmbr how they do that, tho I know what you mean did you look at the code ?
yea its using niagara
just curious of what a good term to search youtube for so i can better learn about it
im guessing 'visual pathfinding'
But why Google what it is when you have access to the bp?
wish i could take a snagit but cant while playing in the engine lol
im not finding it 100% just the animation portion
theres a boatload of BP to sort through, havnt found it yet
you're right thought i should just dig through the project
The video shows where it’s being called
Cropout is a top-down Casual RTS game sample project for Unreal Engine 5 that demonstrates best practices for building a title designed for cross-platform release. Find out more and download at unrealengine.com/cropout.
In this video, Cropout's creator Arran Langmead, Senior Content Developer at Epic Games, walks you through every aspect of how...
Np, it doesn’t show everything in detail but should give you an idea of where to look
Idk much about #animation but that crew can prly help
okay i figured it out haha
i was using the wrong character i had a duplicate
lol
thank you to those who helped ❤️
yea definitely guided me in the right direction
they refer to it as 'line target pathfinding'
I haven’t looked at how they’re actually doing it but now I’m curious lol
Hey guys, quick Q, I've seen some UE plugin for blueprints looking a lot more cleaner + the lines being a bit sharper around the nodes
Does anyone know the names of the plugin or something similar ?
flat nodes
Amazing, thanks
Electric nodes?
I don't use it so I dunnoe
I'll try the free one and see if I need to spend 6 quid
You don't need to. I get by without using any of them
Looks cool, way less readable IMO
Hey Guys how dose "On notify Begin Work" ? how do iset it up
ive added notify´s in the annimation Called "Attack"
how do i do return when passing that notify
Wdym by return or passing notify?
print notify name on notify begin
idk if notifies have the concept of a duration but if they do that's how I'd expect them to work
yeah i just found that u can add a "montage Notify" on the Annimation
so scratch my question .p
Hoping someone can help with some array math, I have an array of 0-4 items (dynamic materials), and I want to tie the array to my pllayer's health (1-5) I can get the icons on the screen to disappear when decrementing, (health -1 =4, so based on current health i grab array item 4 and do the fade), but going back up it skips the next slot in the array. so if health is 1 +1 it grabs array item 2 instead of one. I can't wrap my head around it to think of maybe a better way or figure out the math
You can also create your own custom notify or notify states
You definitely need to explain the effect you want in a better way.
Health is X
You want array index to be X
From what it sounds like, you want CurrentArrayIndex to be HP - 1
since arrays start at 0
yeah, on the way down that works, but on the way up, if I increment health it goes health plus 1, so instead of grabbing the index item I just faded out, it grabs index +1 and fades that in. The effect is a health bar where there's blocks of health that disappear on hit, and when I heal, they reappear. And I'm doing it thru an array of dynamic materials in the HUD
why does it go to hp + 1?
what exactly are you trying to do
Your hp is 3, which array index should it choose? Is it always just one of them or does it depend on if you went UP to 3 or DOWN to 3?
it depends on which way I'm going. Trying to get a code snippet to show, one sec, sorry
Then you need more array indices
show a video of what you actually want to have happen because this makes zero sense.
top left is the health bar and the numbers are the current health
yeah your math is borked
how does your HP work, just in numbers
you get hit, it goes down
how does it go back up?
right now I'm just doing key presses +1 and -1 , I think i got it solved though. I'm basing the going up or down on the modifier, and then branching, so if going up I think I just minus 1, but I don't think that'll work if the modifier is bigger than 1
Is the flashing on purpose?
yes and no I can fix that later, I got it to work with this, but if you have a better way i'm all ears
I mean it should just be as simple as foreaching over the array and setting the material based on if index < CurrentHP or not
Event UpdateHPView -> for each entry in HPBarsArray -> select material instance based on if Index < CurrentHP
literally like 5 nodes
i'll give it a shot
You can also have the concept of time since last hit so you can choose to flicker those empty bars based on if it's about to regen
Hit -> modify HP -> set bIsRegenning = false -> call UpdateHPView
on regen delay timer -> set bIsRegenning = true -> call UpdateHPView
On regen complete -> set bIsRegenning = false -> call UpdateHPView
BeginPlay -> call UpdateHPView
UpdateHPView -> for each entry, select material based on index, HP, and bIsRegenning
Anyone Got any tip on how to do a simple "make Terrain(trees etc) Transparent when obscuring cameraÄ
A million ways but I'd start by driving opacity by some function of 3d position and camera and character position
or you can do it in camera/clip space with depth and such
i dont know much about the logic tree but id probably do something similar to if the camera is at 35 degree angle or greater then increase transparanecy on specific materials?
hmm
I struggled with trying to recreate fading objects when the camera approaches them for a good 4 hours, so I figured I’m probably not the only one. This is actually incredibly easy to create. If you’re an experienced user you should be able to get the gist from the screenshot. I’m going to add an extended explanation for anyone that might need i...
ill look at it ty!
alright so this is my next one i require some pointers on, so basically i have the coin blueprint (answers) as a child of the equation blueprint, so the equation blueprint is a parent of both "answers" & "open-closed" blueprints. the open closed is the text render displayed as "locked" that i want to display as unlocked when the correct answer is hit, does anyone have any pointers on this? someone had previously mentioned get parent -> cast to the class -> trigger event but i am unsure on how to start it 🙂
nice find saving that for later
also
added a Plugging tested it out then i removed the pluggin
i removed all visible nodes etc to it before
but now i cant build says its still here :/ ?
im a noob but id probably have it check for an integer either 1 or 0 then branch out from there. no idea if that helps or not haha
I’ve no idea what you’re trying to do tbh, but if you make a child bp of another bp, it inherits everything it has and at most you need a call to parent, not a cast
so in the end of this clip you can see the red door with the "locked" text, i want that text to be displayed as unlocked and the door to be green and be able to walk through it
lol nice music. Yeah that makes sense, so are you trying to access the door bp ?
target branch true false
And is that text widget on the door ?
im going to say your answer is in here
https://www.youtube.com/watch?v=29--ieorX7Q
Hey guys, in today's video, I'm going to be showing you how to open a locked door using a key. The door will be locked by default and you will need to pick up a key to open it. This will also include sound effects.
Key Model: https://www.cgtrader.com/free-3d-models/various/various-models/old-key-stylized-lowpoly
Locked Door SFX: https://freesou...
replace key with correctAnswer
yea its a text render
Are you going to have more than one door in your level?
only 1 per level, but yes technically more then one as theres this
By level I mean your map btw
Do you just teleport the door to the next “level” each time ?
the equation blueprint when duplicated will create a completely different equation etc
no
you just walk through it over a bridge
Ok so you’ll have more than one instance of this door I imagine
It’s not on the door?
im yet to figure out how to even add it in, i have been having issues with adding the actual red part to it
🤔 you might be using inheritance instead of a function
im not sure, my class mate was helping to walk me through it but was alot to process so cant remember everything haha
this sets it as true??
my struct is in cpp
idk if I should do a cpp that can set this as true. because this way doesn't work, it remains as default + if I created a reference variable from the ref struct out, same thing
How would I go about making the camera rotate with an actor but still be able to free look?
I have an actor moving across a spline but when it turns the camera does not turn it.
I know I have to turn off "Use Pawn Control Rotation" to make it properly stick to the object but I want to let the player still have limited free look to say - the entire right of the object.
If anyone is familiar with the AC130 MW2 mission the camera is exactly like that.
Wow that is really easy!
That Will be outputting a copy. You want to set the original back after
hey guys, I'm following some old tutorials on a melee combo system with queueing attacks - I'm assuming that this is much easier in the new Enhanced Input system, does anyone have a good tutorial for queueing inputs?
🤔
how can I set that member as true or change it's value?
without creating a copy
can you walk me through it?
Everything in bp is a copy
oh man.
Just gotta make a setter for that struct
Yeah
thanks
Hey, is there any way to cast to a post-process volume and set its Post Process Materials on beginplay in the Level Blueprint?
it worked, thanks
Why do you need to cast?
I just need to change the material in the first index based on a variable. Any other methods for doing that are also very much welcome.
Is there no way to resize an array inside a struct? I try to use the resize node, but it does nothing. Some other person had the same problem https://forums.unrealengine.com/t/problem-resizing-an-array-within-a-struct/303488/2 and the only solution seems to be making a temp array, but surely there's another way? My attempts at making temp array won't even work.
I tried adding some empty elements in the struct's array, and it does nothing to resize it
you can’t directly set an “array inside a struct inside an array” when using blueprint. you can do it in c++ or you can make a temp array of structs that you use to create the outer array. but if your goal is to make a grid of items, why not put them all in the same array? you could use modulus on the iterator to format a single array of obj...
If I print the length for each iteration, you'd think you'd get, 0,1,2,3, etc. I keep getting 0, 0, 0, 0, 0
Is there a way to subtract rotators?
Delta ?
Is it a bp struct?
Yes
They’re broken, especially when it comes to updating them live. Cpp structs might fix the issue
Thats dumb. I guess I'll be porting some of my code over to cpp
why is this giving me "cast failed" when playing multiplayer? That's in the pawn bp
The #multiplayer crew will pry know, that part of the engine is ruled by different laws 😀
oh yea mb
is there a channel for the Environment Query System?
#gameplay-ai you asked in the right place
how can i disable the layered blend per bone when i perform attacks or anything else ?
You mean, like, with Animation Montages?
Because if so, I recommend you check out Unreal Tutorials and Blueprints of Paragon stuff
they perform attack animations on parts of the body, yet the lower half still performs the walking animation
i have done this part to control lower and upper buddy
but the issue is when i do try to perform another anim montages like the attacking it stops the lower buddy for it so i need to find a way to disable the blending when i play them
im trying to do it this way and i know its not the best but works for now
do any one one know how to solve jitter problem while moving it happens sometimes (jitter problem)
does anyone know how this "Find Local Navigation Grid Path" node is used?
i don't know if it'll work but save the array to a new one using set by ref var and then when you finish doing your stuff with it use set members in struct
I've given up on trying it in blueprint altogether and now I'm trying to learn some cpp to port that portion of the code over
Anyone else not having splines show up in 5.3?
Mine just straight up are invisible somehow...
why does this tutorial say i need to promote the element
The issue is that the array is returned as a copy from the struct, not a reference, so trying to "Add" to the array or resize it, or any other manipulations doesn't work as it's a copy rather than a reference to the array that is stored in the structure. The only way around this through blueprints is to promote the array from the structure to a variable, make your manipulations to that variable, and then reinsert the array into the structure.
It's not necessary. If you were using the array element more than once, then you may want to store it in a local variable within a function just so you don't have to drag from the array element pin to a bunch of different places.
so its strictly for organization of wires?
beacuase he does in fact use the array element more
im just wondering if its needed
I can't speak for why the tutorial may have got you to do it. All I can say is that it isn't required for you to promote an array element in a loop to a variable.
But i believe you answered that so thank you
he adds this after
but even if i didnt promote i could drag the pins and it would all be the same
?
Yep.
@native ferry @Datura Thanks for the motivation. I think I managed to fix the bug. For some reason, the forEach loop gave me a copy of the object, and somehow I couldn't do any changes to it. My new way to do it is to just use a manual for loop, and get the struct I want to edit directly from that. The array of Structs.Get() is Get (a ref), so I could edit the Struct's array directly.
I tried porting this over to c++ but I learned you couldn't reference blueprints as types in C++. I'd have to port almost everything over to C++ and I don't like how slow it is to compile and prototype, so I'm glad I gave this blueprint another attempt.
So lesson learned: If you have a struct, with an array of object blueprints. If you want to iterate an array of that struct, to edit its array, you have to iterate using a for loop instead of for each loop. Using the returned value of the struct from ForEach won't work if you want to edit it. Especially the array. I couldn't resize the array, it wouldn't work. But if I used a forloop, and used Get (a ref), I can edit the struct's array directly and resize it.
For something like combat sliding, how do I lock the character to only moving forward while letting them rotate their camera?
I haven't gotten far enough in my game to add that, and I'm still new to UE5 too, but I'd imagine I'd do it similar to the jump functionality? I dont know if unreal has built in combat sliding, but I guess I would have a state and while youre in that state, you'd be locked in the animation and be forced to move some distance. Rotating camera shouldn't be any trouble since you can still do it, even while jumping. But if you can't, then you can toggle the camera on during the combat slide state.
This is just high level design. I don't know the actual implementation, e.g. if we use state trees, enums, etc.
yeah I'm just wondering if there's a blueprint node or something
it should do it anyway
just disable the movement input while sliding
what do you have for sliding right now?
<@&213101288538374145>
I guess with this current implementation it doesn't force the player to go forward anyway
it's kind of a hacky slide lol
why are you pinging us?
a guy deleted his comment but was linking for nudes
yeah its kinda not really sliding
if you wanted actual sliding then you should change the ground friction
then add like a force in the direction at the start of the slide
and then disbale movement input until the slide ends
HELLO am new to unreal.. I'm trying to make this simple animation play whenever player presses left mouse button. As you can see it prints hello string fine, but doesnt play the animation and also doesn't print done to console to indicate it finished. I've tried both the character mesh and the first person mesh, as well as several different animations (one of which was specifically for first person as i thought maybe the issue was using third person animation on a first person model) but none of it fixed it. Very confused any help would be much appreciated 👍
oh that's great :) I guess i can just google why there's this specific one.. It now prints ?done which is a step up.. Still doesn't actually play the animation tho :?
ya tried it with several animations.. weird how it doesn't play with any of them despite printing the string
in that case it's probably an issue with the animation and if it's referencing the correct skeleton
does the model used for the animation (as in the one you can see in the preview) need to be the same as the target character model ?
right
ok then the issue is clear thanks ^_^
np!
goddamn that was not something that should have taken that long XD
It has to use the same skeleton
Model can be diff as long as they share the same skeleton
Hi Guys Question
Im Trying to use the DetourCrowds systemn
it works but the glitching part :/ idnnoany tips ?
Does anyone know if its possible for lines drawn (Draw Line) to not be rendered always on top? The ZOrder here is 1 for the green rectangle and 0 for the one with grid and still the lines get rendered ontop 🤔
I have this custom scripted action function, what I am trying to do is, I want the scripted action to get the game mode associated with each map/level, but it keeps returning an empty string when I used the print display name, also the cast always fails cuz it's returning a null, does anyone have an idea what am I missing? or is there another way to get the game mode?
I'm trying to implement a basic pickup/drop system though the BP interface (see attached for BP, I hope it's readable + not too spaghetti) but when I pick up an item, my character movement goes out of control (see GIF - I can move normally, but when I pick it up, my character only moves backward, and moves faster than it should). I tried adding breakpoints in the movement nodes but I couldn't find the error (or any useful information, really). Not sure how else I can debug this. Help?
Why can't you get any variables or functions from GetComponentsByClass>Get? If I have a reference to an object, I should have access to ALL of its public variables. I don't care otherwise. But the blueprints is frustrating me and going against whats logical
what is the class of the reference coming out of get?
Disable physics and collisions of the item when you pickup the item. If the item has physics, then you'll have to re add its parent or back to itself after disabling
is it just a ActorComponent or ACStorage
The empty output pin if I hover is "AC_Storage Object reference".
you most likely need to disable to collision on the actor you attach to the player. If you don't do this it'll be colliding with the players capsule which can cause weird movement issues.
@tame pecan I can access the class's functions and variables elsehwre in my code fine. its just if I'm trying to get it from this array like this, it doesn't work
What is the component your getting? I would assume an actor component (inventory of sorts). Where are these nodes placed?
1 sec, ill try out something. I seem to have similar nodes that actually work but the one I posted doesn't work somehow. I'll try it out and if not, ill try to explain what I'm doing
My main problem isn't getting the actor component and trying (and failing) to call its function. It works fine under a loop, but not when I manually try to get index 0 and try to call the function from there.
This is just me trying to debug by printing values (not the best practise). My main problem is I'm trying to figure out why my Struct's array of ActorComponent references keeps getting reset to a size of 0 items. I know blueprints don't work well with nested arrays. I know that copying arrays or even trying to access them from loops will get a copy of array, instead of refs, so I've been trying to avoid using copy as much as possible, e.g. get (a copy). I try to use get (a ref) whenever possible.
But somehow, somewhere near the start of my code, even though I can successfully resize the Struct's array and give it multiple "null" entries, the moment I try to access that Struct's array again, all those entries are gone, and I'm just left with 1
The accessed nones are happening because you're trying to access the "Chest Widget" variable when it isn't valid meaning you're not setting anything into chest widget variable when you're creating it.
I don't understand what your doing with the array when your resizing it. Can you show the node setup?
You never set your 'ChestWidget' var to the widget you create meaning it will always be invalid. When you create the widget, just set the 'ChestWidget' to the return value on the create widget node.
When is this being called? Is it called in the editor or runtime?
On the actor attached to the player - i.e., the mesh that the player is picking up? I found a Set Simulate Physics, but I can't attach the item's mesh(?) to it, it says "Actor Object Reference is not compatible with Primitive Component Object Reference." (Screenshot is from the character BP). Or is this something I need to set in the BP of the item that I'm trying to pick up?
So you don't set physics on the actor as a whole but the individual components. If it's a physics based actor, you should have the root component as a static mesh that has physics enabled. If you pull from the array element (which is of type actor) you should be able to get the root component and enable/disable physics on that.
1-2) I have my manual way of doing Struct>Array variable>Resize. It works fine. I have a 2x2 tile grid, which is considered as an empty 4 item array. Everything works up until this point.
3-not shown) I will pickup a backpack with this Storage component
4-not shown) I will try to pickup an item and try to add it to my inventory (actually it will go into the backpack which is attached to the player)
A) The first time we try to access the Struct>Array variable, after initialization. This time I try to print the values, to see if we get an empty 4 item array. But when I print, I only get a 1 item array for some reason.
Extra note: If I set the tile grid to a 0x0 (null), and I try to do a debug print, we get no values as we should. So if we start off with a 0x0 (0 items), and we try to access, we get a 0x0 (0 items). But if we start off with a 2x2 (4 items), we get a 1x1 (1 item).
looking through what you've shared, I cant see the array resizing working properly. Normally, when you need to modify an array in a structure array, you normaly need to get the structure, make a copy, set structure element then add the modified structure back into the original array.
How do you populate the 'Items With AC Storage' var?
The array resize works fine. I print right after the resize node and it prints 4 times. My ItemsWithACStorage is basically tracking the backpack I've equipped so I can reference it (or multiple others). Its irrelevant and is so I can try to add an item in multiple backpacks (incase 1 is full). It works fine.
Its just that StorageTileParts.Get doesn't seem to copy the array properly for some reason. I'll try and debug print if it copied the columns and rows properly
Never assume something is irrelevant. 😉 Just because something appears to work doesn't mean it's working as you want.
What type is 'ItemsWithACStorage'?
I'm guessing my item actor should look like this, right?
yea, if it's going to have physics.
ItemsWithACStorage is an array of actors of type BP_Item3D (my item prop Actor) that is a list I have to manually add to. Its basically items that have an inventory, e.g. backpacks. Weapons and other random items don't have inventories (AC_Storage), so they don't get added
ok, how come 'StorageTileParts' is an array inside the 'AC Storage'? Can items have multiple inventories on them?
yup, I want the physics. Now I need to use Get Root Component, and then Set Disable Collision? I'm getting this error.