#blueprint
402296 messages Β· Page 641 of 403
Theory question, looking to create a 'volume' or at least some way of knowing if a player or actor is within a certain area which is non-standard. Ideally based on the outline of a closed spline loop.
Even more perfect would be something I could modify at runtime. The world would have multiple of these 'volumes' and each one would apply different effects (post process, area name drawn into UMG, change player combat stance, add player buffs, etc.)
My first thought was creating a flat mesh from the spline shape, and having a trace down from the actors which finds out which zone they are 'above'. However this is limiting as it doesn't support overlapping volumes where some changes might be additive, or volumes above/below another one.
Any thoughts on this. Basically it's a more complex shaped collision volume.
You could think of it as an RPG region volume, I guess. That's basically the use case
I guess my question is more, anyone aware of examples of something like this? Also a possible method to creating a mesh or some kind of volume I can get overlapping actors from π
Hi, I would like to possess 2 pawns at once, how can I do that ?
I dont believe a PC can possess two pawns.
Not 100%. But you might have to make a controller that sends inputs to two different pawns
Yes, but how can I do that since "add movement input" doesn't work if a pawn isn't possessed ?
Im trying to add values 1,2,3... etc into this array but it doesnt work. Does anyone know what is going wrong?
why it isn't this piece of shit working?
i literally spent 4 fucking hours trying to make this work
and boom doesn't work
π
Pretty sure each wire from the Make Array gets its own copy of it, so the add node basically adds that to a throwaway value. You'd need to assign the array into a variable (or just make a variable to begin with)
hmm I was hoping the temporary value would just hold it all instead of making a variable. ill try to make a variable and see if it then works
oh this just works.. im kinda mad i spend an hour on this
Hey all, does anyone know of a way to alter a timeline's animation. Eg: Make a timeline animation slower or quicker using a variable?
NVM, got it I think: Dropping it here if anyone else needs it. Noob issue I know but I am indeed a noob.π
what im doing wrong?
someone please explain me
like i tried everything
and this piece of shit doesn't work
ahhhahhahashshahdhsahdhahsd ha fuck this
It doesn't look like there's anything wrong with it at a glance... Have you tried printing messages to see where it breaks?
Like, does it trigger the overlap at all?
Right - so if the overlap doesn't trigger, then it means the collisions are not set up right for it
collision set right because it detected im in damage area
Okay so at least that's working then.. let's see
your event is called TakeDamageDPI_1 but the function call is calling TakeDamageDPI
That might be the issue
so one tiny thing kept me 5 hours remaking code
oh boi it's gonna be lit
heh
i really suck at this
shit happens
π€£
You might want to learn how to use breakpoints and the debugger if you haven't tried it
Another method which can help with problems like this is try to isolate the point where it breaks
For example you can put a lot of prints into the graph, so you can see how far it goes
If you can find where it breaks like we did now, you'll have a better idea of where to look for the problem
you can also try this: https://en.wikipedia.org/wiki/Rubber_duck_debugging
helps me find typos π
Further to my question earlier about regions. I've managed to create a ring of collision boxes along a spline, which would give me an overlap or hit event. However, because it's just an outline of boxes, I can't reliably tell if the player is within the ring. Because when entering the ring of box collisions, it'll trigger an 'end overlap' event. Any ideas how I might use something like this to determine the player is within the spline area?
For blueprints, how does one get the ad bit working, is there some other code that needs to be done other than this? https://docs.unrealengine.com/en-US/SharingAndReleasing/Mobile/Android/Ads/index.html
Using the AdMob in-game advertisement system on Android.
@indigo bough Maths. Calculate distance between points or something haha
Not really sure if it'd work, but you could try getting closest point on spline, and then checking which side the player is on
@indigo bough You should give different names to each box that are outside, then give different name bases to inner sections maybe ?
Thanks folks, I think perhaps the nearest point on spline with some distance math is the easiest route to go long-term. Time to learn maths all over again π
Yeah, the complex part is these volumes basically change based on player input, so I can't guarantee really any size, direction, or shape parameters
Hey guys so I am new to unreal and in the future I wanna make a game like zelda breath of the wild is this possible with only blueprints?
Yeah, a few people are doing it π
So itβs possible?
Anything is possible, really
Alright itβs going to be a lot of learning but I am in for it
Maybe start with something smaller to get your feet wet
Or pick just one system to focus on
Yea thatβs why I said future
First Gona Make a lot of small project
Thx for the help cya
i came here for a nice community, and a for a small proposal
I have in mind
a game, a duel game, set in medieval times
Called "Band Of Bastards"
and, alone it's a bit difficult
so if anyone's up for it
just dm idk
Btw
Hope it would work, i have tons of medieval assets
blueprints aren't different than c++
post it in #volunteer-projects
Uh ok
in terms of quality
is there a way to make it so the player doesn't get hurt while also recovering armour?
I have custom characters, their shape and size can change drastically. Thin to fat etc etc. My question is how can I have accurate collision with those different shaped meshes, the game will have guns so I plan to use line traces. Is there a way that I can update my collision accurately to reflect the morphs the player chooses for their character?
Uhh
there should be
a way of changing the collision box
or whatever it was called
instead of substracting armor and then checking if you have no armor, check first if you have armor
you can do it from the 3d viewport
is it skeletal mesh? you can have tight collision for skeletal meshes (usually done for clothes simulations)
Yes, Skeletal mesh with various morph targets that I plan to bake when the player has finished character customization.
you should have a "physics asset" related to your skeletal mesh π€
Guys, sorry, is it normal that i cannot write in #volunteer-projects? (I know it's offtopic, just asking)
What I see just now is a very large and basic capsule, I believe reducing its size would be ok for collision against walls etc, but for weapon damage it would be inaccurate ( from what I understand). It also does not update according to the adjustments to Morph targets - so when I make the skeletal mesh thinner it stays the same size etc.
Hello everyone. I have a question:
Do object instances have associated .uasset files? That object's corresponding class is associated with a .uasset file, but what about each instance?
Dm? thx btw
Direct message
Yes got it, thanks alot
your physics asset is a set of simple colliders for each bone/mesh of your skeletal mesh. They should rotate and adjust as the skeleton moves
I believe ue4 is saving that instances as some kind of redirector so that it nows its specifications to create each instance on runtime in the editor when you open them up. But i might be wrong as well mate...

Hey there. How would you get the index of an Enum within BP ? I have this :
the error is :
The current value (NewEnumerator0) of the ' Target Map ' pin is invalid: Map inputs (like 'Target Map') must have an input wired into them (try connecting a MakeMap node).
an enum is an integer π€
is a range of integer represented with labels
isn't it ?
he won't accept it if I only connect the Enum element to an int input
you can also try a "select" node
was it a select? π€
it's like a switch, but no excecution pins, only values
lol isn't it supposed to set it automaticaly ?
nope, select let's you specify any value for each value of the input (in this case, your enum)
Sorry Elemental, I am not being ignorant :). I appreciate your help but I am getting a bit confused. Do you know of any quick way I can view my physics asset updating as I change my characters shape? I just want to check that when my skeletal mesh changes through morphs that its physics asset updates.
also : can you call a none existent index on an array within BP ?
for example if I set the index 2 while length is 0 would it set it to index 2 ?
Or do I have to set all indexes within the default value ?
there is a Size to Fit box you can tick to expand the array π€
plug something into the red wire there π
inside the editor, you can tick the thingy to see colliders:
during gameplay you need to run something on the console... lemme google....
show COLLISION on the console π
bring the console down with the ` key. The one to the left of the 1, under esc
Let me show you what I mean. Sorry for being a pain!
That is an exaggerated example, how would I get the collision to match that. Or have the line trace hit the mesh
ohhhhh, I am not sure how to do that... maybe having different physics assets and swapping them? :S
possibly, I have no clue unfortunately that's why I was hoping that the skeletal mesh shape itself could be used as a collision (just for line trace/weapon) rather than relying on a physics asset as the amount of customization options will make an accurate collision hard to achieve that way :/
you can probably do a line trace and in the channel specify the "character mesh" channel π€
Expensive AF but might work
For skeletal mesh that would be "Per poly collision" I assume?
If it is expensive then I will probably have to look at another solution
what is it that you are doing? π€
game idea you mean? Online multiplayer thirdperson shooter
on shooters usually your character is merely cosmetic π€
your hitbox should remain roughly the same
Players are going to be able to have a really thin character or fat character though, that would end up with inaccurate hit results unfortunately for me
everybody would use the thin one π
I have thought about this haha - however it would be a strange experience to get a definite hit on a body part and nothing happen for larger characters or even miss and get a hit on thin ones :/
I have a function. It does a thing. I want to run that function n times. How would I do that?
So I have an int var that can be altered. When the parent function is triggered it will run the subsequest one n times
the run N times node?
wut?
Where?
Nodes that allow for controlling the flow of execution based on conditions.
do N times
my bad
oh, sorry, that doesn't loop on it's own
if you want it to do 20 times the same on it's own, just use a for loop π€
For Loop looks like the way to do it perhaps.
Just not sure how to say... do its 5 times now. Then maybe do it 8 times later
have it go from 1 to a variable
I'm not sure why this isnt working
If I remove the delay, I get all the messages in the log
But as soon as I add a delay anywhere nothing happens
your loop breaker is redundant. once your loop ran enough times it will stop by itself
I was just following the example
other than that, it should work
use the break wire in case you need to stop abruptly your loop. if not, let the index run its course and it will stop by itself
Just only seems to spawn 1 enemy
how many times does it print? π€
also, you can double click the "loop with break" node to see how it works internally
Can you have latent nodes inside for loops? Maybe it only spawns first /last
pfft. Cant figure it out. I will try another time
Probably end up doing something stupid like this
can someone help me
how would i detect flat land
on a terreain
every planet i need to detect a flat surface to land
I just checked and the delay node will not register if its already counting down
use timer
How flat? You could have an approximate shape of the spaceship and do a line trace down from the middle, then move the ship say 10 units above the point the trace hits the landscape, if there are no collisions/overlaps with the landscape you can say the land is 'flat'
well its a tardis
Really depends on your setup how exact you want to be
so legit a flat square
so it checks the planet for any flat spot it can land and it lands there
this is chosen while in flight
Yes but surely you have some leeway where it doesn't matter if the ground clips into the bottom if people can't see it
Well you could approximate by discrete points
i'm deciding between the voxel plugin and PGT procedural generated terrain plugin
i own both
hey i have some weird stuff happening
In one of my levels a blueprint controls that if there is a tag and it hits player it will kill the player. ok but one level doesnt even have that BP in it and still when i enter the tag to actor, it can kill me. Do the settings save onto next level even if i open it from my editor? I have no save system or anything else
nothing written to gameinstance and game mode either
its a bind event on actor hit in my levels player spawner
and when i open a level where there is not a spawner, it still kills me if there is a tag that can kill me
Do bind events stay forever then?
@dawn gazelle hi
would anyone be able to help me with this? i have a spline, that i have an actor that travels along when the player overlaps it when you trigger an event, works fine, but i want to be able to tell when the player is at the end of that spline, how would i get the location of that spline point?
What is the advantage to using gameplay tags instead of enums? It seems like both are mainly used as a way to find an object referenced by some sort of tag. In my using gameplay tags for maps, I'm just thinking it might be better to use an enum instead
Anyone know how to line trace from an enemy to the player properly? I can't seem to get it to work right and following normal logic just shoots the trace off into unexpected directions. I need to be able to have the actor check if the player is within sight and not blocked by anything and it can't use AI Billboards.
How could i make my players camera rotate around a level?
Feel like its very simple but im just trying to learn something
it's spawning one because the delay enqueues a unique task and then the loop continues immediately
Best way to get the amount of seconds passed since I pressed a key?
Hi all. Can anyone give me any clarity on in what contexts you can and can't use Timelines? I've found that depending on what BluePrint context I'm in, I either do or don't have access to Timelines and so far as I haven't been able to suss out the pattern.
If someone can give me a "rule" that Timelines follow as far as when they can and can't be used, I'd be very grateful.
Anyone know why unpossessing a pawn wouldn't render a controller variable invalid?
how can i cast to bts?
@sleek pecan can't be used in a function (because a timeline is a "latent" node) and it can't be used in a BP component cuz I think timelines are part of the actor class? This is just my vague recollection. If you want to roll your own timeline-like thing, look into curve assets.
@tight schooner The function seemed clear enough and yeah, the component thing seems clear. I just don't understand why exactly. I guess I can just look at the engine if I really want to find out, but "not in components" seems like a good enough rule in addition to "not in functions" for now
Thanks!
One other question: Does anyone know how Blueprint Arrays' Add function works? Are BP Arrays backed by Vectors on the C++ side or is this just some function that basically implements push_back for C++ arrays?
hey im fairly new to ue4. I've made a project in a way that if a player walks over a box collision, he will take a 5% damage (function). He can Fire weapon through custom event. but when i the fire function is triggered, the begin overlap is stopped and it gives me an 'Accessed None' error. any solve?
Maybe you have a bolean that needs to be reset ?
could be, i will check thanks
When you do your overlap you should double xheck it's the player overlapping the bpx and not anything else (like the bullet), only then should you trigger the event
"AccessedNone" means that you tried to get data from a Reference/Pointer that is invalid.
You need to post the point in code (with surrounding code visible) so that one can actually tell you what you are doing wrong.
Does anybody know what this even means in a landscape material ?
how can I locate mask 1110
Hi! I'm getting weird snapping troubles with my camera and I can't seem to figure out why.
I have a thing that dynamically adjusts the camera to compensate for camera lag, as in the above graph
A secondary graph lerps it to the desired position
This is what actually happens.
Thanks!
oh yes thats the problem. thanks so much. it was trying to take hp from the bullet which is impossible. thanks
anyone know why spawning actors causes stuttering ?
How many actors are you spawning?
one
Does that Actor do anything expensive on BeginPlay or so?
not sure how to find out what might be expensive
cast to controller, sets variables from data tables, couple of calculations and sets timers
Are you auto possessing it with ai controller? Or is it player controlled
Ah my bad you are just getting player controller or something?
yeah, im getting a ref to the game controller
What BP do you spawn it in
ui menu
Need to show the BPs
Is it at the very start of the level you have anissue, or are you spawning midway, or both?
its when there are lots of enemies in the level, but it aint that many, around 80
Probably just a lot for it to process then
@keen bluff you are remapping to (-0.5,0.5)^2
if that was the case then its would gradually slow but it just stutters a bit then carries on
all code is removed from Tick everywhere possible
If it has to process too much information at once it probably causes ms spike, look for ways to optimise
im trying to optimize but it seems to be small gains or im not looking in the right place
@runic path use the console command Stat Unit (or Stat Raw if you want a cool graph) to narrow down if it's a gamethread issue
if it is, then you might need to use the Session Frontend to profile BP
(there's also the newer Unreal Insights tool but it doesn't seem to record per-BP execution times)
The stutter suggests that it's something transient, like maybe loading an asset or idk
You can also use some deduction to narrow it down short of using a full-blown profiler tool, like if there are 40 or 20 or 0 enemies, is the stutter mitigated? Is something particular happening in the game when the stutter occurs? etc.
0 enemies zero stutter, once that number goes up thats when it happens
Can i remove , add items to instance editable structure
Anyone potentially know why spawning in an actor would remove focus from a widget? π
Hello, how can i make a phone mechanic like it rings at the start of the game and whenever i interact with ti ringing sound stops playing and the main call sound starts
How can i tell my enemy that im blocking. It currently hits me with a sphereoverlap.
My player has a blocking variable i use for playing the animation amognst other things
Hello !
I was wondering if it was possible to assign an enemy spawned via a Spawn Point to a spline track.
Currently, I have a Spawn Point and 3 different spline tracks. The enemy are following the Spline Track I chose for them when I place them directly into the scene, but they don't follow any Spline Track when spawned directly via the Spawn Point because they don't have any assigned.
Thank you for your help !
When you sphere overlap cast to your player character, then check if bIsBlocking is true, if its true then block else deal damage
@tacit maple ok thanks.
I've been trying to make that and failing. My problem is that the delay execute only once so fi let';s say 10 things are added in the buffer only one will be removed at the end of the delay
if anyone can make me understand how to create and empty an array buffer please let me know!
my problem is the delay node only fires once no matter how many times it has been triggered
I would need a node that would delay each input
now is 123in - 1 out. I need 123 in - 123 out
I'm created a system that does that using real time seconds and repeating a delay, looks bad but it works wahtever
Is it possible to instance a mesh in one BP then reference it in another? Am trying to make a city for an endless runner for a game, and creating the mesh instances in each tile is creating too many draw calls so im trying to figure out instancing the meshes once on a master blueprint then referencing them into the tile blueprints
whats the time span between firing the event?
is it less than the delay time?
Would something like this work for you?
After the delay you could also call another function or event for additional processing.
I think what you may be having trouble with is that you're looping through an array and then calling your removal event which has the delay in it, but for/foreach loops effectively execute for all elements within the array at the same time, and delays indicate on them that additional calls while it is counting down will be ignored.
after the remove index, you could check if theres still something in the array and call removeFromMemory again, so that the delay restarts, but that would give you a fixed 0.5s time between removing elements (basically what datura just showed you in the screenshot :D)
also, im not sure if you only want to remove it from the memory, you probably also want to remove it from somewhere else, wasn't that the main goal!?
yeah mine ended up looking like this more or less
1 add to map, 2 trigger delay 3, delay 4 keep going
and in 1 I collect the time it was added to the map
this is what I came up with
how can i solve this without doing 2 timers
equipped weapon 1 and 2 are the same masterclass
or whatever its called
both are child of a master blueprint
You want the timer to be started and stopped on both at the same time?
On either
So only 1 timer?
yes i think so
Is the "AttackTrace" function set up differently on both objects?
no the same
the master weapon has attacktrace and the subweapons have their own trace from that
I got it working, not sure i can solve it any nicer beacuse im not really sure what im doing.
Ill go on till it completely breaks
thanks
in BP what do I pass into Unbind Event methods? Is it OK to pass CreateEvent node into them, or do I need to save result of create event to a variable?
like this
Hi guys, if I want to make an analogue clock that follows a day night cycle in-game (so it represent the time corresponding to sun position) - what kind of options do I have? Is the only way possible via event tick adding a delay and then rotating the hands by x degrees? If so, is it taxing on performance? If not, what other ways are there?
If you don't care about the second hand moving smoothly, then you could use a timer set to looping and firing at 1 second intervals, and then calculate where the hands should be on the timer's event.
yea for now don't really care about the hand movement - the rotation method is pretty much here, then there in its motion and that's fine.
Wouldn't the timer also still depend on event tick to figure out how long a second is?
No. Timers are independent from tick. By default tick fires every single frame so if you're running at 60 FPS it executes 60 times in one second, and this is where it can be taxing on the system depending on what you're doing on the tick. A timer only fires when it needs to, so in this case if you set it for 1 second, it'll only ever fire once per second.
you could also set the Tick Interval in the details tab of your blueprint
Hey guys. Is there any easy way how to save UObject in SaveGame?
I see. Would I be able to connect the timer to the day night cycle relatively simply? My intuition says yes but lemme know :p
Is that wise to do, considering lots of different things would use Tick?
lots of things shouldnt use tick, you should avoid where possible
The timer would just an event that fires every second. From that event you can do whatever calculations you need to do every second to make your clock hands where they need to be using whatever values from your day/night cycle.
Thanks
Tick can be good in case of UI in world when it should face the camera, in example
Each actor can have their own tick interval set. So you can technically set something to tick every second and not impact every other actor out there, but then that actor's tick will only fire once per second so you can't use event tick for making something happen smoothly like lerping.
Hi, would anyone be able to guide me on how to accomplish this:
- I'd like to lean and look past corners in a horror game. The problem I'm struggling with is when I'm next to a pillar, I need to prioritize leaning out from the edge that's closer to my character's current position.
I'm currently achieving this by running a line-trace to find if I'm firstly close enough to a world static object to lean over
then I check on either side if I'm close enough to the edge to lean and be able to see around the corner
(by running another line trace on either side)
the problem I have right now is that I have no way of figuring out which edge is closer (and therefore prioritize leaning out from there)
So you're already running two line traces to get both edges?
It just checks if I'm still colliding with that static object on either side
if not, then it's possible to lean on that side
in case of pillars
both corners will end up with the line trace not hitting anything
(hence allowing me to lean to the first/last side I've run a line trace for)
This is how it is right now
if that first line trace collides (the one originating from the player's current location), I check first for the right line trace, and then for the left line trace
Run 2 more horizontal line traces? First line trace lets you know distance to the pillar, so run line traces back to where that hit from the right and left ones.
I can make a quick screenshot for ya
or just calculate the distance of the first hit from the origins of the two side traces
The two side traces always happen at a fixed distance
I basically need to compare the edge distance for the pillar (or any other corner when both sides can be leaned on)
Something like this. First trace checks for the pillar, then you use that impact point. I skip the trace to see if the side is leanable, but then check from that side, plus 10cm forward, back to impact point + 10cm forward.
I am making these orange traces basically.
You can then compare distance of both of those hits.
Thanks, I'll give it a try
Won't be perfect for any non-square columns, haha. Round ones should be okay, but any irregular shaped walls will be problematic.
Will the perpendicular traces give me a hit at the end of the pillar?
It should hit the corner, I added 10cm forward from impact point of first trace.
Also, when you compare distance, it is greater distance of trace is the closer side:
This should be the directions. Trace should run back to the pillar horizontally and hit the corner.
Thank you!
I am creating a character creation system that is based on morph targets. These can slide from thin to fat. How would I go about getting the value set by the player and instantly applying the same amount of morph slider to the clothing that they are wearing?
you would just have it linked up in the exact same way so when the value changes on the arm it would change on that section of the clothing a as well if the clothing is broken down into individual pieces , we use to have to make morph versions of each body part and anything that was attached to be able to mess around with morphing it,,,,,but this was udk3 like 8 years ago. but i know ue4 can now change sizes in game so im wondering if the item of clothing is attached to a bone and mesh and then the value of them is changed does it auto change the size of the clothing ? or do you still need to break the clothing up into different parts so each part can be morphed?
Can anyone help with running a line trace from a non AI actor to the player? I tried to follow the general way of setting one up from the character to anything else, but the line trace goes all over the place. My player is a vehicle pawn. I can't do a sphere trace for this use instance as it needs to be line of sight only.
https://www.youtube.com/watch?v=8HzjyfjMK5I&ab_channel=SimianLive as you can see its been a very long time and things have changed alot, only just getting back into it my self
This is my vinyl toy custom character that I'm using as part of my dissertation.
I am using a flash menu system, in front of you is a static mesh of your character.
my menu lets you change the material textures and RGB values in real-time.
The next video shows how my character can morph.
You shouldn't need to cast from that GetPlayerPawn, and you shouldn't be multiplying the location of the player by 1700.
Also don't need the self node and don't need to add self to the array of actors to ignore when ignore self checkbox is true
Thanks, I would imagine there is a way to take the percentage of the morph and apply that number to the morph for clothing. Since all morphs are 0-1, 0.24 would be 24 percent. Lets say that this is for a Trousers and Fat is morphed to 0.32 and Thigh size is at 0.45. Then I would imagine that my Trousers that have the same morph possibilities just need to take those values, 0.32 and 0.45 and apply.....the how is what I am not sure about
and @proud hull Thank you, I was looking to limit the range with that multiplication. Is there another way to do it?
So anyways, you should really use get overlapping actors, to get your player reference, then get the vector angle from pawn to player and compare it to pawn forward vector using dot product.
Sphere trace is basically the same as get overlapping actors, so that works too.
Wouldn't that ignore anything between them though?
Well you can still run the line trace to confirm
But dot product will allow you to make a sight angle, basically
Includes peripheral vision then
You can do dot product > 0.5 and that gives a 90 degree angle of sight
0 would be 180
Interesting, I'll have to experiment with that some more.
hi, can anyone explain to me why my game (in build) is behaving like borderless fullscreen no matter which option (fullscreen, windowed fullscreen) i select? I am always able to move cursor outside of game window.
Basically, sphere (or multi-sphere) trace to see who is around. Iterate each found actor to test what type it is. Compare forward vector to angle to the found actor. If it falls in sight angle, you then line trace to see if an object is in the way.
If it passes all those conditions, you know it is in line of sight.
Or you can add AI Perception and let it do it for you.
I can get forward vector, but I'm having trouble how to grab the angle. What would that node be called?
direction node
AI Perception doesn't seem to want to work with Vehicles, for some reason.
So I've been having to sort of re-create general AI behavior like this
Basically what I explained to you is what AI Perception sight does for you, but with C++ code, so being at least a bit more efficient.
Absolutely appreciate it! Putting it together and trying it out now
Get Unit Direction (vector) is the actual name of the node. May need to normalize this result before comparison.
If I have a class that inherits from another (say I have my custom PlatformerGameState that inherits from GameState), can it be casted to the base class? (In this example, Cast to GameState)
You shouldn't need to. The child class inherits everything from the parent.
Whenever you call Create Event, you're creating a NEW event. If you create a new event and tell a dispatcher to Unbind it, nothing will ever happen because that new event won't have ever been bound in the first place (since it was just created). To Unbind an event that was previously bound, you need to pass in the same event. If you're using Create Event to make events rather than using "Add Custom Event" in blueprints, yes, you will need to keep a reference to them so you can Unbind them later.
@sleek pecan well since I asked, I actually found a solution and what you said is not correct
There's even a test case in the answers showcasing, that CreateEvent is just a wrapper to bind, it is not creating separate events like it would seem
I need to use polymorphism. I will have an abstract PlatformerGameState and from that I will create VersusPlatformerGameState and CoopPlatformerGameState. Can I cast to the base class for that polymorphic goodness?
cpp me thinks it should work π€
You can cast to the game state you're using, which can be a child of another game state class, but you normally would not need to cast to a parent if you already have the reference of the child. All variables, events and functions from parents are made available in children, though the exception would be private variables I believe. Any events that would be triggered from the parent would be triggered in the children, and children can override the parent's functions and events to have specific functionality.
So if you just wanted to do a cast to a parent class it would work, but you wouldn't have direct access to any specifics from the child.
Sometimes "Set Movement Mode" for character movement component causes the overlapping volumes to receive "end overlap" event. Is that a bug?
Parent cast, showing it has some functions available.
Child cast showing it has the parent's functions, but also its own child function
what does HOTRELOADED mean?
that you should restart your editor between building C++ code
Hey there.
Is C++ parent --> BP Child supported for Function Libraries?
How would that even work? Aren't function libraries just a bunch of static functions, why would it need to inherit from something?
I mean like creating a C++ Blueprint Function Library, and having a BP derivative of it, so I can keep all the code under one umbrella
Same way you create BP derivatives of C++ Classes and set stuff like Mesh properties there
I'm not sure if it will work because of how the static functions would be handled, but it should be pretty easy to try it and see
Wish me luck, I'm goin' in
Well
I would be able to find out
if I could reparent BFLs
I guess it doesn't really even matter
You can't create a blueprint version of a C++ function library.
Sorry to bother, but what program were you using to make these images?
Google sheets and screenshot plus crop and add arrows in paint.net, haha. I do simple stuff when it comes to anything art related.
i believe i need to set up mouse x and y but from there i am lost on setting it up
I have variable map of recoil amplification like after third shot it gains x2 recoil multiplier, after 10th shot x3 e.t.c. And I have input value of current shot in a row, how can I compare input value with map and get first appropriate value from the map?
I think you can use Get Keys to retrieve the list of keys (I'm assuming you have key = shot number), and then you can compare the keys until you find the best one
after that it'd just be a matter of using the found key to Get from the map
the problem, that key is not a number in order, first is 1, next may be 4, after may be 11 and so on
What happens if you're on your 16th shot and you don't have 16 keys in your recoil map?
if to put nums in order there is no need to use map
I need to use what was the last before 16
Then just clamp to 15 or whatever and use that as the key to get your value.
Why even use a map though. That doesn't make any sense
1-0,5; 4-0.8; 11-1; 19-1.2
6s shot should be 0.8, 13th is 1 and so on
lol, cause I want recoil on different guns be higher after certain amount of shots π
That sounds like a curve to me, not a map
A curve would be a very easy solution
bruh, indeed, I forgot about it
holy moly, thank a lot, gonna look for guides about curves
Hi, does anyone have a blueprint for having scalable realtime "time of day" lighting? A basic timer hooked up the to the directional light?
hi how could i increase the speed of my car by blueprints because i cant find any tutoarial about it, i was thinking by increasing drag coeficient gives more speed, but i could not get it to work
Hello. I have an actor (which moving) and it has 90 degree rotation after i package. In simulation i cant see that. The programmed movement and rotation is fine in packaged version too, just everytime the rotation is not matched.
I do. I just do some math to set directional light orientation based on latitude, time of day, bearing.
If you use the new Sky atmosphere it ends up looking really good.
Actually not to think about it, the easiest way was to have a nested tree of scene components representing each rotation. So you have one which is aligned with the planet pole, then one which is aligned with the site. Then just attach the directional light to the end of the chain
Need help with "math"
i have ship that i control
and have position of my cursor
i need to check angle between forward vector of ship and cursor
kind of that
"While loop" executes every tick?
while loop executes immediately where ever you put it
is there a way for the GameMode to pass some creation parameters to the GameState? π€
@dull tree I don't recall off the top of my head, but if you google for "angle between vectors" or something, you might find some math for it
but every loop executes at every tick or nonstop at 1 tick till condition is false?
nonstop
ok ty
it doesn't have anything to do with ticking, it executes until the value is false when the execution reaches it.. it could be in a tick event or any other kind of event or function
if the value never becomes false, it will hang your game :)
yeah I got it
im trying to add weapon firing to the project, my weapon fires, but even so while unequipped on my back, so i tried to create a fire toggle along side the weapon equip button (press 1, takes weapon from back, equips in hands, enables firing input, press it again, put weapon on back, disables firing input)
the disable works, and stops me from firing the gun when i put it away, but when i equip it again, the input doesnt actually enable again, although the printstring says its turning back on, any idea?
Find look at rotation.
Seeing an interesting error pop up ("EXCEPTION_ACCESS_VIOLATION") when a specific level is loaded/unloaded rapidly several times (like a player going back and forth to the overworld menu). Debugging shows that it pops up during the landscape static mesh load section (about 2 steps later), so it's probably something to do with loading.
Is there a better way to load than "open map"
Only alternative I can think of is level streaming, but that'd be a bit of a pain with a bunch of very different maps
If you are new to this and reaching for a while loop, you are probably doing something wrong. I can't think of any simple implementation of something that would use a while loop unless you were doing some sort of search or something like that.
I'm just asking, I thought as one of possibilities instead of get attached to tick event
Hi friends, I could do with some help with Data Assets
I have these assets, my primary asset and a child of it with some values
and an actor that should be able to pull a child data asset
but no dice
hey guys, i have an issue that i wanna fix in my project, but i dont know how to go about it
basically, i have a top down shooter game
i have made a full auto gun with a set firerate
but i can bypass that set firerate by simply clicking faster
how can i fix that?
Cooldown
basically attach it to your fire event, only enable the fire event every X by having the bool reset after X ms
is cooldown a node?
no, you'd have the input action for fire check if a cooldown bool is set, if not, fire, then set it
and set a delay or event fire to reset it X ms or seconds later
There's a pretty easy logic for this using timers and timer handles to check on button press.
yup
timers or timer events are the easiest way to set cooldowns, you just have a very quick bool check
the absolute easiest is just to set the bool when the inputaction is called, run the action, set a delay 2ms, then unset it
oh man my bp's are confusing lol
well... that's a different issue π
havent been on unreal in a while so this might take a while lol
Basically, on button press, check timer. If timer is active, it's on cooldown. Start a new timer based on how cooled down the timer was. That way if the button stays held down it'll just fire again at the correct time. On timer end, check if button is pressed, if pressed, fire, if not, don't. Then on next button press, the logic would instantly fire because it's cooled down.
Yup, same thing
you check a bool for cooldown before proceeding to dispatch the fire
If you're using timers, it's easier just to check the timer handle. Can make a pure function out of it if you don't like the extra couple of nodes in the way.
yes, but "isactive" is still a bool π
the point either way you feel like going is the logic is an incredibly simple little check from the standpoint of the engine
ahhh getting back into the groove of game design is hard lol, im still trying to figure out where to even start this haha
i have a TopDownCharacter bp and a BP_firingWeaponBase
and the shooting mechanics are in the topdowncharacter
In widget I have horizontal box and lots of same images inside, how can I align all of them to right side of box and restrict box to go right far than certain point?
and im not sure if thats correct
I'd personally but the firing stuff and input in the weapon base. You can enable input on equip. That'll allow you to also use different stuff for the same key when a weapon isn't equipped because the weapon's activated input will override anything else.
this is what my shooting mechanic looks like in my topdowncharacter
how would i go about moving it into the firingweaponbase bp?
Hi guys! Is this a good way to reset the level?
Looking for some help with "OnDestroyed" / "Is Actor Being Destroyed". Neither of them seem to fire when I use "DestroyActor".
Context: I'm making a small soccer minigame and when the ball hits a trigger in the net, it destroys the ball. Which I thought would fire the "OnDestroyed" event or at least would return true for the "Is Actor Being Destroyed" function. At which point the spawn point in the middle would create a new ball, since it's looking for the "OnDestroyed" event.
@hollow zephyr You could reference a spawnActor macro for the new ball directly after the destroyActor and skip the need for detection
I'll give that a shot
Also, can anyone recommend a good tutorial / walk through on event listeners?
I used them quite a bit in AS3 but I'm getting the feeling they work differently in unreal than in flash heh
Mathew Wadsteins channel is always a good place to look for tutorials
Don't know if he specifically has one for event listeners
I'm modifying the default first person blueprints and trying to add a magazine size, decreasing the magazine by 1 every time I fire, and checking to make sure it's not empty. But when I compile and load in the weapon just doesn't fire at all
Did you set some Default value > 0 for CurrentAmmo?
Is that done by the Set Float box in the first picture?
you can do it that way (you need to connect their execution pin tho), or if you click on the variable you can set it on the details panel
(and if you don't need fractional values I'd use an int, just for clarity)
Best to use integers for bullets, as you can't fire a half bullet.
Also, you're not actually calling the set functions
in the first pic
So I changed the default value to 30, but what does the set float do in the first pic, or how can I do what Bojangles is saying
It needs to be linked to something like "on begin play"
connect the execution pin
Just like that ^
I'm still waiting for my editor to open lol
How does one select the character that will be walking around when i start the game in editor mode ?
Do I just steal the one from the VR section, I don't really need it
And I can't spawn another
Find your "Event Begin Play", and slip your two Set functions in there, making sure to connect the end of the last set to whatever the "Event BeginPlay" was originally connected to
Ah, figured it out π
i have an equip/unequip function, on my characterBP, but the fire input is on my weapon, and im not sure how to check the variable, i imagine i have to move one to the other?
Is there a way to clear the message log ?
Let your 1st/3rd character handle firing / input events and have it call an event / function on the "Equipped Weapon".
This way you don't need to know what is equipped in order to fire. And the weapon classes don't need to worry about input events, etc
Hi there, I have a strange problem: I have a player character and an enemy who has a sphere collider in front of it, set to overlap with pawn, ignore all the rest. When I walk into the enemy, the event fires as expected. However, if i remain stationary and the enemy walks into me, the event does not fire until i try to move. When I check with Show Collisions cmd in console, the sphere collider definitely overlaps with the character. What gives?
I think its related to not having been out of the collision
maybe you could try to force collisions to be reset ?
ah, I should add I;m using on Component Begin Overlap in the enemy BP. I check if the other actor is player character there. But when I put a breakpoint, it does not stop execution at all when I remain stationary
@hollow zephyr the issue with that is i have a particle effect attached to the weapon, that isnt on the character
for my flamethrower
aaaah, shiet, I think it's because the sphere collision is World Dynamic, and the player capsule is set to block these. So I guess it's like with the hit event. I'll try changing that and see if it helps
nevermind ive moved it and its almost working
i now just shoots flames if front of me instead of from the gun on the backpack
I think you're misunderstanding me. The weapon firing "code" is all self-contained. all the character does is tell it when to fire. so when that gets called the particle emitter does it's thing when needed to
oh im probably misunderstanding you, im a fucking blueprint dummy
oh my god i got it
thanks
Everyone's gotta start somewhere, you'll get the hang of it
2 days
ah, nope. Both enemy and player have a sphere collider of Object Type of world dynamic. Both of these have a custom collision where they ignore everything and overlap World Dynamic objects. And still, if the overlap happens when the player is moving, its' fine. But when the overlap happens when player is stationary, the event does not fire π€
LOL
Is there a way to scale an actor effect in a spawn node?
I want the explosions to be smaller
split the transform - transform is a combination of location, rotation and scale. Right click on transform -> split, or use a break transform node
I think that looks good, thanks
Might work best to scale it in the particle system asset, but you can try and use a transform / set scale node
Just like that lol
Instead of having a spawn transform can I attach it to the sphere spawn point?
Hi yes, this is possible in theory. And it's fine if the instances are being spawned at runtime. - You'll need to be careful about managing the life of the instancedmeshcomponent though, and it cannot be destroyed outside of the owning blueprint. You'll need to call a function in the "manager" and destroy from there.
I hate instances and construction scripts in unreal. Why can't I spawn instances once and then have them be there next time I load the level!? Completely unrelated to your issues but I keep running up against it and it's hell!!!
Fascinating! Thanks for letting me know (and sorry for the mis info π )
Hi, for some reason UI progress bar animations don't work in VR? I tested it without VR and it seems to work just fine, but the Percent animation doesn't show while wearing the headset. Wondering if anyone has any ideas? Thanks!
edit: For further clarification, if I start the game using a regular option like Selected Viewport instead of VR Mode, its shows, but the Play level in VR option does not show the progress bar percent animation. I searched it up online and no results were found, just tutorials on how to make level load bars iirc, so gonna ask here as my last option
You can do this, but it's buggy as heck and I can't figure it out properly beyond getting stuff spawned. It spawns fine, but then i get load issues talking about "duplicated foliage" and I can't select it properly
Hi there is, but it's a bit weird to be honest! Buggy behaviour. I'm exploring this right now too. You can spawn actor from class "instanced foliage actor" then you can add a "instanced foliage mesh component" to it
@bright frigate I would definitely use a timer unless you need to update every frame.
@eager swan why would you want an explosion effect to be attached to something? Wouldn't you want to just exist at a point in space?
It's my muzzle flash
and smoke
But now that I'm thinking about it, it's a bit wasteful
well a day night system would be tied to tick, right? So would it make sense to then use that tick for the clock as well? Most tutorials I see seem to do this, haven't seen a timer-based one yet.
You can update slower than 60 times a second. IIRC Skyrim is like every 30s or minute.
Just every so often go "oh goodness gracious look at the time" and update whatever. Turn Cinderella back into a pumpkin, move the sun, evolve the weather, whatever.
The interval at which you do that can vary from one frame to a minute or even more if you wanted
So do you mean I should maybe change the day night procession with a timer? I think this is how maybe GTA did stuff early on? Or would it seem too "jagged"?
It all depends really. that's what they do in many other games, but many other games have way more going on at the same time that the performance trade off is well worth it
right, thanks, maybe I could put every 5s or something
I'm thinking of the GTA pace of 1 IRL minute = 1 game hour. Is that the same in FF14?
shadows will probably be a bit choppy considering the density of assets and geometry types I'm dealing with (lots of interior stuff - think Metro-type interiors with the houses detailed and all. But for now it's only one or two houses at most.
@bright frigate your sun moves at 1 degree every 4 seconds, so work your way backwards to figure out what would be indistinguishable
1hz update should be fine tho, go a bit faster if you want. If it's just sun tho just do it on tick, it's cheap.
I was looking at some of the games' day night cycle timelapses. But they're all sped up so not sure really, they look mostly the same. GTA seemed to be 1 day gametime = ~50 minutes IRL (let's say one hour). FFXV seemed around the same.
I saw a tutorial where the 4th method seems interesting - timer by function, which sounds like what we've been talking about here as well
https://www.youtube.com/watch?v=RZCfzGMHhAI
Thing is, I'd like to do other things like weather as well so it'd be good to get used to where tick can be avoided and generally the "feel" of what may or may not be heavy on tick since I lack that intuition
In that case just do a one second timer and you can evaluate weather etc with a noise function. Just every second a timer on game mode calls update time
That seems like a good and simple approach, thanks!
so i'm using a spherical world. I have gravity and character alignment working, but my camera rotation continues to behave as if it's a flat world. like this: https://gyazo.com/a1643e96630728fbae0be460f5e2bf58
using my character position, and the center of the sphere, I know i can get the vector direction, but i'm not sure how to put that into usable math for rotations, as I'm horrible with math. lol. anyone have any suggestions?
I think this video explains it https://youtu.be/l2J45z6aoJQ
Use Blueprints to create a pawn that can be controlled while moving around a planet while maintaining correct camera orientation!
YAY!
i would just calculate/set a random time for the weather cycle and start a timer, which when completed does the same again
why is it when I "rotate to target" I always face the same direction but its not actually the target?
Hi, I'm using the default way to spawn projectiles (FPS Temple). But i do get this weird offsets when moving and rotating cam.
Tried bunch of option to fix it but none seem to work.
@halcyon grove I'm no specialist but are you supposed to multiply your speed by delta for the Interp Speed input? I'd just plug the Rotation Rate directly into Interp Speed, or better yet try with a constant first (like 1 or 10). Also, is Delta your actual Tick Delta?
@soft halo idk what you mean by offset, it launches off in that vector when you click the button and then you move away and see it from a different angle?
It's just that the effects take a little while to show up
Is ther any way to make it smooth like, doom or skyrim?
got similar problem like this guy, https://answers.unrealengine.com/questions/908690/view.html?sort=oldest
and sadly i'm kinda bad with 3D math
Anyone know the best way to restrict camera rotation on a character? Currently the character takes a bit of time to turn so you can literally spin his head around 360 degrees like you are posessed. I want the camera to only be able to get a max of about 50-70 degrees +/- off relative center so the character keeps turning until it matches the camera but cant spin around the body.
Is there anyway to make smooth recoil system? For example, with my basic recoil system I am adding controller input in yaw and pitch, is there a way to smooth it out?
@soft halo if you want it to be instantaneous like doom then you have to do it a completely different way, if you want it to have speed you can just speed up the projectile
Doom uses hitscan, not physical projectiles
I get the same result with both
@soft halo you could try getting your characters velocity, and spawning the projectile where the player will be using the velocity to do the math.
but further the rotation rate value in character movement is basically the value multiplied by delta
the way I understand it
yes delta is my tick delta
I've tried many methods... including using a constant
all i'm trying to do is smoothly rotate the character until its facing the target
the next method i could try is simply to add rotation on tick until it has the same rotation as the look at rotation
then use a boolean to switch over to straight "find look at" node
Maybe Player Controller is blocking the rotation, as the Character is being controlled by it? Perhaps put some temporary test Actor in the level and try to rotate it instead of the Character to see if it works?
ok
hmmm
also the speed of the rotation is important
as different characters have different rotation speeds
because i was simply using find look at into tick and set actor rotation
But if it's not working then better to get it to work with constants and build up from there...
Well, in that case like I said I'd try with constant Speed first. Also, maybe try the other RInterp function?
i tried both actually
and the same result
its weird
haha
it just goes to the same rotation over again
kinda like up
regardless of my position or the targets position
its a head scratcher but in any case I think I know a way around it
Well, if you're calling Rotate to Target on Tick then it should work I think, so I'm out of ideas, sorry.
Trying to do something like that, also thanks for suggestion, will try some form of hit scanning.
Although i feel like the spell that i made is clunky at best.
Hey everyone, not sure if this belongs in the BP chat or the audio chat but I'm running into a problem with my audio manager. Basically, volumes in the game call this ChangeMusicTo event. Then whatever music that's being played should stop and a new track should start. The issue that Im having is that utilizing the both the AdjustVolume node and the FadeIn/Out nodes cause the audio component to be killed (?). So when I try and play that same song an error message occurs. The code works fine when utilizing the SetVolumeMultiplier node but it doesn't fade and its more of a harsh switch. Can anyone help me understand why its happening/help me fix it?
The first Adjust volume is set to .00001 just to confirm that the code works using these nodes as long as I dont set the volume to 0
I'm using AttachToActor to attach one actor to another, but it isn't attaching to the socket
this is my socket
Unfortunately, that didn't work for me
Can anyone tell me why, even though this transforms variable has multiple DIFFERENT values, it continues to only put pull the first value from the array in a for loop? https://gyazo.com/c1707feb77263cef5750c60617a046d9
Hello everyone im trying to make an phone call mechanic where phone rings till you open it but i dont know how to stop the playing sound when you open the phΔ±ne can i get help?
@atomic salmon Hey there, thank you for your response in #legacy-physics. I am very new to UE so I'm not sure where to go from here. Are you able to help?
Okay, a Get Component By Class set to SkeletalMeshComponent did the trick.
Haha! It looks very clean. They just convey what I was trying to so much better. Is it alright if I use them in my school documentation to clarify the problem I ran into and your solution to it?
You sure can, I made them just for you, hehe.
hey guys, does anyone have an idea on how i could detect an input variation over time on the controller stick?
I need to fire an event whenever my input differs of an x value from the one taken a split second before.
I tried having a timer that saves whatever is the input of the stick ten times per second and then comparing the current one through a "greater than". It doesn't seem too reliable tho, what am i doing wrong?
I got a question about action and axis mappings. I'm currently creating a game filled with minigames (just to learn a lot of BP ;)). Now i've added some axis and action mappings for the first minigame, but I need the same buttons for different actions / axis mappings on my second minigame. Is there a proper way to do this or should I just use hard coded keys (key events) in the Blueprints?
how do I calculate velocity on tick ?
i want to calculate the velocity of my root motion animation
Set your action and axis mappings up for whatever is the most common use (walking around most likely) and reuse them in different ways in minigames. The names don't matter.
You..... Don't? If you had to, easiest way would be to do an OS printer call but that sounds real fucky
There might be some library you could integrate which can do it but that'd need C++ level integration
anyone know how to calculate root motion velocity ?
i havent used blueprint or unreal in general for a while and im struggling with collision tags. Is anyone able to help? Im trying to see when a box collider overlaps with an object that has tag "Climbable" it will do something (climb) but when i spawn it is overlapping with itself and doesnt print any results for other overlapped components
Does anyone here have any experience or know of a way I could pull/drag an object with the third person character ?
I have got a push mechanic but I am not sure how I would pull/drag
Using physics or no?
Open to trying with or without.
How are you doing the pushing?
symmulating physics with event overlap on a cube with a box collision
oh yeah and a physics constraint
Blueprint for loops are inclusive and that's why I have trust issues 
Hi, How can I move a character to the next spline point? Not the whole path, Thanks!
Show how you assign it
If I connect the first pin of a sequence to the break pin of a for loop... will the other pins of the sequence run? 
why would the rest of the pins not run?
the only way to skip a sequence is to return from a function
In code, a break statement acts as a soft return π
but if you break out of a for loop, you aren't breaking out of eg an outer switch statement
@astral estuary A great deal of the standard nodes (not functions you can call, distinct types of nodes) are macros that were created in BP. Take a look at StandardMacros
Hello
I have trouble with the attach/detach system
I have a FPS character which works fine
And a moving platform which is also a character that I can drive in fly mode
I made a setup so I can jump on the platform with the FPS character, press E and possess the platform. FPS character is then attached to the platform (keep world) and I drive the platform character and the FPS character stays on it.
Then I press E again to repossess the FPS character and detach him from the platform (keep world), and when possessed he is teleported forward and falls in the air.
I noticed that the place he is teleported to reproduces the path the platform flyed along when he was attached to it (example : I possess the platform and drive to X+3, Y+5, then FPS character will be teleported to X+3, Y+5 from the platform). If I detach with "keep relative" instead of keep world, character is teleported to 0 0 0 in my world.
This is driving me nuts, I disabled all "on possessed" things on my character and this is still happening. No idea why.
I tried to doubleclick sequence to see how it worked but that one doesn't open π¦
that one is actually code driven, you can view it in visual studio
abyssal cpp
Why do I feel blueprints try to be super easy and once they hit zero they underflow to like impossible cpp difficulty? 
to make it easy, restrictions are in place. when you hit those, you gotta workaround them in an unnatural way. like passing delegates around.
but then, also, some constructs aren't meant for node graphs.
I wield both with abandon. Bow.
CustomThonk?
(no, rly, what is that?)
do you ever use containers in BP? Array, set...
if so, they're what allows BP bytecode to handle wildcards
macros aren't the same, they don't have or need thunks
they crawl the stack for FProperty descriptors and void* addresses, usually paired with a function that is written with the reflection api
Anyway, thunks are like a meta function that processes how a real function is called. They can do what BlueprintNativeEvent does - doesn't call cpp if BP implements it - or they can just directly call the function. The keyword tells UHT that you're providing your own.
Oh, I remember what I tried to do: I tried to make a shuffle array function/macro in BP.
It worked but I couldn't get it to take a wildcard array π¦
Shuffle should be a function you can call already? Do you mean Sort?
You can't nest macros and use wildcards on both outer and inner macros and expect it to work
you probably ran into that
I wanted a shuffle that takes an random stream dothingy so I can replicate the randomness if needed
erganermics
(I agree)
hence the mocking spelling
easy enough to wrap in a custom function lib, but you shouldn't have to
pretty trivial to convert (either way) if you're looking to do so and willing to take the extra call
Ok, I will ride on the LowEffort library and one rainy day I will look into how this works π
thanks a lot for the pointers π
Show where you actually set the reference, i get no info from that really
Well, my cup of tea is that the the Pawn doesn't exist yet when it tries to assign it
Yes cause it eventually sets it, are you sure you're not running some functions before it's set?
In that cause it will spit out that there's None
Show me SetMove
It's complaining about the SetMove event
Not receiving the ref
Where were you setting that
I mean the Set MoveY
Ok but where in the Flow of the program
Where was it plugged
That's your problem
Hey all,
I am trying to set a line trace up on a third person template.
What would I use to get the forward vector for a line trace ?
It doesnt seem to work from the camera...
I tried a couple of other things too like the character mesh
Or you have it after the Is Valid or you make it a Validate Get
It matters cause you're trying to assign MoveY to nothing in the first place
That looks like Replication problem
Yes but if it has no Reference of your Character
It will try to assign it to None
Spitting out errors
Are you sure your code is Replicated btw?
Looks like Client and Server fighting
Theeen how is your server supposed to know about the movement?
The Server should modify the values, not the Client
You can change a value on the Client but on the Server it will always be 0 and it will correct the Client for example
Indeed but you still need to replicate changes to the server, like if you modify Max Walk Speed
What is the Move variable for?
Show me how you move then
Ok, but
How can you be sure that
Movement Locked
Is not True on the Server
Wait nvm that's stupid xD
Shouldn't really matter
Mmh
But it looks like something is F up
Do this
Instead of assigning the Variable on Begin Play
Do it OnPossess
So basically you're sure that your Controller has Possessed something in the first place
Returns the Pawn too
You could cast and assign the cast ofc
is the wrao int node broken in 4.26.1?
I have a wrap that has 0 and 2 as limits.
I start my int in 0 and increase it, it goes: 0 -> 1 -> 0 -> 1
ok now my int is 1, let's decrease it: 1 -> 2 -> 1 -> 2
WTF?!?!?
You cant go to the last or first element but you can wrap to those elements?
Wait
I just realized
Make the Character Variable Replicated
π€
It was giving me issue when it was not, was spitting out None errors
What does the Server see when you try to move?
The Host or so
tyvm @dark crow !
Seems like some sort of Replication issue to me, cause the Client tries to move but the Server doesn't move it
Not sure why tho, if you use Add Movement Input it should be fine
You can move so the actual reference is there
Try this
To debug
Barebones
Still does the same thing?
Okay, is it set to Replicated?
Just to rule that out
The Character Reference
Still behaves the same when you play?
When you press W in this case
So here's the problem
If it goes through
Means there's a Valid Reference
I was able to duplicate on my end. Try setting lower limit to -1. Now it'll loop 0 -> 1 -> 2 -> 0
go the other way and you will land on -1 That shouldn't happen π¦
Show me how you're getting the Reference OnPossess
Not the case, it could try Getting the player pawn before it actually possessed so it would be nothing
Show me OnPossess
Doesn't matter
PC still possesses something
Initialize the Character Variable not from BeginPlay
But OnPossess
In the PC
It returns a Pawn Reference too with it
Just so we're on the same page
Set it to Replicated
It's important
Are you doing a validated get or an IsValid before using Posssed Pawn on the input axis, effectively making sure it has a value before it's trying to be used?
You cannot assume that.
Better safe than sorry
Yes, there are many reasons. Your PC exists before the character.
And input axis fire like tick.
So it's almost immediately going to be trying to use that value.
Are you 100% positive it's not getting set somewhere else in the code?
To something invalid
Normal for it to not be valid
Till you possess
That's the point of the Validate π
But it still exists as a Variable
And PC is on Tick
Tick happens before OnPossess
Yeah you will get some invalids until it is properly set, but the point of using the valid checks is so you don't get errors from trying to use the value before it's available.
What is better optimized to call from another bp function or custom event?
Okay so other question is, are you sure there's not any code in the actual Character BP that may F this up somehow?
Not sure what happens for example if you have 2 InputAxis, one in the PC and the other one in the Char
Cause i don't see why the one in PC wouldn't work
Doesn't matter. Events are a bit better design wise but it's the same.
thanks
Honestly not sure tides, everything seems right and the refs get set properly, my only guess is some overlapping code and / or something replication wise, you may wanna post the video of the Character moving in #multiplayer
Cause it seems like it only updates Client wise
Duplicated the set up on my side as well. Player Controller feeds the movement into the character, both on client and server.
Yeah, this makes me think there's something else going on somewhere
Looks like it's only running on Client on his side for some reason
Is there anything like "select" but to chose execute node depending on ENUM value?
switch
oh, thanks a lot
Just in case you have trouble finding the right node, you need "switch on <enum name>"
@dawn gazelle I just took it from enum variable ty, I just forgot how it's called
Migrating stuff is not always as smooth
Guess you could try to create a blank Character class and use that, then see if the problem still persists
If it works then it's the Character
hey so i have made a shotgun weapon in my top down game that shoots with linetraces
and i have a variable that changes the amount of traces
with a spread
so that it shoots like a shotgun
but when the traces hit a target, it doesnt quite work
instead of each trace dealing its set amount of damage to the target
it shoots 1 real trace at a random spread value, alongside the other traces which are not actually real
so if i hit a target with one of the fake traces, it does no damage
but if i hit them with the 1 real trace, it deals ALL the damage from all the traces combined
so lets say i set damage per trace to be 12
and i have the traces used set to 7
it will hit 12 damage 8 times
how can i fix that?
sorry ik its a bit confusing haha
Would you mind showing the code?
this is my "determine hit object" script
which is where i apply all the values like spread and traces used and whatnot
its also the parent for all weapon types, on the top left where it says traces used right now its set to 0
but i have another child bp which is a shotgun and it has 7 traces
Hi everybody, anyone related to AI perception systems? i'm having som troubles seeing if the stimuli source comes from hearing, sigth, damage, etc stimuli source.
Show me how you apply damage
use Get Sense Class on the Stimulus, it should give you the type of stimulus it is
I'm trying to attach an actor to another actor, however, Is there a way to make a socket on the skeletal mesh maintain it's position relative to the mesh but not move with the bone, or should I just add a scene component to the actor blueprint and attach the actor I want to attach to that scene component instead of a socket
the white box above just calculates critical hits
which ends up setting the actual damage of the shot
I love you, marry me please. we can make childs and slave them to make videogames
Wouldn't this cause it only to consider the first hit?
oh?
now for real, thanks. That solved the problem.
hmmm i didnt think of that
i did use a tutorial for most of this
so i dont fully understand some of it
You can directly apply the damage after the line trace
cause it checks every line trace on loop
jeeky, can't you check on trace hit to go back to the shotgun or your character, do the damage there and if you want to only do damage once, add the to a list of "already hited"?
hmmm
your idea is that if you use the shotgun that shots multiple projectiles, only 1 of them hits, right?
yeah
ofc, i don't suggest using get player pawn 0, if run on server it always means the first player and if not it would still mean it tries to get it when it doesn't exist yet
make the trace, get the hit actor, check if it's an enemy and with that go back to check what kind of damage you should apply.
You can set that on your player or check from your gun.
Once you hit once and do the damage, you can make an array of "already hited" actors so you don't hit them twice (remember to refresh this array after each shot)
If you want every individual projectile to do a set ammount of damage if it hits, you can refer to the example above btw
one variable on the weapon or character of "amount of damage per projectile" would be nice, you can check on that when applying the damage on hit
i heard that before
You're looping to set an array then looping to get it again
when you can directly access the value from the first loop
so i could just get rid of the 2nd loop?
ok
When it presses the Fire Button
It loops 10 times
Every loop shoots one LineTrace and if it hits it applies the damage then it starts again
In total you'll have 10 shots and only the ones that hit would have applied the damage
his is just a hit scan shotgun
That's what it does
yeah
But it's hitscan
Shotly you don't need an Array since the code after the ForLoop it's run individually 10 times in this case
what it means
10 lines and each one of them checks for themselves if they apply damage or not
If 5 hit then if damage is 1 it does 5 damage
cause the other 5 didn't hit
So no Hit Actor
For safety you may wanna plug a IsValid at the Hit Actor in case it hits nothing
i have damage numbers pop off the enemy after they are hit
and that 100% works ive done so much to make it work lol
Would still work
and if i hit the 1 real trace it pops off (in my case) 8 numbers of 12 dmg
so can i edit my bp to make it work?
No reason for it to not work
You still use Point Damage
Just move the Function that displays numbers after
Just trying to make you think why you would need an Array
For the Hits
or have the hit actor handle the dmg pop up
When you ForLoop ecah one of them to start off
So it goes through each one of them
And what Tribe said too
The architecture there is just problematic to start off :p
Plus accessing Array 0 only considers the first shot
array 0?
right
Condition is alwayas True too so always Adds
In the end you don't need the Array tho, just feed data from the first ForLoop directly
and how would i do that
So you can have all logic there
Just with one Loop
Related to Each Individual Trace
If you want individual damages to show up you can just show damage each loop
If you want a total you can have a variable and add the Return Value of the Point Damage then ForLoop completed show Damage
All can be done there
Keeps code more compact and no use of many Loops
so in this example youve shown
the apply point damage and determine hit are in the same script?
Yeas, cause when you know it hit you can already apply the damage from that linetrace, see?
Cause you already know it hit, not that useful to save the hit
Only reason would be if you need to use it in separate parts of the code, but in that case, it's the same to have everything dependant on the first Loop
so u think i could just move everything from my "apply point damage" bp into my "determine hit" bp?
this is the event graph for my firing weapon base btw
Yep, cause as i said look what you're doing
Saving the hit in an Array, then iterating through that Array again to get the hits back
What's the point of the Array then?
hm
When you can directly apply logic when you know it hit
I would look at handling the dmg popup in each actors on dmg event, this way you can control it how you want for each actor (dunno what you are making but for example maybe you hit a barrel and don't want the dmg to show but on a person you do)
ok so i unplugged this
Yeah, ApplyPointDamage you can think as an Interface for Pawns
If you want generalized you can keep it generalized, if you want different things to happen based on what's hit then you can use the Damage event
Okay
did i do it correctly?
idk what to plug into the other parts if i get rid of these
So lemme tell you how to write the Logic
omg i think it works lol
Press Button -> For Loop ( Calculate Damage and Critical -> Apply Point Damage -> Show Damage )
i did this
Pretty much yeh
wow
lemme test a bit more if the shotgun pellets all register seperately
wow yeah it works great
thank you man
β€οΈ
I'm glad it helped β€οΈ
Hello! I came across another problem, I cant seem to solve alone. In my videogame, boxes are placed. There are figures that deliver and place these boxes. They all have different capabilities of taking paths. You place these boxes in the back of a truck, and for example to place a box in the back, the figures need to go there. How can I calculate this path? Maybe this illustration helps:
I basically need a solver that search for paths and is rather simple (moves from square to square and ignores square that already have a box)
Maybe someone can explain this or link to some tutorials if its more complex
I have socket on weapon that designate "aiming" position. What is the simplest way to move weapon in front of camera centering to that socket?
You should be able to use the built-in nav mesh for this.
Question guys. I'm trying to rotate a component (whether in it's local space or world space) such that all three of it's axes are parallel to that of another Component. Without changing translation.
Can someone point me in the right direction?
Hello I have a problem. I have 2 plugins, the first plugin is "First Person Story Adventure" and the second one is "Custom Movement". I want to make the ladder with the first person story adventure skeleton, but its not working. Any idea on how to fix this?
question, how can i make a sound play for a certain amount of time and then stop?
lets say i have a reload loop sound, i want it to stop when the reload time is finished
@void cobalt I would put a condition that checks if the timer has reached zero and stops the loop if the answer is yes
Not as far as I know, you have to use logic to tell the nodes how to behave with each other
But if there is one you can right click and search for it
Just copy the rotation.
