#blueprint
402296 messages ยท Page 822 of 403
in all 3 cases, ItemData should be the EXACT SAME STRUCT
Struct ItemData can hold the class for the world actor
so given a struct, you can spawn the actor (dropping and item)
and given the actor, you can get the struct (it's just a field on the actor, that's for storing an item)
You can use data tables as the master list but it's all the same.
So then for the world list view, when you overlap a world actor
Overlap -> Get ItemData -> Add ItemData to NearbyItemDataList -> Update UMG
End Overlap -> Get ItemData -> Remove ItemData from NearbyItemDataList -> Update UMG
pretty simplified but correct ๐
actually, there are two collision box, one on the object and another on the character, the collision box that is on the player is the one i use to detect when an item is nearby, so i get the name of this object (item) that was collide and i execute this function, where "item" is the name of that item
Tried the bool method, didn't work too
And for when you overlap an InventoryActor
Overlap -> Get InventoryActor -> ForEach ItemData in ItemDataArray -> Add ItemData to NearbyItemDataList -> Update UMG
End Overlap -> Get InventoryActor -> ForEach ItemData in ItemDataArray -> Remove ItemData from NearbyItemDataList -> Update UMG
you don't need any extra parts in your Player
you can check for collisions agains a specific part of it (f.ex. Capsule Component)
i know, is that i preferred to create another box where i can have greater control of the area where the items will appear
this is how you can make sure only specified Component is able to trigger an event
not true ๐ but if you're unexperienced then you can handle it that way
but math is your friend in UE4 / programming overall
more components = more things to update all the time, check their overlap etc.
so you just use more of your RAM
sometimes you also don't necessarily need a component persisting all the time - you can Add Components on runtime
and then destroy them once they done their job
as an example:
You have a rocket that should deal Area Damage:
It hits ground, spawns Collision Sphere (with size o f.ex. 1), then resize it to your desired size (you have to do it that way, it will not detect Actors inside of it if you spawn it with already desired size) and then perform code of applying damage
Afterwards everything gets destroyed
Figured it out mate! I'm a knobhead for using do once in the receivenotifytick @agile ermine
Worst programming habit
haha, didn't realize that as well
it's almost like placing delays in the Loop iterations XD
they won't work as we may think ๐
a lot of things to change, hard ๐
yup, hate that as well
changing and re-adapting the code again so it works with the project together
worse than i spent all night last night doing this and thinking of a way to solve the problems, thinking it was good ๐
Technically didn't need to change much. For the containers you could have used a different list view.
i cant think straight, i couldnt understand much, but i will think of a solution
But I feel you. Currently in the middle of ditching Prefabricator. Not nearly as nice as I was hoping. I can't even change an instance's collision without affecting every other prefab spawned after it. ๐ฆ
Rip !
Alternatively, you could create a new type of collision channel and make it so your component can only interact with components of that channel, negating the need for that check
have you considered making your own tool?
@dusk ember ALSV4 comes close, but the blueprint version doesn't have replication.
https://www.unrealengine.com/marketplace/en-US/product/advanced-locomotion-system-v1
I don't do networking outside C++ so I'm not sure how you'd rep it in blueprint, but somebody already made a C++ port of this which is replicated and you can expose to BP if they haven't already.
https://github.com/dyanikoglu/ALS-Community
they have some posts on their discord for setting it up to use BP as well you can take a look at
so how am i supposed to use this with the wallrunning? sorry if i'm sounding like a noob i'm not familiar with replication
you can always ask in #multiplayer
Yeah if you need specifically wallrunning you'd need to either fiddle with the C++ or restructure it some so you could expose some parameters to BP. Personally I'd avoid networking if I couldn't write C++ but maybe thats a hot take.
nah generally multiplayer is better made with cpp. I wouldn't consider multiplayer for early projects either as you're squaring the complexity of your project
hmm, ok
i'm trying to make a multiplayer fps game that uses parkour, but for now i can just do singleplayer
this is the error that is spamming and this is where its happening
<@&213101288538374145>
:no_entry_sign: samosa#3563 was banned.
Hoping to get some insight here. I'm building a topdown rpg with a single shared inventory. Considering the main character is always static, would it be better to attach the inventory component to the main character or the player controller?
Considered it. But honestly I'm probably just going to rely on soft class actors as prefabs for what I need.
Sounds like something you'd put on the GameState, or a GameState ActorComponent.
Realistically, some of the best inventories are just ActorComponents, so it won't matter where you choose to put it in the end. But if it is meant as a party wide inventory, or a multiplayer game where everyone can access it, it should probably live on the GameState.
Can you directly influence the character from the game state, such as equipping and using items on them?
Most of the times I got that error it was because interacting events were being called at the same time, causing interferences
You can have the character call the gamestate to retrieve the desired variable
that said I would put the equipment references on the character directly, to reduce the amount of times you need to interact with the gamestate
How can i get the Index from the Actor that i hit here? Is this even possible? Sorry when this is a dumb question.
how can i fix this?
also, i added projectile trails but they only appear in the client net mode not standalone. anyone know a fix?
check if you don't have another event managing your control rotation, if there is, add a rule to negate it while your wallrun check is valid
mk
I'm afraid I've yet to touch networking on UE so for that I can't help
alternatively, it could be that the way you set up your wallrun makes it so every actor of the same class try to perform the designated task while it's not valid for them, thus giving you errors
so should it be set so that it only runs on the client?
what, no
that's fair. I'm considering making some small tools to help with instancing. not at the level of something like prefabricator, but similar
Just look for something that could cause interferences
Sounds like you've done an authority switch somewhere and mistakenly only spawned that affect on remote.
to give you a more concrete example;
the latest case of that I encountered was because I had set an stat update event to trigger three events in succession: first to update the base attributes of a character, the second to update the attributes of its equipment and finally one to take the result of the previous two and combine it to get the final attribute.
The problem was that the equipment was on a separate bp component which caused an issue as the first needed more time to perform all of its math, leading to an error when attempting to trigger the second.
adding a simple delay between the two events gave it enough time to calculate everything before finally attempting to update the equipment
tl;dr: it was attempting to run both events at the same time despite the first not being done yet, making it impossible for the second to run
Hello, I implemented an interface in my widget but now the widget won't compile and I get error messages saying "overriden function is not compatible with the parent function check flags exec, final, static" and "cannot order parameters in function" Does anyone know what's wrong?
well i thought what you were trying to say was that it was running across the entire server so that when one player tries to wallrun it also checks for all other players. so, i thought that you only want it to check the one client.
Any reason your widget needs the interface?
I mean, you can run your function client side only but then you might end up with a discrepancy between what players see
(like how in early MH games, monster location was done client side which resulted in players seeing monsters in different place and thus it'd look like your friends were fighting the ambient oxygen ๐)
Lool ! Howd that pass any qa
You'd be surprised how bad QA can be.
i understand that but i just want the wallrun check to occur on the client thats attempting to wallrun, then i want it to show that player wallrunning for all others
I mean. Cyberpunk 2077 exists. That passed QA somehow despite all of it's hype.
tbf, if something doesn't really affect gameplay quality, it's not rare for the devs to let things pass so they can focus on more important stuff
It's a cursor widget and through the interface I get access to the enum that has different cursor uses like talk etc
I guess you could have the wall run check be done client side but keep the movement and animations still updating server side
whats the other way?
adding something to your function that makes it so only the character you're currently controlling is affected
but before you do that, I'd use a debug print to make sure that it is indeed an issue of several characters attempting to wallrun even if there's no wall to run
Doesnt client-side location mismatch affect gameplay quality? :p
I suppose one can alwats find things that are worse
And i get that theres a budget and time constraint
So more important issues comes first
Depends on the end effect, in this case, seeing your friends hitting nothing while their damage is still being dealt successfully is acceptable enough to give it a pass
remember that we're talking ps2/WiiU/3DS era netcode, overall stability is more important than immersion
god I'm so tired I keep making weird english mistakes lmao
so it seems that the Camera Tick function which is what causes the Camera Tilt happens on Event Tick. could this be the issue or is that how it should be?
what do you use for your camera tick?
Yeah its easy to forget how things have changed. Qa was way better in the ps1 era
Like.. no option to patch it, so the release had to be like 99.91%
Errrr, I mean... depends on the sector
๐
these are all the functions in order
there's a reason why exploits are so prevalent in speedruns. You can't have a bugfree game, it's just a matter of priorities and bug severity
To be fair. It had to be better. Updates were kinda hard. There were no day two patches, or first month DLC release with major game fixes.
I'd advise against event tick
it's called so frequently that it can cause a lot of problems
^ True. Nowadays you can get away with super buggy game as long as you do a day2 patch
is there another method?
while that's true, the day1/2 patch culture also led to a lot of bad practices
Unless you are SimCity and dont expect fanbase to flood the servers for 2 weeks
Yeah, personally i hate it.
If its not ready to be shipped, dont ship it..
An easy one to use is SetTimerByEvent
I dislike early access aswell
then you can decide how frequently you want that timer to loop
Not because of it being early access, but because of the abuse of it
And the amount of cashgrabs that just doesnt commit to it.
what's the name of the node that has the tooltip above?
Part of that is publishers though too. You'd be surprised how little control you really have over your own game when you sell your soul to a publisher.
And just ditch it once they make some promises
personally my camera is set on a 0.1s tick, it's fast enough to feel smooth without taxing the system too much
addtimeline
what event connects to the SetTimerByEvent?
timelines are also a nice way to set ticks but they're not available on all types of graphs
here's an example of how I set up an timer by event
the settimerbyevent is activated by beginplay
if it's not clear enough tell me and I'll try to summarize what's going on
so in yours you have a custom event connected to the SetTimerByEvent, but there isnt a custom event in mine. its calling a function i believe.
actually
wait
let me see something
You need to create an event first
have that event trigger the function
the connect that event to the timer so that the timer runs that event every x seconds
for example in mine:
-my attack input event checks if the attack button's buffer is active, if it is, it tells the character to attack
-my attack input event is linked to the timer, set to be ran every frame (on a 60fps basis)
-Said timer is enabled by the event begin play
(btw you don't have to type that big ass number for 60fps, just type "1/60" then enter and it'll do the math on its own, this is valid on all nodes afaik)
so it works but i have to set the time to 0.01 or else the camera tilt gets really weird
can you record a quick video of that tilt?
I wonfer why its ran on tick?
Wonder*
Wouldnt it just be event driven?
Some catch when wallrun starts and ends?
changing the type of tick shouldn't cause ticks normally
True, its just wasted i suppose
Event sets the offset
Tick checks if current rot != offset
And RInterp or whatever if they differ
that's cause your tilt adjustment is too slow
can you show my your tilt bp? it's probably a lack of RInterp as Squize said, or it's update value being too low
it was the interp speed
๐
lemme find a good value for it
0.01 is even lower than delta tick if I remember correctly so yeah, best not use that
calling on a 100fps for something as constant as a camera is a good way to mess things up if you add too many ๐
As its ment to be used
UE4's event tick is actually rarely used, it's usually kept for very specific things as it's quite ressource heavy
its a bit stuttery when i jump on/off and i think thats because its at 0.1
Well youd use c++ tick if you can/know how to
unfortunately a lot of youtube tutorials don't really take that into account and it works fine for them because each is set in their own project
ah yeah but that's two different kinda ticks hahaha
For dure
the most i know in C++ is a print statement lmao
not to mention c++ is a lot less consuming than bp so even if it was as frequent as event tick, it'd even out
But got a few hundred lines in there by now
what kinda camera do you use? boom attached to character or separate individual?
well in the viewport theres a follow camera and a camera boom attached to the mesh
i'll record it
Oh indeed
But stuttering probably is more noticable at higher speeds aswell
Increasing the interp speed
Looks like to high speed imo
Whats it at?
If you go 0 to 100 in one frame, the i terp is wasted ๐
Yeah I think your camera is updating too fast lol
its at 85
try halving it
what should it be?
I meant the camera's bp
If you're adjusting something that moves, you should probably just use tick instead of a timer.
Interps are made to be driven on tick
weird thing is, I'm using a similar setup and yet I don't have no stutter like this
I'd still consider using pure tick instead but oh well
Camera handling, movement, interps
All belong to tick
Easily gated
Well, so long as you don't overuse tick it's fine to have the camera on it
Exactly
though I must admit I'm not sure why yours is behaving like this
To keep things clean you can do it in the cameramanager
the whole problem i had was that i was getting an error spewing out repeatedly when i went into multiplayer
do you still get the error after swapping to event based?
here was that error
Also, took a while to register in my brain but yeah, it's your interp speed, because you're no longer on a 0.13s update base
ofc an interp speed of 80 will result in instant
Where are your running this code? In the character or the controller?
try an interp speed of 5
a component
That is on the character?
your camera updates a hundred time slower so ofc you need the interp speed to scale
yeah
(assuming the event based tick fixed your error)
Ok, then the error is most likely being caused because this is also running on other clients. The other clients are setting the character reference, but other clients do not get other client's player controllers.
otherwise you can go back to the regular tick
The player controller only exists on the local client and on the server.
yeah that's what I figured as well
how can i fix this?
and no matter what the interp speed is it still stutters
Is there any way to sort an array in BPs easily from integers?
Probably put an isvalid check on the GetController output, only proceeding when it's valid. Ideally the camera code would only ever run on the owning player's character.
Ideally the camera code would only ever run on the owning player's character.
thats what i was trying to figure out but i didnt know how
its because your camera is tied directly on your character
so naturally if you don't specify which player's camera you want to update, it'll try to update them all
Not sure if multiplayer is the best project at this point if im being honest
i probably wont be doing much more for multiplayer but this is all i'm trying to do for now so i at least can test it out without getting the same error repeated thousands of times
i'll wait until i understand it better
And special moves like a wall run is a bit more complicated in multiplayer too. You'll never get it working 100% through blueprints - it may seem like it'll work, but introduce any latency and it'll end up failing.
in all fairness, if you don't have the infrastructure to host the online side of your game, it's not going to serve much purpose beside getting some practice for the future
Its just a commonly underestimated complex thing to setup and run properly
yeah i just wanted to be able to test this
Would anyone know like a simple way to do so?
It'll add some realism to the wallrun, land a few step then fall on the ground ๐
It's not rocket science really, but there's a ton of things to consider
where do i put this? i tried searching for it but it doesnt pop up
๐ญ
Manually loop it and sort it
If you're searching in your component, you may need to turn off the context sensitivity.
But the sort part is the issue ๐
grab the component's owner first, then pull it from there
Lmao if I knew how to do that, I wouldn't be asking ๐
i'll probably put it on the backburner but this needs to be multiplayer. whether i learn it in a month or a couple years, i want to be able to understand it and use it within C++ so that i can fine tune it.
any interaction with controllers from a component require you to call back to the component's owner first
if you're going to use component, I highly suggest promoting the owner to a variable so that you can use related functions more easily
Replace the float with the int version
how do i turn it off?
ForLoopception ๐
๐ had it laying around from earlier
hahaha
I mean, I use a similar ForLoop setup for enemy detection
and soft targeting
where do i use the IsLocallyControlled?
Greetings I have a sphere component that generates overlap events and overlaps all dynamic. This is used to register melee hits from the character. The problem is that enemies who use overlapping detection to register hits can hit this sphere component to register damage onto the player. This is not good as I only want them to hit the player, not its melee range. How can I fix this?
I'd use custom collision channels but yeah, a tag would also work
then in the overlap tell it to ignore components containing said tag
If those are the only two options then ill use a custom collision channel because tags means I have to add a tag check to every single enemy
ty
how does this work?
Put it into a branch and put it anywhere before you execute anything that would reference the controller of a character.
would i use it here?
Probably before executing that function entirely.
yeah
ah ok
the earlier the better
I use a trace notify on attack animations that looks for hits that are proper.
That way does look lik a huge headache to get working.
if it's in a component rather than an actor bp
woops ignore that lol
it worked! tysm!!
the locally controlled fixed it
I copied the nodes instead of taking a screenshot lmao, didn't mean to do that
i'll figure out the stuttering thing later, but the error constantly outputting is gone and thats enough for me today ๐
I mean, as I said before, if it's only your camera you use the tick on, that's fine. You can go back to it.
it's just keep in mind that in general practice, bp event tick will quickly hit your game's perf if you rely too much on it
Even c++ tick does!
yeah
but bp tick has the added deficit of bp being a major ms killer by default ๐คฃ
Have it ignore WorldDynamic
Is there a way to make the door open smoothly in Editor instead of snapping into place?
Im using a custom event to open and close the door but it snaps into place rather than just opening like it otherwise would on runtime
i figured, is there a better solution? Or any solution to this LOL
May i ask why you need it
simple curiosity
Then no , there is none
fair enough
is there a way to spawn a plane by getting the locations for each corner?
Show your curve
in the timeline
(I'm assuming you have a curve because that's the way you would do it)
rn this is it
it was at 0 to -90
im testing some math stuff to constanlty add rotation until a value, so that it opens
basically need a way to find 2 points, and create a plane using them
Where is the 0 to -90
It looks like it is going to 1 which will look like 0
this is the graph from this stuff
Instead of using Play From Start and Reverse from End, try using Play and Reverse - this way if it's triggered again, it'll just resume from where it was.
You can either have your timeline output from 0-90 or 0-1, but 0-1 would require an interp node of some kind.
a mathematical plane or a plane mesh?
i tried Play and Reverse but neither one does anything
mesh preferably
Is your door mesh a child of pivot?
yes
Just spawn a plane static mesh (I think the default one is 1m x 1m).
Its scale X will be Height
Its scale Y will be (B-A).Length
Its rotation will be (B-A).RotationFromYVector
might be hard to see in the video, but in the outliner, its pivot then SM_Door
thanks
OH you're doing it as an editor utility widget...
I don't think timelines work in editor.
ye, it works on play, i just want to see if i can get it working in editor
Ok so
the top picture is in my player character
but the problem is on M1 press
The ai that have the same animation Blueprint
also attack when I hit M1
I not sure how to design around this
Show the anim bp
I have a BluePrint for a patrolling enemy, he goes to 'location 1' then to 'location 2'.
I'd like to have multiple of these enemies in my game though. Do I just duplicate the BP and change the locations or is there a better way of doing it?
@faint pasture Is above
Duplication is not the answer. You'd be better off making a "PatrolPath" actor that's specifically for setting up patrol paths that contains a vector array that is exposed on spawn and instance editable, and set"3D Widget" to true. This will allow you to place a patrol path actor, and add vectors to it and place them around the level where you want the thing to patrol.
Then on your AI, you can have them set up with an exposed variable of the "PatrolPath" type. When you place your enemies in your level, you can then select which patrol path they should follow - your AI should instead read from the patrol path they were assigned (if it's valid of course).
If you have an actor for spawning AIs, you can have them set up with a patrol path variable as well which you can have them feed into the spawn node.
You can make the patrol path actor a bit more advanced by having options for looping or going back and forth and wait times for each point.
Kismet libraries have functions to draw shapes.
In 3D I mean.
DrawDebugBox, DrawDebugText, DrawDebug etc
Ah, yeah. In that case, simple shapes and materials or Niagara emitters work well.
If the AI have the same animation blueprint, then you don't want them casting to your get your player character to get the values - change the input to the cast to "Try Get Pawn Owner" - this returns the character that the animBP is tied to.
Hi all, does anyone have any "good" tutorials on rendering a 3D object in the game world (outside of the main playspace) into UMG? At game over, I want to display three skeletal meshes, they'll be animating. I do actually have it working, following this tutorial:
https://www.youtube.com/watch?v=BnLHBJMX0cE
...but there's a minor problem in that the colours after a bit washed out - and I cannot for the life of me work out why, nor do I really know enough about materials in UE4 to fully understand everything thats going on in the tutorial.
How to render a live actor to your UI in UE4 using render texture targets and the scene depth captured from your camera to mask it out to whatever background you desire.
Ah, thank you! :) I'll try this out.
I hate discord so much...
First image is what comes out... second image is what the border should look like..
I don't see why not. For basic shapes they're pretty easy to manipulate. Sphere, Box, Pyramid, etc are already in engine if you use content examples. And Sphere and box are easy to scale since they're at 100uu size.
Isn't much different if you make your own. Just have them at a default size that you can scale. Alternatively there is a plugin that allows you to create meshes procedurally. Little bit overkill in this sense though I think.
Hi I have a server rpc that calls a multicast to run a attack animation montage
that montage then has a trigger which calls a server rpc
that server rpc then applies damage to things
when the server uses it the damage is correct
but when the client uses it the damage is doubled
the animation runs smoothly on everyone
but the damage is doubled when used by clients
how can I fix this?
Hi, I've got a bit of a question. I would like to see if one of the objects my object is colliding with is my spawn_zone which is a blueprint that is spawned. I'm trying to figure what actually goes in my array
Try using the class of the object instead... Loop through your array of overlapping actors, then for each item in the array, compare the class to the class you are looking for. Might work.
You're also looking for the Contains node.
#multiplayer and you may want to show some code surrounding your montage, like how the damage is dealt.
does anybody know how to detect if the players health (a float variable) is below 20 health? im trying to make it so a blood vignette appears when they're below 20 health
was able to fix it anyway the solution was to not run an rpc to do damage
When applying damage, check if the player health < 20. If so, display your vignette. If not, clear the vignette if it is valid.
thanks
@tranquil abyssFound your problem. Instead of using Get Player Character, use Get Owner or whatever
You want the anim bp to get the actor it's on, not the Player's character
like this?
Yeah... although you might want to use a For Each Loop with Break - that way, if you find it, you can jump out of the loop, rather than cycling all the way through - assumes you're only interested in "one" etc...
Also, try what Authaer suggested also, regarding the "Contains" node, you might be able to just pass in a reference to your Spawn object instead...
Depending what you're trying to do, it might be easier to tackle the issue from the other side... e.g. have the spawn_zone detect the collision and then respond accordingly...
yeah that's probably a better idea
Really depends on the context, but you'll know which is more straight forward/appropriate etc - anything that saves you looping through things lots of times is a win ๐
Does anyone have general tip for hit detection- when I swing my weapon I can hit the same enemy 2 or 3 times
I have tried Do Once and resetting
but that never seems to work
this is my damage logic
in my ai that is
Might not the best way, but you could try creating a boolean variable (not a local one), perhaps called "IsProcessingHit"... within the logic for dealing with the hit, place a branch to check that boolean first. Only proceed if its not already processing... then, at the end of your processing logic, reset the boolean so that it could be hit/processed again..
As I say, may not be the best... but might move you forward...
You might want to also consider resetting it in the OnComponentEndOverlap event too... maybe...
Anybody have any suggestions n why this is happening?
Iโve stripped the project back to nothing, and have this standalone. Itโs when both UMG are hidden, and then when I bring them back they bug one of them?
It looks like its a "focus" issue... e.g. after you'd hidden both panels, you clicked on the top button but it didn't do anything, as if it was focusing the main ui widget, first... then the second click hit the button
Here is the entire project
I'm not using any form of focus, it's running an animation.
Cant open that with my current version of UE4... the map file doesn't appear, all I get are a couple of enums...
Sorry..
Which version of UE do you have?
4.26.2
Ah, itโs in 4.27
Sorry. It looks like a focus issue though... I'd check the UI widget you have for buttons and check that you are setting it to be focused etc...
Easy way to test the theory... run that exact test you did in the video, but before you click on the top button to bring one of them back (after both being hidden) - click anywhere on the screen (not on a button) - then click the top button...
trying now
i'll make a 4.26 version
Hi @keen wedge , tried that. Still having the same issue. I click someone on the screen prior to clicking any of the buttons for it to return.
So you click anywhere, then you click on a button and it appears, yes?
Nope
What, the button still needs two clicks?
il'l record what's happening
I'm spliting screen with the Create Player node on Begin Play of the** level BP** and saving that reference in game instance when I open a new level and check the game instance the variable returns None in Begin play on level BP ... Any ideia?
It's actually causing the issue to happen immediately.
I'm spawning an AI actor during runtime, but when they spawn they are not assigned an AI controller. How does one assign an AI controller to an actor?
If you can create a 4.26 build I dont mind having a quick look..
Weird Widget Behaviour
@fickle nebula are you using absolute travel? That will dump the current instance and start fresh
what method are you using to open/close
how I know?
This is how I'm telling it to identify the type of animation to play.
And this is the blueprint that plays the actual animation for the UMG side.
absolute has to do with the path, not functionality
If you follow the same sequence, but close them both with more time between them does the issue still occur?
levels are always flushed
which is probably why your reference is null
because it doesn't exist
should I save in a file?
If I close them, and make sure that one always stays open. It seems fine, but the moment that both of them get closed and come back something happens.
in the game mode you might have an option for a "seamless travel" actor list
these are the actors that are carried over between levels
I can't remember if it's exposed
oh ok
by default player character, controller and game mode should be in that list
I checked that
but if you have multiple players then that may be different
yes but you have to use the list as well
I'm mirroring tha character
I don't know what you mean by that
right but it's still a separate character that you need to add to the list
with, probably, its own controller
What is happening in "Check is Already Open"
If I create player again on the next level is going to be 3 screens, so I thought I could just posses again that one I first created
yeah but since levels are flushed when changed, you don't have a reference to that character
I've uploaded a copy of the project in 4.27
the next level
like I said
your reference doesn't exist
Your issue is occurring in the Widget Animator Play obviously since it's detecting it's "Open" when you click, but not playing the animation.
because the level is flushed
the reference of the character?
yes
event if I just placed it there?
is the bool in Check Already Open unique?
if you want the same character to persist through levels, you need to use the seamless actor list
The odd part is, it works really really well when you continuously click it. But when two are on the screen at the same time they seem to be impacting each other. Which doesn't make much sense, as they are 2 different widgets.
yeah it ok, I just want the camera to posses the new one
that is the only way
right, something has to be overlooked somewhere - from what you've shown the Check Already Open is the most suspect...
isnt it weird not executing something in the begin play?
if I use a breakpoint on the cast to game instance, it wont stop
I'm really not following
ok with this node it worked
but now I need to delete stuff from the previous level
nvm, I'll try to work with a persistent level
navigation raycast??
I came up with this...
So, I spawn my "spawn_zone" actor bp after my building gen bp is spawned, and I created this to detect what "building gen bp's are colliding with my spawnzone and delete the ones that are" and it doesn't seem to do anything. Got any clue why?
Best "guess" would be that they are not deemed to be "overlapping", e.g. not in your array of things you're deleting.. throw a PRINT node in that Loop and spit out what's in it... alternatively, remove the "DestroyActor" node temporarily, and replace with a PRINT node, then append the name of the actor that is effectively going to be destroyed...
Alright, so I threw in a print statement and it shows nothing.
So, either nothing in your array has that class... or, maybe there's nothing in the array...
you can use a LENGTH node to get the size of the array, try printing that out before you loop through... see what you have..
thanks, looks solid.
you might need to set your collider on that GetOverlappingActors node too... where it says "Self" etc... depending on your setup..
also.... check the collision presets to see that the objects/presets actually can cause overlap events with each other..
how can I do that?
in the collision tab right?
okey... so everything is set to "block"... not overlap..
should I use custom or one of the presets
you could test with one of the presets first, but then you may want to create a custom one later, along with perhaps an object channel... try changing to OverlapAllDynamic and see what happens
you might get something in the PRINT
right, changed both collisions and there is still a 0
did you set the GetOverlappingActors node to have a collision volume reference going into it, instead of Self?
e.g. the collision component
yeah
Is there a specific collision volume component on that cube?
dont think so, I just added a component cube
Does it have "Generate Overlap Events" ticked on it?
yup
...and what about whatever you're trying to collide with it?
is that set up the same?
Yup
So BeginOverlap and GetOverlappingActors are not doing anything at all for you?
Yeah
can you zip up the project? what version is it?
I'm running 4.26.2, will have a look if its quick...
Yeah, there are events that you can add also... OnActorBeginOverlap and OnComponentBeginOverlap... its kinda hard to do this blind without knowing what you've got set up, how its set up, and whats going on...
I dont have that version installed I'm afraid..
https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Collision/OnActorBeginOverlap/
https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Collision/OnComponentBeginOverlap/
On Actor Begin Overlap
On Component Begin Overlap
Yeah that's all good. I'll take a look at these
Do I need to set this object as a trigger or is that not a thing in Unreal Egnine
Unity background?
Yeah.
I like Unity, I understand it but I feel like Unreal is better for what I want to do.
From memory, there were triggers and colliders weren't there? UE has overlap/hit...
Yeah triggers and colliders
so the triggers are your overlaps..
the colliders are the hit caused by something being blocked
so I just tried this out, and it's not outputting. Something is wrong with my colliders and I'm gonna just delete them and work from scratch on em
I would try adding a specific collision volume to your blueprint... and then test against that specific componet...
I'm gunna have to call it a night now... its 03:43 here and I'm exhausted..
Yikes, all good
Take a look at this... the overview may get you started:
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Physics/Collision/
...and then the How To takes you through in small steps ๐
Sounds good, thanks for the help!
No problem, sorry we didn't get it sorted for you... gotta go... good luck ๐
Thanks! Bye
how come in gamestate it's not letting me do the reference with the dropper thing? if I put this in the level BP it will let me.
Cause Level BP has access to Actors in the Level
Depends what you need
I need access to an actor in the level
Is there only one of that type or many?
Get Actor Of Class would be the easiest way
gotcha
thank you again man
it worked
this has been bothering me for a bit but you helped bunches. I appreciate it a lot. Thank you very much!!!!
Is it bad form to extend static mesh component? I have a gameplay-related scene component that is always combod with a static mesh. Is extending static mesh fine for this (basically making a mesh + gameplay functionality) or does that smell?
Like say you were making a WingComponent for aerodynamics. Would it be bad form to have the parent class of WingComponent be StaticMeshComponent?
ill give you permission if it makes you feel better about it
I mean does it feel gross? It kinda feels gross.
I'm already 3 layers deep into my modular vehicle system tho, I don't wanna make a PowerPort an actor
It'd be Vehicle has Engine has Powerport (has power port component?)
It's stuff like this that makes me wish we had Godot style scenes
well we extend actor class and have visuals + code
would do the same for actor component... so then if staticmeshcomp has everything you want anyways...
Just wondering if anyone has a good system to swap weapons and play a specific character animation and weapon animation but both of them are triggered from a single montage. Is this possible? Right now Iโm just playing both animations simultaneously but that kinda messes up my combat system. Any help or link to a good tutorial is much appreciated!
how can i implement the intarface in bp?
i inherited it right click the function implement
event appeared i did print and nothing happens when i call the function
Show what you have. Show how you're calling it
did it only in c++ so far
thought it should be working ๐คทโโ๏ธ
sooo any insights? why this could happen?
id help but i dunno cpp >.<
from a bp standpoint, there's a caller and receiver, I see above that the event call is for the receiver, if the code below that is for the caller then it should fire and be received. Regarding the caller (at least for bp setup) the call to the bpi needs the target as a reference (the receiver)
ok so the thing is
this is how i call it
and the cast is not working i assume because i add the interface in BP
:/
as mentioned, i dont do cpp, but i dont see any reference to the target - casting to the interface is not a target, it should be some actor
like talking between the player and a light switch or something
Trying to figure out how to pass along a variable (location vector) from a blueprint that contains an actor, that spawns another actor from a blueprint.
To give an example. Think a house that is spawning an npc. I want that NPC to be able to know the location of the house that spawned it. I was thinking I could maybe link the two by using the Owner tag in SpawnActor to then somehow reference the owner in the blueprint of the spawned actor. But after some googling I'm not sure that's what that does. Could anyone point me in a good direction to look/read?
I'd like to be able to reference the "Villager Spawn location" from inside the villager NPC blueprint.
the target is the act, i assume
you need to have a variable for this location to exist on the class you are spawning. Then you can set that var with the one you have here. Or you can have the spawned class get it's location at spawn and set it because that's essentially the same location
i think the cast is wrong but i dont know cpp, try #cpp
yeah works in cpp, but apparently have to work differently when i wanna use bps
i only do bp so i can help there, but im lost with the hybrid use of the two
Thank you! So I did have that, what I was struggling with is figuring out how to set the variable in the class that i'm using as the spawn target. I was thinking maybe the getOwner function but it returns an object and I wasn't sure how to get the variable out of it.
And yes you're right I could use the current location at spawn as well. But I'm hoping to make this a generic villager class I can attach to many different things that spawn it. I figured it would be smarter to "attach" it to the BP that spawns it.
well since you are playing with options, just know that there is a return value of the spawn actor node which is what you just spawned. So there is plenty you can do at that point
After spawning the villager, have the spawner set VillagerSpawnLocation
it'll have a ref to the villager and its spawn location by definition
I believe I've already done that before even actually spawning it, that's the SET that then pipes into the spawn transform location. What I'm trying to get is the spawned actor to pull a variable from the actor that spawned it.
BUT as @brazen merlin said, I think if I just pulled it's current location right as it spawns it shouldn't really matter... I think I was just overthinking it.
Then just set MySpawnerActor ref or whatever
The return value of the spawn actor node last bit I don't quite understand though. But I figure in the future it would be good to know how to get info from the spawning BP anyways.
Spawn Villager -> Set MySpawner on the villager that just spawned to Self
That return value is a reference to the spawned actor
OH... I think I get it. 1 sec
like this. Cuz i'm getting the spawned object as a return value like @brazen merlin said, I have a link and that'll fill the value at the other end. That totally makes sense. Thank you both!
I'm still unable to figure out why my "spawn_zone" bp cannot detect these "building_gen" points. It can detect a player but it's unable to detect the small little cubes. (the big cube is my spawn zone and all the small cubes are my building gens
hmmn, wait shit. I just tried that, and while it picked up the variable "spawn location" that exists in the villager blueprint in the set function at the end, when I tried to compile I get this error because that variable doesn't exist in the spawnning bp/actor. (which in this case is the well)
Show the collision settings for both boxes
Recreate that set node. Drag off the spawn villager return value and set the spawn location
does Villager have a variable SpawnLocation?
yes it does.
I'll try remaking it.
huh... werid. it works when i remade it. But it looks identical to the one that errored out.
Yeah it mighta been stuck trying to set some variable with the same name or maybe you changed the spawn actor class after making it or whatever.
why are you storing VillagerSpawnLocation tho
id guess that the error was because it was not compiled if the variable was made on this spawned class
Gotcha. In any case that helps me understand that a lot better. Thank you again.
I want to set a patrol from it's spawn point to a central "village hall" actor on the map.
So I wanted to have the starting and ending vectors to make it walk back and forth.
Yeah I think I hadn't compiled it on the villager class.
nvm, it says it could not not find it in Well_BP, so its the wrong set node
It's been years since I did any real CS. can't believe I didn't catch that return value. Makes total sense now.
I would just set spawn location on begin play. It'll by definition be where it is when begin play fires.
Then it's dummy proof, don't gotta remember to set it
Yeah, when conrad mentioned that I realized I was overthinking it. But It's a good lesson learned for next time I do need to pass along some sort of variable.
I want to have several different classes spawning the same villager class. and they all remember their individual spawn locations is why. But yeah no reason they just can't check at spawn time.
yeah it's weird, it doesn't register anything else except the player
Okay, I tested moving the piece and it works, it just doesn't work when it's spawned into the zone
Does anyone know a way around this?
Nvm, all good did something and fixed it
Yet again asking for someone to try and help me understand this
Please let me know if I need to elaborate
anyone know of an easy way to set visibility of a mesh on a certain frame of a montage.
anim notify
Ok cool thats what I was thinking
I shared a snippet for that yesterday
This
<@&213101288538374145>
:no_entry_sign: Slygear#8224 was banned.
i need object to move to a player, but it goes to falls locations and idk why. maybe smb understand why?
Is there a reason you aren't using the ai move to node?
but its a static mesh
What's the parent class? Does it have character moving component?
No idea what yoy are trying to do, right now you're only storing a reference to the class
I really don't know why this isn't working
I've tested it without procedural mesh component and it works fine
I've also just called the create grid function once without a forloop and built the mesh, and I was able to move it around
@zealous fog love the pfp
Is there a way to create a timer within an anim notify blueprint?
Hey. I have the 2d paper template and I would like some help on the character moving to a direction when the level loads and I couldn't find any tutorials
You'll all have to give some more explanation about your problem, what you've tried to do to solve it, what you are trying to do exactly and preferably show the BPs
Haha thanks!
This is the BP and I tried Unreal's own tutorial on the endless runner (customizing it to 2d https://www.youtube.com/watch?v=yS-yQfo0lc0&t=254s
In this video, we discuss the type of game that we're going to make and begin by setting up the player controls.
You dont need the branches
Or you need to know what side he is moving for another function?
You are moving btw just really slowly
Try increasing world direction
Scale only goes from -1 to 1
You dont need the second branch at all anyways
You can just plug it into the set bool
i figured it out myself
Not the first one either
somehow
Depends on if he needs to know if the character is moving right
Hi! I created an inventory but when i pick up the weapon it doesnโt attach to the playerโฆ someone help me
Branchless logic ๐
Oh how do you set that up?
Set the bool directly based on the condition
Just ditch the branch and plug the condition result into the bool
Oh yeah that's true
Does it matter much? Besides looking prettier
Performance wise
Not anything you'll notice
But branching is error prone
Theres always an extra possibility for mistakes when you branch
Fair point
Have you debugged it? Where is it going wrong?
Not yet
Hello, does anyone know why Simple Move To Actor works for moving my player character but Ai Move To doesn't? The Ai node would be more useful.
Then do that first
๐๐ป
Does it have an AI controller? I think you need one
It says that Ai controller class is AIController in class defaults under pawn.
Show the BPs
There's a Set AiController Class node, mayb that would work? Never used it myself.
Class defaults or class settings
It has an ai controller in the setting, but I assume you posses it during play? Because then it has player controller I believe
Oh, I see. So you can't use that node for player character then?
I just need to have the player move to an actor when clicked on and I need to know when the movement is complete so it's at a certain distance from the actor
Top down game? You can just have the "player" be an AI if you wanna do AI stuff with it
But maybe you can just get the distance between the 2 and then stop the character from moving when too close?
Yes, you're asking if the directions are equal however that's a really small margin
You should instead get the direction and add a margin to it, and ask if the rotations are within that margin
You're asking the thing on the left
One really specific rotation
You should ask on the right, if my rotation within this range
0 is one rotation, x is another, find out if y degrees is between 0 and x
And this is 2d btw
So depending on what you wanna do, you also have to solve for the z axis, or you can decided to break the rotation and only use the x and y axis
No scrap that
Brain fairt
This is just for one axus
The z axis
If you wanna do it in 3d you'd have to solve for 2 or 3 axis
So I would keep it to the z axis for simplicity
Have you googled it
I'll have to try that then, thanks ๐
Or would it be possible to turn the player into an AI temporarily?
Hi i have problem with world composition when loading and unloading tge level there is little lag is there any fix for it??
Probably yes
You'd have to look it up
I dont know how but I imagine it should be a pretty normal feature for an engine
Hey there, I have this delegate here (which took me a long time to figure out cus I did it in c++), what do I do now to broadcast this to my animbp?
how...
and maybe.... why?
delegates broadcast to their subscribers, so your animBP needs to subscribe to your delegate
well if you know how to make a delegate, how do you not know how they work?!
event dispatcher is the name used in BP
the functionality for adding subscriptions is Assign or Bind
I have this USTRUCT:
USTRUCT(BlueprintType)
struct GAME_API FSSPInventory
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<AEquipment*> Equipments;
};
But in blueprint, I can't access the Equipments TArray. How come?
yes it's nothing to do with BP
Hello guys, I added mobile input to the screen, but when it is damaged by AI, all touch is gone. Anyone know the reason for this?
ask in #mobile perhaps?
oh sorry. My bad, im new on here
I'm trying to open a level but it won't, so I have created a Menu that opens a "Town" level when pressed on "play" and then in that "Town" i have a button saying "Fly" so if pressed another level should open but it doesn't. It weirdly moves me into some random place in town.
Here is the town
When i click on Fly i see this
Found the issue, "BlockAll" collision caused this problem.
Can anyone explain what the delegate means in the last block?
It's an event that gets called when the ai is spawned
The node is perhaps asynchronous
Hard to say for sure because that doesn't look like a default UE node but rather from some plugin
The spawner delegate node is just a custom event, any code you put on that exec line will fire off. As zomg pointed out, looks like it will do so when the actor is spawned
Oh I feel like I was asking my questions in the wrong place so I'll repost it here and delete it from where I just wrote it
Hey, I'm trying to figure out how to make it so if a player presses a key while in a specific area (trigger zone) it transports him elsewhere but I am unable to call the inputaction to the BP where my triggerzone is
I have this set up as my interact event right now for testing
and nothing shows up when I look it up through my reference
Is there a better way to retrieve variables from a character than using cast to? I ran in to problems with using cast to when switching characters.
Alright thanks
Yeah it's a custom engine for making mods for a game
you should look into interfaces
cast to their parent
Ah, yeah that would work.
I'm not familiar with the particulars of Launch Character node, but in the trigger bp (or level bp) you should be able to get the character reference from the trigger and you could set a bool from there called "overlapping" or something like that. Then you could put a branch infront of that Launch CHaracter node checking this value.
I wont be using the launch character node, it was more for testing purposes so I suppose i can switch it to a print node instead
You'd need to return false to the value when the character is no longer overlapping
Ill give that a go real quick
Lets see if I can pull that off without my brain exploding this late at night, thank you!
you should be using the OtherActor pin instead of trying to get player character
you have two separate problems essentially: registering that the player is in a specific place, and whether a player has pressed a specific button
yes
so that will check all actors that pass through
but only if they are of the class you are casting to they will pass through
how you do the next part is a bit more finicky
if you have interaction in your game across the board, I recommend thinking of system for interaction where objects/actors in the world register themselves to the player, and based on some conditions that you can set up, the player interacts with what you want
to be very honest I don't have many systems right now, its a pretty empty project
I am doing this for a class project and we don't have to make a whole game just a working level
in that case
you can make it so you just register a single actor at a time
I would be doing this in my Character blueprint or my object blueprint?
ideally in the controller, but character in your case will do
yeah that's fine
it doesn't matter
basically your registration code is what matters
and that's in the character
alright
for simplicity's sake, it's worth implementing an interface for this
The quick and dirty approach (what I mostly know) would be that branch method. From the cast BP you could pull off the As BP Skjorn (presuming that's the player character) to set the bool. You need to create the bool variable and compile it in your character bp first though
then create a variable of that interface inside your player character
I have one called Enter
okay what you want is an interaction interface that has a Use function
have you setup inputs in your project for a Use key?
nope, thats where I got lost
I made a BPI_Interact
and added the interface to my character BP
you don't need to add it to you character
you add it to the objects you want to interact with
bingo
next, create a variable for your BPI_Interact inside your character
just a variable
can I call it interact?
call it something like CurrentInteraction
yep
never made a bpi var b4
crazy innit
yea crazy xD
so now off of your Interact action, get the variable of your BPI_Interact and drag out a pin to the Use function
Hi all, in a chess example... if i want to change the piece colour to yellow (selected) and later (after deselction) back to default colour. Function Vs Custom Event, which one to prefer and why?
functions have return values and are expected to return instantly
events can do whatever you want, including delayed/timed functionality, but cannot have return values
is this what you mean by getting the BPI_Interact variable?
feel like im setting it rn
ooh
right.. i read that... like in this case, anything will work right.. should i prefer function or event?
you have to make your own considerations. I don't know your use case
correct
awesome
now
go back into your object
that you want to interact with
add the interact interface if you haven't already
donezo
then where we were with the cast node
you want to pull the character BP's pin and use it to Set CurrentInteraction to Self
self as in the cave's triggerzone?
yes
get a reference to self
type self or this inside the context menu
add it to the yellow pin
cast it
correct
am i casting it to the right thing xD?
- Implement the
Usefunction on the object itself
- Make sure that when the player leaves the object's area it zero's out the interaction
Instead of bpi reference?
no it couldn't
How so
because you don't know what the object needs to be that you want to interact with
yep so remember to cast again
you only want it to happen if it's the player character
Object in this context would always have to be an actor, wouldnt it ? Placed in the world..
not all actors can be interacted with
how do ya set it to nothing?
leave the pin empty
No, but those wouldnt set themself to the interactable actor
And even if they did , it wouldnt react to the interface message due to no implementation
you could not register the interaction functionality without the interface in this case
so yes, the interface is necessary
is this the most optimal way of doing things? probably not. but it's a quick and dirty way to get it working well
have you read the entire thread? literally we're using the interface calls to ensure that we can use the interface. if we didn't have the interface, what would be called on the actor?
no, remove the yellow pin
oh right right
Target should be your player character
that's all we need brother
and just do whatever you want to do on that function basically
under functions?
did you implement the interface?
yep
no
aight
that would imply using it as soon as you enter it
implement it as an event or function
that clears things up
and add the logic you want to have happen onto it
and here I would put in what would happen
wonderful
and its only being called because of this part right?
yes. we're registering the interaction to be current
because that's where the player is
it's not perfect
it doesn't account for a lot of cases
but for a simple project it'll do fine
you can do the same type of logic for any number of actors or objects and they'll work all the same, as long as they implement the interface and add themselves as a current interaction
it workeeeed
well duh
Intefaces dont throw errors for nullpts afaik
Mine doesnt ๐คทโโ๏ธ
a call won't trigger a nullptr
but if you have a pointer to an object, then that pointer can be null, whether it implements an interface or not
what does reference to self call in the bp for the character?
forget reference to self
aight