#blueprint
1 messages ยท Page 129 of 1
there is still an issue where the lighting slightly dims on teleport.. gonna have to look into what the hell is causing that now...
also @lofty rapids were you the one who helped me make the directional teleporter yesterday?
oh yeah it was you and @versed sun
the reason I ask is I am getting a slight issue with the way it was set up in that it will sometimes trigger both overlap events even when I only go through 1 direction
the directional teleporter that uses this system
i was saying dot product
idk how to use dot product though
you said dot product a few times and never really explained what it was or how I use it
so you take two directrional vectors, feed it into dot product
and you'll get a number
that number you can tell if your facing the same direction or opposite
so how would I use that here? because I want to make it based on what direction the player enters the teleporter from not what direction they are looking at
hmm, maybe i misunderstood
whats the problem with this method ?
it's probably better i'm still fairly new to unreal
like I said sometimes it will fire both overlaps simultaneously
so it will trigger both the front and back teleports even if you only enter it once
it's like one takes priority over the other
so you want to get the direction you entered the portal so even if your facing backward
you want that direction you entered ?
yes
so if you enter the portal from the front, regardless of what way you're looking, you go to location A, and if you enter the teleport from the back, regardless of where you're looking, you go to location B
hmm
the idea is creating an endless corridor where it's just a loop that you keep going around endlessly if you go around it clockwise, but if you go around anticlockwise you get to the exit
if you've ever played antichamber you know the sort of surreal impossible geometry I'm going for
the overlapping boxes method that Ryck talked about before worked at first, but when entering from the back it would sometimes trigger both the front and the back teleporters at once which would kick me out of the map
Dotproduct should work
Single collider
Double overlap can happen with low framerates
can you just dot product a location or something ?
i mean what if your going backwards is my only thought
like backing into it
ig if thats even possible in the game
No, direction
so i used the forward vectors
how do you check that?
that makes sense
I'm still really new to unreal so a lot of this is going over my head
how do you get the movement direction of the player character?
Dot product is somewhat similarity of two normalized vectors
Equal == 1.0
Opposite == -1.0
Perpendicular == 0.0
Not sure if CMC has last direction?
Or current direction
makes sense
GetForwardVector
Add an arrow comp alligned to X to help you visualize forward in scene
so how would you normalize the velocity?
Simply add a normalize node
with what tolerance?
Default is fine
and then dot product the normalized velocity with the forward vector, I'm guessing it will spit out 1 if the player is moving in the forward direction and -1 if they are moving into it backwards?
it will tell you if your comming in from the front or back
yeah that's what I meant
From behind > 0
From front < 0
are there any situations where this could bug out? like of they tried to move across the teleporter at an angle how far before it would fuck up?
Going in front would be opposite of the arrow and forward vectlor if the overlap actor
Perpendicular
Would return 0.0
i actually think it will work fine
But thats sorta impossible
which given the teleporter trigger box goes right across the corridor isn't likely
As you would never hit it
i would just put a collision box a bit larger that it so you get the right number
Lines going in parallel goes... well parallel
welp, time to delete this entire blueprint and remake it using dot product XD
Parallel wont touch for infinity
Assuming the collider goes wall to wall so you cant enter it from the side ๐
yeah it does
yeah that's what I was going to use, because -1 is entering from the front then <0 = forward teleport and 1 is entering from the back so >0 = backwards teleport
Its just a single branch
you could just run a default on the 0.0, but that is a weird case if you went in at exact 0
Not sure id bother compare
If (Dot >=0 )
{
// Front
}
else
{
// Back
}
True -> back
False -> front
That covers all the options
uhm, how do I get the velocity from the character movement component?
Is it accessible in the Character?
yeah
well, I'm getting the character movement component from the teleporter blueprint
hmm
This is not the way
so your dragging from character movement ?
yeah
like mentioned there is probably a better way to do this
wanna explain how instead of just saying it's not the way to do it?
On overlap -> other actor
do you only have one character ?
yes
Dont mean to be short , but walking the dog and arriving at home as we speak ๐
I have to do the "get all actors of class, get copy" anyway because I added in a branch testing if the actor that's overlapping the trigger box is the player character
you can just do get actor of class if you have one
without the s
it starts yelling at me if I do that saying it may slow the game down
but are you doing that on beginplay ?
well i can't imagine it being slower then get all actors
no I'm doing it on "on component begin overlap"
ok so is the player the one overlapping ?
well that's what the check is there for
if another actor is doing the overlapping it ignores the rest, but if the player is the one overlapping then it continues
thats not how you check that
you want to drag out from other actor
and try to cast to it
if success it's the player
on fail it's not
thats what I've done
yeah I was just about to say that
again i would just use get actor of class
This is silly ๐
but you shouls be able to pull out of it get the movement component
and get velocity
Isn't this the 'correct' way to do this?
Itโs one of the ways but yeah Iโd go for that one
care to actually add something through constructive criticism rather than just declaring something silly then moving on?
I was typing but jma beat me to it
thats not a cast, but i can see how that would work ig, does it work ?
it's worked plenty of times before
well i would try the cast and then get movement, then get velocity
they're just trying to help you, maybe be more patient
I posted a message about a different issue and 3 people jump down my throat essentially calling me stupid because I didn't know the correct way to do something when nobody beforehand had actually told me how and I was just doing it the way I'd been shown too previously excuse me if I'm a little short on patience when people are so fucking quick to point out flaws as if it's something I should have known when nobody had told me previously
Chill, no one is calling you stupid
Weโve all been where you are
Using 'Get All Actors of Class' is very slow btw
i'm still learning every day
Thereโs a few issues with what youโre doing and I keep trying to explain but then have to stop lol
this kind of sarcastic remark is normally a comment of "stop it you're an idiot" where I come from
It wasnโt meant to be either but yeah
This video is extremely helpful if you're new to blueprint communication. It makes a lot of things make sense. (https://www.youtube.com/watch?v=EM_HYqQdToE&t=886s)
Announce Post: https://forums.unrealengine.com/showthread.php?101051
This Training Stream takes a look at Blueprint Communication. We find that Unreal Developers of all levels can sometimes struggle through the concepts behind moving data between objects. So in this video we'll take a look at the different ways to make Blueprints talk to one an...
Get actors of class can work but it can become very expensive if you do check it against a class that has a lot of instances
Thereโs also get actor of class if you want to go that route but keep in mind that as soon as you have more than one instance of that bp in the world, that will just take the first copy it finds no matter which one it is
how do you get that yellow velocity node?
that's what I've been trying to find
type get velocity and scroll to bottom
it's not appearing when you drag out of the character movement ?
it is I just had to turn off context sensitive
thats strange
so as a follow up, with the dot product of these two, does it matter which one is on top or on bottom in terms of what the product will spit out?
ya know the funny thing, I spent days looking up how to get blueprints to communicate with one another, this video didn't come up once
thats strange
It is from 8 years ago
if that matters
It basically compares 2 vectors, I.e. to find out if 2 actors are facing the same way. So the order shouldnโt matter
i would test your velocity before you do other stuff because that context sensitive thing just sounds like trouble
No matter what i do i cant make my RoundAbout Sequence work...
Its been hours and so far no luck ๐ฆ ... Can anyone help pls?
For more DOT stuff https://store.algosyntax.com/tutorials/unreal-engine/the-dot-product-and-use-cases-in-unreal-engine/
Understanding the dot product and its use cases can be crucial to creating high-quality experiences in Unreal Engine. The dot product is a mathematical
What in the world ๐
Where is that cast it mentions ?
@gentle urchin what was it you said earlier about the way to check the direction without having to do a comparison? I've forgotten it
= 0
Idk, i think its inside the RoundAbout sequence code itself
Its a comparator, but not using the Compare float node
what is this roundabout a sequence ?
Its just a fancy sequence
yup
Well if you made that in #cpp Iโd prly show them the code
quite awesome by the way
like this yeah?
saves you time and its very handy
Well
Positive and zero mean 2 diff things technically but ig it depends how specific you need to be
Not sure how it saves time but it does have a visual appeal to some audiences
I mean, a zero situation shouldn't come up but... never know
Yeah 0 is a non-case,
So we add it just to cover it
It shouldnt ever happen tho
Unless its setup wrong in the level
just tested, it, seems to be working
Okay the RoundAbout sequence was an April's Fools prank ๐ฑ ๐
Did you get rid of GetActorOfClass?
Ohhhhhhh
Did anyone fall for it?
Did you fall ? Squize?
I rmbr you working on it tho?
Because roundabouts save time
nop. was just conceptual
for now I just have it spitting out strings
Do they tho?
So now the executions can pass the roundabout at the aame time
I did get it triggering backwards twice during the execution at one point...
These people put traffic lights in roundabouts now so it completely defeats the purpose lol
Now they just serve as a high accident risk
is it working ?
With new code?
yeah with the new code, shouldn't be an issue though, the teleport vector is hard coded to each instance of the teleporter using variables so.. it shouldn't be too much of an issue
Should need tohardcode it
Just use the actor forward vector
Add an arrow comp so you know whats "forward"
I know, what I'm getting at is the destination of the teleporter is using a variable so even if the teleporter double triggers it's not going to fling me off the map or anything
like it didn't trigger both forward and backwards simultaneously like before it triggered backwards twice when only entering it once
no just 1
like this is it now
the box being a box collider and an arrow to show which way is forwards
yeah idk why...
Are tping to a new teleporter?
Show complete code?
Fix first ๐
blueprints get messy fast
i just try not to make lines blend so i can see whats going on
but it's way more difficult than the typical top to bottom where you can just scroll up and down
you gotta do a lot of click drag
Theres shortcut keys
ok, now it's not working...
hey so i want to make a call of duty style map for my game where i have to use points to open doors but how can i make the map and the doors work like that
hey so i want to repaet the anim montage in the loop, but it doesnt work, anybody know how to fix it?
you could have an event that checks the points and if you have the amount of a variable set on the door then open it
This looks...
ok, and how could i make the actual map for the game
ok nvm it is working I just had it backwards
@gentle urchin it seems you got the dot product a bit wrong ๐ the front teleporter is working if the product is >= 0 but the back teleporter is working if it's <0
wdym ? you design it in ue like normal, what parts don't you understand ?
if you put a variable on and make it instance editable, expose on spawn, then you can put the door in the world
and set the variable for the amount of points
you could check on tick but i would do an event or something maybe that you run when points updates
or probably the most efficient would be to open upon collision if you have enough points
@lofty rapids @gentle urchin @lunar sleet @wise ravine got it working thanks for the help all, just need to fix the slight lighting issue and we're good, sorry for getting heated in the middle there but I appreciate the effort
#ue5-general most likely if you don't know how to make a level
how can i repeat an animation in the for loop?
normally i would use a state machin in the animation bp to loop an animation
but the problem your most likely having is the loop just runs really quick
so you see probably a few glitches and the last one play
Doesnt sound right
Me, wrong? Is this aprils fools joke?
๐
the thing is that i want to repat it a certin amount of times
not jsut loop constantly
i c, so the problem is your looping to fast like i mentioned
you could run them on a timer x amount of times
but that would take some messing with the numbers
somehow you need to know the last one ended
It looks very hardcoded and strange ..
You normally dont loop anims/montages to play like that
At best you want a foreachloopwait
But even then id reconsider.
@gentle urchin so that issue I mentioned before is becoming a problem, when I enter through the back end of the teleporter sometimes it will teleport me twice meaning I get sent through the floor, is there a way of limiting a set location node so it can only trigger a maximum of once in a certain time frame?
actually it's not just happening at the back it's happening on the front end sometimes too now
it's like it's detecting that the begin overlap happens twice even though there's only 1 trigger zone
I guess one way I could do it is make a variable called "is ready?" and set a branch off the begin overlap, and when the teleport executes have "is ready?" set to false, delay for one second, then have "is ready?" set to true allowing teleports again
any problems that could come of this?
Gotta see some code
this is what comes off the dot product
I need all of it
the reference going itno get position and whatnot is the actor location
you've seen the rest of it dude XD
it's this stuff we did before
I put the "is ready" branch in to add the delay in if that works
Ok so
There's a select node which cleans this up a bit
But for why this triggers twice...
Doesnt make sense to me
unreal being unreal?
Do you have two overlapping teleporters ?
no
yeah if you can see here, the teleporter is down below and "tp pos front" is a vector with a 3d widget that tells you the difference between the 2 locations
so what I do is I add the difference to the player character's location but sometimes it's triggering twice which kicks me out of the level
things don't usually just fire twice
yeah idk why it's happening, it's not like there's another teleporter up there the tp position is just empty corridor
So wheres the tp down?
on the opposite side of the looping corridor from tp pos front
Ok
Do a print string
From the OtherComponent -> get display name
Alll the way at the very start
why other component? it's not hooked up to anything
To check if thats whats going onn
Two different comps of the same actor overlapping
Capsule + mesh, for instance
it's just triggering the capsule component
that said I'm now having a hard time triggering the bug
it only happens ocassionally and it's not consistent
Didnit only print capsule while the bug happened?
idk I haven't got the bug to happen while I have prtstring added in
ok got it to happen finally and yes it only prints the capsule component
it prints it twice ?
yeah
also I am running into yet another issue....
this new issue is I started playing around with the positions of the teleport exits and whatnot, and.. it's only teleporting me along the Z axis...
despite the fact I'm adding together vectors to find the new location for the player character it only works up or down
I wouldnt really add vectors
Id just tp to the new location ๐
Adding is as you notice prone to issues like double add
Which shouldn't happen but if bugs exist then you never know
yeah but, what do I do if a player is mid jump and they teleport?
To bad for them ๐
it will ground them again which will make it real obvious they teleported
Fair
well do you have a teleport at top and bottom ?
yeah
So
wouldn't that fire twice ?
Set IsReady false
because you teleport into it it my fire off
Then delay (0.1)-> set IsReady true
they aren't on top of eachother so no
No they're far appart
when you teleport into it it won't fire off the one that you teleported into ?
as a collision ?
no you don't teleport into another teleporter, you teleport to a destination set by a variable
i c
but you see how in this one the variable for tp pos back is in the bottom left and the teleporter itself is in the top right, when I enter it, it only teleports me down, it ignores the left direction
So...
After tp set IsReady to false
Then a delay
And set IsReady to true
Should fix it
Since we didnt find the root cause,this is more like a band-aid solution but oh well
Nobody's gonna peek behind the curtains
yeah that fixes the double firing problem, but what about the problem of it not teleporting to the right location?
debug one thing at a time
^
best route to fix problems
we have debugged the double firing issue
that's why I'm moving on to the next issue
even with the double firing fixed the wrong location teleport is still an issue
What do you want to happen
are you using some sort of offset, or how are you teleporting ?
Current loc + offset vector
(theres also add actor relative location)
Which you can use directly
so whenever you create a variable for a vector you can spawn a little 3d widget that you can then move around in world to give a visual representation of where that vector is going, and then based on that it gives you the value of the offset in the variable like this
this is where that teleport is supposed to be moving
it is moving me -740 in the z direction, that works, but it is not teleporting me 330 in the y direction
Think you wanna enable 'teleport' on set location
like I did what you suggested and trimmed it down to add actor local offset and set it to teleport like this:
but it still won't work
Looks beautifull
yeah but it doesn't function XD
I even tried splitting the struct pin and feeding the X, Y and Z values in individually and it's still only moving me on 1 axis...
X doesn't work either ?
nope, tried doing this and it still won't work
so thats the location the character should spawn to ?
No, its the delta
current location + that
Ye
why set offset and net get actor location, set actor location
Offset is the same just less nodes
i feel like changing relative is odd, whats it "relative to ?
Its current location
i would try it with get, add, set
Thats what they had initially
that's how I had the code before, still didn't work
yeah idk what's going on but the x and y axis are completely broken when trying to do this teleport
Print the the current location of char
- the offset
Aand the new location of the char
ok so this is teleporting up, that works
is char, characteR?
Yes
this is what happens when I go through the Y teleporter.. it's moving me 32.5 in the positive direction when it's supposed to move me 325 in the negative direction... what?
it's somehow being multipled by -0.1?
wait no other way around same principle
it's supposed to move me +325 and it's moving me -32.5 because the print order is bottom to top
do you alter those values ?
or your just using them straight from how you place them in the level ?
so the way the vector variable with the 3d widget works is it's supposed to treat the positiuon of the widget (aka the little purple rhombus) as tthe place the vector is supposed to be pointing to, so when I add that to the character location it's supposed to take me to where that widget is
but it's not
so I tried rotating the widget around and trying it that way and it's not working either it just keeps teleporting me to the same place, about 32 units in the negative Y direction no matter what I input
X I haven't tested yet it's Z that works fine
you're adding local offset
yes... and?
Show your math for cooking up those vectors you're feeding it
it's just a variable that I set
but locally
Yes
The vector is local
To its owner
The teleporter
Char runs into teleporter
I showed it, the variable tp pos front and tp pos back are instance editable variables and on each instance of the teleporter has the variable set but it's not going where the variable is telling it to go
And is ment to be tp'ed the exact offset
adding local offset of 0, 330, -740 should move the thing 330 to the things RIGHT vector and -740 towards the things UP vector. What result are you getting?
it's relative to the thing
since you're using local
Char gets teleported based on the direction the char is facing
is that what you want?
no I want it teleported based on the offset of the teleporter
well the code you have is doing exactly what I said
you're adding the vector to the victims location in their current reference frame
is there a way you can have the vector widget show change in location based on world co-ordinates rather than local?
What coordinate system do you want the vector to be in, local to the teleporter?
There are 3 coordinate systems at play here
world, teleporter, character
what I want is the character to walk into the teleporter, then to be teleported A number of units in B direction from the perspective of the teleporter
so say 325 units in the teleporter's positive Y direction
What?!
Really?
ok so do it like this
Teleport char to TransformLocation(TheVector, Teleporter.GetWorldTransform)
in world space
not add local or anything like that, just set location
Yup
This teleports Target in Targets reference frame by Vector
I don't want to telepor to an exact location though I do want to offset the character to a different part of the map because I don't want it to be obvious they teleported
I'm basically doing impossible geometry here with corridors that loop back on themselves
Its an infinite corridor, if ran innone direction
you can use the teleporters variables
and just add to the get
i would do each seperately, split the pin because wtf not ?
Then do it like this
TeleportLocation = TransformDirection(TheVector, Teleporter.GetWorldTransform) + CharacterLocation
what's that in blueprints?
Or you can use AddActorWorldOffset like
AddActorWorldOffset(TransformDirection(TheVector, Teleporter.GetWorldTransform)
could you put that in simpler terms because I'm having a hard time wrapping my head around it
Adding vectors just... adds vector components (out.x = in1.x + in2.x etc).. ๐
so for the get actor transform that's the teleporter's transform I assume? or the player character's?
sorry if I sound absolutely retarded here just... trying to comprehend
Hello everyone, So currently im working on making a modular weapon system allowing creation and testing of weapons, using structures + Nested structures etc etc
In the past attempts of this i used Skeletal Mesh Components, which allow input mapping to be added and generally i'd say be a bit cleaner.
So for a bit more context the weapon can be dropped, picked up, reloaded, etc etc, basically using Call of duty as a reference.
Now, currently im working on a newer version that allows weapon modification similar to Call of duty.
So different weapon parts, affecting stats etc.
Issue being A Skeletal mesh component doesn't seem to be able to fit this - and a Skeletal Mesh actor while does the weapon attachment parts doesn't seem to do the interactivity im looking for.
Anyone know if there is something that can act a inbetween of the two or if there is something else to use that's better suited.
Just curious if anyone is able to give a hand and explain how they would do it.
took some more experimenting but I got it to work, thanks
hey whats the construction script?
Hey there. I'm working on a spell system and I want to rework some elements...
I want to put a make the player equip a spell (as if it was a weapon in their hands) by using an Object class.
Thing is, I'm not sure how that works...
@surreal peak Hey there, hope you're doing well... I'm back and will try to redo all this mess.
Whats your current setup
where's the lighting channel?
I think the teleporter is working now I just need to get the lighting fixed but I can't find it
i wonder what "Blueprint Category" is for
thanks, wasn't in my channel list
channels & roles, browse channels
theres a bunch that are not on the list by default
You will cringe.
The player has 2 slots each with a spell ID. The spell is read and pased through a switch to cast the corresponding spell.
Each spell is part of a component that is added onto the actor casting it.
This is inefficient, slow, convoluted and extremely unversatile.
I need to change it. I was told I could make an Object that is created by the actor when casting the spell, BUT noone actually told me how to do that.
Yes. It's all in the character.
Spell elements are however just separate BPs, naturally.
If anything, skillcomp should have the logic and list of all the spells
With some list of initial spells, and a method of adding / removing spells
Hello, i'm trying to implement a small animation logic with GAS , and i have this blueprint and i just wanted to know why i'm no going through the breakpoint, what should trigger Event Received ?
how do I get a ref to player?
get player character or get player pawn and i think there is others
Skillcomponent should have most of the logic related start executing a spell
Okay, so this is what I want to do.
The player can switch between 2 spell slots at will.
Thats fine
If the slot is empty, the M1 / M2 inputs are used to cast the spell.
Thats just invoking a function on the skillcomp
If not, then the inputs for that spell should be used instead.
are you storing the spells as a number in a string in an array ?
For example the fireball here has a normal fire in M1, and a heavy attack in M2.
Yeah the array comverts inputs as an INT id, converted into strings.
I would like to use a map instead of a switch.
but every time I try to make a map variable it just... breaks.
Do tell me how to make a map, I'm losing hair here.
And the spell itself
Im personally a fan of GameplayTags ๐ they're basically pre-made strings with hierarchy functionality
Yeah I love tags, but genuinely I cannot figure out maps.
If you have some explanation to make that, or a video you reccomend, I would greatly appreciate it...
Create your map variable,
As a gameplaytag
Then to the right of the var type clcik the small icon
Hello, i'm trying to implement a small animation logic with GAS , and i have this blueprint and i just wanted to know why i'm no going through the breakpoint, what should trigger Event Received ?
You'll get a dropdown list of 4 things. Var , array, map and set
its only usables with GAS right .
Wait, how do I create a variable as a gameplay tag?
No
oh
As you normally create variables, Just search for type Gameplaytag
Do I create it straight into the player character?
Is that were you want the map?
Not true but alright
No, I mean.
You can ofcourse put it in the componemt
The player is the only one in the game who can use it, or is designed to use it in the first place.
But maybe a component would be better.
Its not only for reusing purposes,
That also handles the logic to sort out the IDs.
Yeah, fair. I will make it a component then.
Anyhow, I just made the component and a variable...
So for this, I want to make it so each unique ID String returns its own specific Spell.
(Each gameplaytag?)
For that do I use string to what?
I'm not even sure how to implement gameplay tags here
Since I'm not good at coding I haven't figureo out the end goal of this system yet.
Perhaps each person that helps me just goes in a different direction and everything starts conflicting...
i dont find real examples of use cases of using gameplay tags
The component should:
- hold a list of all avaliable spells
- a Map of GameplayTag/Skillclass ?
- be able to check if we can fire a spell
- is it on cd?
- do we have the rss?
- be able to consume the necessary resources from the owner
- provide methods for trying to acticate a spell by gameplaytag
Okay yeah I'm sorry for not explaining properly about this system.
I'm doing something unique and unorthodox here.
Are you familiar with Magicka?
Heard about it
So the player can press a combination of buttons and cast a spell to put it on their hand (referred to as a Slot)
Once in a slot, the buttons that normally make the spells now make that spell do their relevant actions.
For example it can fire the spell, zoom in to aim it, charge it up, etc.
In otherwords I would have to make the input events of the spell override the ones of the player.
Yeah, and sadly I cannot figure out how to achieve that.
I feel maybe I need something similar to the default FPS template gun but I'm not sure how to get that.
What does that have that helps you ?
So for starters.
The gun has its own IA events.
That work in tandem with the player's.
The idea is that if the spell slots were to be occupied, the player's spell casting input could be completely ignored, while now the Spell's concrete inputs take over.
maybe mapping contexts
How could I use those here?
I would love to use them but I genuinely cannot figure out how.
i have not used them much i still use mostly the old input system
but my understanding is you can switch contexts
so your button actions would change
and you could do different things, but then you would also need to figure out what spell you were on
but you could also have a mode enum, and switch what the buttons do based on a mode you have set at some point
Hm but that would have to go on every single output for the events.
hmm
I genuinely hate not being a coder...
i think i would look into context
mapping context in the enhanced input system
you can set it up to have a different set of events in a different context
I think that can get pretty messy
Adding a new spell to hotbar needs a new context
i figured you could just flip it like modes
so just add the thing to the context and it'll work when thats on there
Yeah I imagined that as well.
So the idea is this
Whenever there is a spell currently in your hands, the event for casting spells is completely disabled.
Additionally I would need to find a way to make the events always be tied to the same input.
@gentle urchin Okay then, new idea... Enable / disable the mapping context on the player using the Controller bp
When are you " holding a spell in the hand?"
This is the logic I already explained
Player slot 1 is empty
Player presses the button combination to get the spell ID 111 and then casts it
Cast spell is put into hand
Now M1 and M2 do the specific spell's actions.
Yes
hey I have a sphere trace that hits the same enemy multiple times how do i fix that? Canยดt remember how.
Yes, exactly.
The idea here is to create a Spell object class into the hands of the player that takes over what the Mouse buttons do.
But if they switch to another spell slot, if that slot is empty, they can simply cast another spell.
And first spell is the 'base' for the rest of the elements. Order matters
If the player loses the spell, then they also recover the ability to cast new spells.
I mean order matters but I'm not sure where you got that first part.
Hello , please i'm struggling with PlayMontageAndWait and Wait Gameplay Event , i've read tons of different sources but i can't manage to make them work
I can do a properly replicated animation but the thing is that EventReceived is never triggered , if someone is up to tell mm few words that can unstuck me , it would be verry appreciated
Thank you again and sorry for bothering
If you start with "fire" element, then the actual spell is gonna be fire based is it not?
Even if you were to add 4 hurricane to it
Okay that's not relevant to the logic here...
I'm working first on how to put the spells on the player's hands.
It is relevant for the coding of it
You mentioned replication, is this a #multiplayer game?
That's it.
So does that count as 1 of those up to 5 element/modifiers , or is it 5 in addition ?
As i read magica its 1 + up to 4 modifiers.
No no...
The game is like magicka casting, not magicka casting.
Emphasis on like.
๐
The player inputs a morse code like combination to cast spells.
like the game magicka
yes i posted it on multiplayer channel aswell
Thats not very clear from your description and comparison
Ok, try not to cross-post, itโs against the #rules . You have a better shot there tbh, in case the event received is not firing because of a replication issue
so magicka with less buttons
The nature is different. For instance, magicka doesn't actually care about order for a bunch of spells
But in my case it's always relevant.
yes it does... it's only when you slap random elements together it doesn't care, for the actual spells order is important
so you want to click the buttons in a specific order ?
I mean tbh it kinda sounds like the casting version of helldivers 2 stratagems XD
i feel like your way with the switch does it work ? if so just go for it
It doesn't actually work how I need.
At most it makes me run a function based on what is on the spell slot.
But I cannot make more complex spells using that because I'm constrained to using the exact same Input action events.
there's something I want to try with this game with impossible geometry but idk if attempting it is going to make me want to shoot myself or not.... basically I want to make it so there's a free standing doorway that when you look through it, despite nothing being behind the doorway, you can look into a completely different room then walk through into said room... I know it's something that's possible because antichamber did it back on unreal engine 3, but I haven't the foggiest idea how I'd even start or what search terms to use to bring up a tutorial about it....
I remember seeing something akin to this
For instance, if I want to make the switch work how I want, BOTH spell events need this
Using some fancy techniques
With another switch running through the Occupied slots.
do you think you could find that thing or how they did it?
because the game I'm making is basically a maze that's full of brain bending geometry that makes no sense and each room has a hint to the actual pathway to finding your way out
that's why I wanted the looping corridor
I made some sprites for health bars and stuff like that but I don't know how to add them to the corner of the screen like i want, can someone please explain how to do this? I'm super inexperienced with UE5 still so please explain as simple as you can if you have an answer
look up how to add a UI to the screen via widgets, there should be plenty of tutorials about it
thanks
Maybe I should just give up...
create a widget, add a canvas, and add some images, set the anchors properly and set to 0 position
hi im trying to get information from an actor component that is sent to my third person character pushed to my UI and updated when i pick up coins
but cant figure out how to do it
Widget to ThirdPerChar to AC_Currency to ThirdPerChar to Widget
is this a good system, or should i use something else with currency?
i plan to use this for random loot as well to call a random number to get loot from chests or enemies
trading/widgetInfo/storage/store and so on
Couldnt find it rn
It was some fancy stuff without using scene capture iirc
I've put up a question on the forums about it hopefully that wil yield a result...
tbh I haven't even gotten an answer on how to teleport without the light slightly flickering yet...
Widget should bind to a currency delegate in the AC. Doesnt even need to know what type the player is
Get owning player -> get pawn -> get component by class (ac currency) -> bind to currencyChanged.
Store the comp ref, update current value, aand update on the bound event
Lookup render targets.
Basically you have a camera that that draws what it sees onto a plane, and then you place the plane on your doorway to emulate the "portal" effect
the only issue I could see with that is a lack of paralax, like if you moved to the left or right side of the doorway you wouldn't see the room move around as you change perspective angle, it would just be a flat plane view of the room
The seemless portal thing is def a lot of finetuning to get done properly.
You send the angles you're looking at from your main-camera to the "portal" camera
so in code how would this work? Would you get the forward vector of the player's camera component, get the world rotation, then have the portal camera constantly updating based on that?
You basically just assign your cameras transform to the "portal camera" transform and then add the offset to the portal camera so that its looking at whatever scene it should be
If you want to do the seemless transition between the two areas its a bunch of work~~
you spawn a duplicate mesh (animating identical to your character) so that when you step through the potral (but your main camera is still in the old scene) you're actually looking at the render-target with the "dummy" player character, and once your camera can no longer see the old scene, you teleport to the new scene (and theoretically if done properly the telepor twill be completely invis to the player)
would you be able to help me actually put this into code because I'm trying to figure out how it would work
i love you random stranger, now i have a refrence to what i need look up from here ๐
Setup a render target with a camera first. Then have that render target placed on the doorway/plane that you want to use as a portal~~
The camera in the other scenes position should simply be the exact same offset from the camera in the original scene.
IE if your camera is 10m from the portal, the "Portal Camrea" is 10m from the portal/area you are teleporting to.
(Note: You might need to make the second portal invisible to the other second camera)
I'm down to help but start there^
Hey all, I was just wondering if there was a cleaner way to handle switching between preset resolutions for a settings menu; I've got a variable acting as an index (int), and a variable for the resolution (int point)
Map class (Map resolutions to indicies). In your specific case, you can also just use an Array (and the index of the resolution would then be the "resolution index")
Ah alrighty, thanks! ๐
I just felt like the cycling through branches was a bit of a patchwork approach ๐ if that's not the case then that's fine
idk i'm not a professional, i just think it looks ok to me
So a switch is generally preferable to use when the actual "branching" of it results in different code executing
In this case we're just trying to map "Resolutions" to "Indicies"
Like wise we can use a single node "Find" (from Map) to properly get the index from the resolution which is obviously less nodes/work then creating a switch statement
i can see replacing the branches with a map
but i don't see how that replaces the switch
i have not used a map in ue, i understand a bit of how it works
thats what the map will fix
all the branches
slight issue, I have the render target set up but the mesh I've put it on is doing this?
because it's 1x2 in size it's repeating the texture?
how can I make the material stretch instead of repeating like that? The render target size is 1x2 idk why this is doing this
wait, figured it out...
@stable birch the render target version of the window looks kinda white and washed out, compared to the rest of the scene, is there a way to fix this?
check if the camera settings between the two scenes is the same
both the player camera and the scene camera are using the same camera settings
it's just the default camera
Hi guys, I have a light fixture with 9 spotlights in a row. I want them to turn on and off in a sequence. I'm using a Box collision to move from one spotlight to the other and back. The box moves correctly but doesnt seem to trigger anything. Here's my blueprint, can you help me finding what doesn't look good?
so you want to do them in sequence and i'm guessing it does them all at once ?
theres a few things you could do "better" as far as performance goes
So far it doesnt seem to be doing anything
so the first thing is to check if the event is firing
with a print string right at the beginning see if it prints
i think i see what your trying to do, when you collide with a light activate it ?
if your using the collider for that thats definately not how to go about it
nothing prints..
yes this is what i was trying to do. What woul be a better way? Sequence and delays?
so the first problem is the collision isn't actually firing
what does the collision settings look like on the box, and the light ?
the collision on the box is OverlapAll
and the light ?
I dont see any collision settings on the light
my spotlights are children of another Mesh, woudl that be a pb?
i don't think so
you mean in the viewport, or bp wise ?
the static mesh is children of another static mesh
in the bp
i can see collision paramters on the SMs but not on the spotlights
the parent SMs are both on BlockAllDynamic
hmm
well i would say you got to get that thing firing before you start working with it
is there a better way to do it without collision to trigger the intensity timeline on each specific spot?
ya because you want them to trigger in a sequence not just on overlap correct ?
if you want them to trigger as you walk down the collision is probably your best bet
basically i'm trying to do the light at the front of the car in knight rider if you see what i mean
i dont have a player/pawn to enter the collision box
so you just want it to go back and forth ?
yes ๐
you could do this with some timers but it's probably super hacky
interval * index
in a foreach
put them all in array
i just need back and forth for now but i m also looking for a solution that helps me do other patterns later
well you could try it to get it going one way first
then try to reverse it
but i have an idea like i said with timers
you can make a custom event
how do you put multiple objects in an array? I know the concept but Ive never used them.
you can do make array
and then loop over that
make array you just add the stuff to the pins
it "make" the array
got it, so once my array is created with all spotlight, where do i got from here?
i'm actually looking at it now to see if it would even work
thanks a lot!
I solved the problem where I was getting caught on ledges by lowering my acceleration value a bit. I had it very high so that I would instantly start running, but turning it back down to a still large, but less ridiculous number, seems to have fixed my problem. Also I mentioned this before, but when my acceleration was high, "Use flat base for floor checks" would switch between getting caught, and snapping my feet onto the platform (instead of finishing the jump arc). Lowering the acceleration fixed both versions of this problem
i made the thing visible
but the point is you can run the events in interval using a timer
then i would use a boolean for direction
- in one direction - in the other
and just switch the direction back and forth to get the effect your looking for
or you could make a macro but i don't know how to do that yet
there may be better ways to do that idk
Let me try this. thanks again for the help
Any thoughts on why my cast is failing here? The controlled pawn here is a child class of AParentSoldier, so I'm not sure why that's happening.
ok so the pawn returned from GetControlledPawn is invalid. Never seen that before
you're getting a "Controller" and trying to cast it to a "Pawn", those 2 types are different so that's why it fails
I guess
I'm on a controller, so wouldn't getcontrolledpawn return the pawn that is controlled? not the controller?
Oh my bad
All good! I feel like im taking crazy pillz rn
Is the controlled pawn by that controller a child of "ParentSoldier" ?
Try doing it from the pawn possessed event instead of begin play
Is this C++ only? I don't see any mention of it online ๐
ok so the controlled pawn, on printing it, is the childclass, BritishRifleman. So why would that not cast to its parent as well?
yea that's what's returning the child class
print the name of the controlled pawn to see if the right pawn that's been possessed
Yep, so thatโs where you want to do what youโre doing. The controller spawning is what triggers begin play, it wonโt have a pawn at that point
yea that is the right class, I'm just not sure why I can't cast that to its parent class, AParentSoldier?
i'm not sure you can cast up
I mis stated what I was saying. These are BP classes that directly inherit from AParentSoldier. Does that still make them child classes?
you right clicked and create child ?
i don't think you can cast up, only down
https://youtu.be/JzBLiF1FV7s?si=ABXz_W0_bugh6PuY all done in blueprint
wdym
you can cast to any parent
yea i do it all over lol not sure why my shit is broke
but if you're in the child you prly shouldn't be casting up
nah im on a controller.
get the display name of the controlled pawn and print that
maybe you're not controlling what you think you are
yea i have been. I'm on the correct thing and the cast is functioning now, seemingly. Its at least not hitting the 'cast failed' print out, but its also not grabbing the object it should be. I think my system is haunted
and if it isn't, I will be after this
when in doubt, restart engine ๐
yea i have:( and rebuilt intermediate and bin
but it works now?
the cast does, but accessing the component i need to doesn't for some odd reason
like I can set the ref in OnPossess and it displays the correct name, but when I try to access it in beginplay, its invalid
Try accessing it with delay, maybe it's not fully initialized yet
where were you 4 hours ago
tysm for the suggestion! idk why i didn't think of that
Yep always go with delay if something fails during cast. Especially if you cast from controller since it's created much earlier than rest of the actors
ok! that's a really good tip, thx!
Np^^ But delay is more of a debug than a solution. I suggest replacing it with event dispatcher. Like when component fully initialized make it send an event dispatcher and then on the controller side subscribe to that event and access the needed stuff
do the nodes on the blueprnt graph account for initialization? So if I slap the event call at the end of that sequence where the cast is made, will it be initialized by that point?
The event signal should be sent from the component itself, can do it straight away at the begin play. This way it will "tell" that it's initialized and ready to be accessed
so are you saying do it like this? Then how do I get this to go to begin play?
sorry, I'm new with events
ohhhh i see what you're saying now, ok.
My items are created from a Data Asset. In the item object I have a reference to the Data Asset that was used to create it, it houses a bunch of static data for the item. Depending on the type of item there can be loads of blank fields. It's a Data Asset, and it's not replicated or changed or anything at runtime. Are the loads of blank fields going to eat memory or anything?
In a meaningful or concerning way
How to change the intensity of a light when a moving box collision in the same BP hits the light. I tried with the is overlapping Actor node but the "other" branch doesnt let me input a spot light component object ref
Can Someone help, I've been having this problem where every time i plug in this variable a bunch of errors appear but i cant figure out why??
is there a way to make traditional configs in game files? smth like this:
USSR.T34
{
engine_p: 560
ap_dmg: 160
shells: ap, heat, he
}
or like, any other type of config which is open source so anyone can edit it
UDeveloperSettings if you are into C++
otherwise best bet is probably to use some json helper plugins from the marketplace
Your "Character Movement" variable doesn't have a value set in it.
Perhaps you want to get your "Casted Character" and get the Character Movement Component from that?
can ue4 even read basic text files through blueprint?
aight i think it would be easier to make variables editable ingame
thru some kind of devmode
In a meaningful way, yes. A variable without a value is still reserved space in memory to hold that value, or in the case of numeric values, their default value.
In a concerning way, not likely. One int variable takes up only about 4 bytes. A float, 8 bytes. So again, 1000 int fields and 1000 float fields would = ~12000 bytes give or take. Even if you had 10000 items loaded that had these 2000 fields, that would still only be about 120MB. That's not small by any means, but less than 2% of the amount of memory available on an 8GB system, and this is also an extremely exaggerated example.
I'm pretty sure that's what i did but ill try again to see if i did it wrong
do you guys know of any way in which i can spawn the nav mesh dynamically on a platform im spawning mid play? I tried to us the dynamicmodifier only with a nav mesh invoker but that isnt working
Gotta set nav gen to dynamic
thank you
Hey, I have 2 actors and I want there to be no collision between the two of them specifically. How do I do that?
Question: I have an array of 5 floats. How should I find the 3 floats in the array with the lowest value?
sort them
๐ฅบ
glhf!
and i could make a new array by looping the lowest from the old one into the new one, and removing each from the old ones
and pick the top 3 from the new array
then i don't have to worry about having to loop only 3 times
big brain
to be battle tested
Works : )
The entire macro
This might work
Fails if input array is < number of entries.^
Copies the input if its ==
runs the search if theres more entries than number to return
one more thing, "REMOVE INDEX" shrinks the array after removing the item, correct?"
yepp
we also make a copy of the array to make sure we dont modify the original array ๐
ty
For prosperity, what I was actually trying to do was: I made a BP actor called Nav Beacon, because I want to place a bunch of them around the map as a pseudo-navmesh for an AI flyer. So I needed each beacon to find the nearest 4 beacons as options for the AI.
Ended up with this
nope XD
I ought to learn cpp at some point ain't i
yepp ๐
{
QuickSort(Actors, 0, Actors.Num() - 1, Target);
return Actors;
}
It opens many new doors, even for simple loops and stuff
access to things that simply isnt bp exposed
Hello everyone, I'm making a trace and limiting the time it damages the enemy by 1 per trace but it doesnt work
I'm unsure why
You dont need to check containsn
AddUnique chevks for you
Just check the outgoing index to be != -1
the orange are the actors hit
hmm
(The out index from AddUnique)
Yeah having the same outcome
Need to see more of the code fwiw
Well there are these ghosts actors that have no name but still makes damage to the guy
as you can see here
sure which part
You're not checking for blocking hit for one
So Actor hit can be null
Null being added to the array, and attempted damaged
Assuming thenlast pic goes directly to the one we got before..
Would explain one of the empty prints atleast
ah okkk
Tho it shouldnt damage the other actor ๐
Yeah so that isn't the issue lol I was mistaken
so the issue is
On the damage GE
Ok found the issue
GE was instanced per execution
how would you make a static var that is cross instances
Store it in some easily accesible uobject
Which they all just reference
Oh sorry, cross instance. Not cross classes
Sounds like a regular var in bp
Do they even support static/const
well not really
Const function?
might do the trick
also,
lets say i have a actor that needs a ACBP ref
if i place this actor in the world, can i "select" the needed ACBP using another actor ?
hard to write the question
Sadly, I am no longer familiar enough with that sync of paks on runtime server-client to provide relevant help.
is there a way to get a class' variables, get one (set per instance before run-time) and change it during run time? For example I want the variable that I get be an instance variable based on the BP_PizzaChef class' variables.
I'm not really sure what you're asking
the variable you get there is that instance's value
it may or may not be different from all other instances
depending on if you've changed it
What I want to do is set the get part of the function.
Here it is get(CoyoteTime)
I want it to be get(VariableSetInInstance)
This requires:
- The ability to limit VariableSetInInstance to be variables from the class I want to use.
- The ability to have a more dynamic get/set which can have both a reference and a variable as input.
Idk it is hard to communicate what I mean, I'm not a programmer ^^"
I have this problem when i change splines in blueprint:
https://www.reddit.com/r/unrealengine/comments/gycgwj/meshes_placed_on_spline_not_updating_after/
Can anyone solve it?
I'm just going to hardcode it
constructionscript isnt ran on child actor comps
you'd want to wrap it in a function and call that in the owners construction script
Also directly modifying the spline itself doesnt tell the rest of the logic to do any updates
What node would I use if I'm just going to do a bunch of branching? I want to use one node that checks conditions each time it is run. If one is true, it runs that pin.
i think you want 'Or' node
Thanks!
I need your guide, it's recommended to use actors child for a multiplayer game? Because when I use the BP Actor my game runs well, but if I use a child, my game doesn't work well
^
Im not sure why they're so tempting to be used
Guesd they may feel logical at some point
Sometimes you just want an actor inside another actor at design time.
That's the one change I'd make to unreal if I could
And it's the most attractive thing about Godot to me
Basically a scene with multiple actors, whitout it being a level?
Yeah that could make sense
I guess that was the attempt with CAC aswell
A house nowaday would be a BPP tho right ?
Or whatever its called
The thing that unreal does weirdly compared to many other engines is the fact that an actor is a thing. If you think about it, an actor is kind of like an implied component. You could just as easily have a system where you have prefabs and you put all the stuff that is in the actor nowadays inside of a component
so what is the workaround if this cant be done ?
i got some actors that have childs actors such as doors
Level Instances
anyone know what the issue with incrementation happening in this blueprint ? https://blueprintue.com/blueprint/r_gs1_np/
the two arrays in question are of the same length [4] and this is the function which is being called : https://blueprintue.com/blueprint/quwr-zrc/
i heard get actor of class is expensive to do on tick, you may want to set those up in begin play if you can
why is the timeline being played on tick
a timeline is basically a temporary tick
April fools was yesterday but that still made me laugh
when adding to the index, your not checking if the index is actually valid before you get
so ig in theory you may get some empty gets
maybe you might get accessed none , trying to access out of bounds
This is cursed
Its legit in the description of the node
it's best to try to do that stuff on begin play
i imagine it would kill performance like you say it's in the description
if you think about it, under the hood it has to search all the actors most likely
Probably not to bad but its generally viewed as bad practice
Its fine for editor stuff where it doesnt matter , and 'hacks' are ok
i just feel like if you got a lot of actors it'll be worse than if you have less
i know if i was going to write a "get actor of class" you would search all actors then break when you found it
It worsens the deeper hieriarchies you got
And more actors in the scene to consider
There is an icon I am trying to disanble entirely in my actor blueprints but have been unable to find the source. Anyone know what this icon represents?