#blueprint
402296 messages ยท Page 787 of 403
A desesperate msg before sleeping. it seems that all my Bp Child variables are reseted after doing some categories.
It's a total mess.
Any magic way to fix that? or i must re-enter 60 variables into my ten more BP childs?
is it forbiden to set categories at the middle of a project?
bind events are part of event dispatchers
wut?
not sure what happens. I made categories. clean. over.
i literally have no idea what you are talking about
my Bp Child variables have been reseted after cleaning my BP variables into categories.
so in the parent bp, you put variables into categories
and now they are reset in the child? they're still there, but the values are defaulted?
yep defaulted
oh dang, that def doesn't seem right
checked things are uncheck, value set to 0, empty slot, etc..
nah i getcha
it it a total mess
you dont have source control?
sure my game is totally broke
nah, like perforce
i don't know what is that
maybe there is a recently saved version of your parent/child classes in the autosaves folder
you know, before the categories
how to bring it back?
go find them in autosaves and replaced them lol
ah drag n drop
autosaves are litterally just backed up copies at certain times
i will try that
pretty much
a bummer though, categories shouldnt though that so i dunno if its a bug or something else
i discover that i'm not alone...
ah so its an engine bug
a very serious show ender bug
just tried it, doesnt happen on my end, 4.26.1
gn
Sorry I meant to say event dispatchers vs directly linking references
direct link via cast or something?
alright well, i can give you an example
lets say you have a trigger, a simple sphere collider, and when the player enters it you want it to do something - change a light color, open a door, spawn an enemy, etc. If you have a direct reference, you have to tell this trigger what it should know it can interact with and/or those things that are triggered by this trigger must know of it within code. If the trigger uses an event dispatcher, all it needs to do is call its EDs when it is triggered. Then, whether its a door or light or something, that actor can bind whatever events it wants to those EDs. So the same trigger can now achieve what it does - notify when a player has entered (or exitted) the trigger - and the code for "what it does" is defined uniquely in the actor that utilizes those EDs. And every actor can utilize those EDs simply by being aware of that specific trigger to therefore enact it.
Would you know if there is a difference in performance and resource usage?
You can check out https://www.youtube.com/watch?v=EM_HYqQdToE - it breaks down these two methods along with interfaces
i dont necessarily know, but i wouldnt assume there is a difference there
more in how often it is called maybe, but the technique is merely that
Ah the man with the golden voice!
indeed
Reason I'm pursuing this is because I think I'm calling too many things at once that it crashes my project, but it won't tell me what the error is, or is extremely vague
๐คท
So yea I'm going to go r this event dispatcher thing a go
good luck, i hope it solves the error
Hi all, I have a problem with Interface.... I made a topview game, I want the mouse pointer widget image to change when my pointer is over a mob. How can I do that with Int ? do I need to send the ref of the widget and then in my BP retrieve this reference to be able to change the pointer ?
or maybe Interface is not the right thing to use in this case ?
I need to change mouse cursor in runtime, it a custom pointer made with a widget
help, I tried to implement linetraces shooting mechanic, where I can shoot linetraces from the middle of the screen. But the linetrace location seems a bit off from my crosshair. Here's some method that I already tried.
this is the footage
I have found a BP without the categories in it.
But now all BPC_Child cound open anymore.
"Blueprint could not be loaded because it derives from an invalid class. Check to make sure the parent class for this blueprint hasn't been removed! Do you want to continue (it can crash the editor)?"
Any way to re-point them?
never had the error, so i dont know. if your loading children and they arent finding their parent, you could set their class, but i would assume they have the same problem of not retaining their custom variable values
might be kinda late, but backing up your project would be good in case things get worse
backing up that mess?!
yeah i'm doing part backup
but now i must try to bring it back like it was before i tried to get back the saved version of my BP...
from what you mentioned before all of this, it sounded like it was just a matter of setting your child bp with params again
What's the point to bring back an old version if the childs can't point on it...*
the error also sounds like you renamed the parent class name?
They are saved with 'date' on it. i must keep that?
i tried to rename all asset like it has to be
mine have "_Auto" suffixed to them, dunno about date
do you remove "auto", when you bring them back?
yeah
you saved over the parent class?
........alright
just drag&drop, renamed, restart
well, probably shouldnt do this while engine is running
does anybody know how to fix this? I have no idea how it happened
if it's hard to see, the mesh is duplicating and only 1 is animating
better picture
whats the component list of this bp look like? are you spawning weapons in hand?
hi can anyone tell me how "add impulse to body " work im specifying bone name and some impulse value but the thing is if i keep the value low and even high im getting same body swing not like 10 should have less impact and 100 should have more
the hands and gun are together and change depending on the weapon selected
It was fine before but now it's doing that
this is the parent
it only shows up for that specific child, if i make it hidden and choose a different gun this doesn't happen
try 200000
definitely a dupe somewhere. since one of them doesnt animate you can check to see if one does not have the anim bp hooked up to it in its details. Are you using the parent then spawning the child?
I shouldn't be spawning anything, I can only change it from blueprint
Sounds like the Guns mesh has it's own arms then?
If the Guns mesh has it's own arms. You need to remove the others arms mesh.
the gun/arms in the Parent are a child component that gets its info from the child classes
might just remake that child because i can't figure out why it started doing that out of nowhere
made a new child bp and the problem is gone
going to remake the nodes
Is there a way to do this differently? I now have this Branch tree which is not really easy to maintain if I want another Coin to Drop?
If its just this, check first bool, if false, check second bool
If you plan to have more of these bools maybe use an enum with switch
if you want it to become more complex, state machine is the thing you want to look up (https://www.youtube.com/watch?v=Eh-ONuMYADA)
This video describes three ways to deal with state in game programming. An ad hoc approach can be used to get a system up and running, but it often results in code that is hard to read and maintain. Analysis of the problem reveals an underlying state machine, and so the second approach is to model the state machine explicitly using an enumerated...
Lol of course! Sorry for my stupid question.
Alright I'll look into using state machines
Thanks a lot!
and weighted spawn tables could be an interesting thing to look up too if im guessing correctly what you want to do ๐
Will do! Thanks for the help!
Rotation problem... I have two actors that are rotating, at different speeds, and I need to keep track of the roll difference, so it should be like from -180 to 180, but the problem is that by simply subtracting values from each other, there are points where one actor is rotated 165 but the other is -25, and it then results 190... No matter how I subtract/add these values together, there is always this small error around 180 or -180. What would be the proper way to handle this with out complicated branching
Each actor standalone tracks correctly between -180 to 180 in relation to the world, but when calculated together there is always this zone near the +- cut point where one actor is already on the other side, while other is not, and depending how they are calculated together I always get error on one side, for example seeing values such as +210 jumping to -150 on the cut point
https://en.wikipedia.org/wiki/Euler_angles
it is painful. i tried spinning wheels around and when they went over 360ยฐ it became super strange. are you building a puzzle or what are you trying to make?
The Euler angles are three angles introduced by Leonhard Euler to describe the orientation of a rigid body with respect to a fixed coordinate system.They can also represent the orientation of a mobile frame of reference in physics or the orientation of a general basis in 3-dimensional linear algebra. Alternative forms were later introduced by Pe...
you want to make rotations use the same hemisphere
It's for the information on the HUD of the spacecraft, that has to match the speeds of the other craft. I also have other things I did with rotations, like autopiloting the craft, matching angles and all that works, just can't get clean info of the numbers
just make all rotations use positive values
I know rotations are difficult, I've been fighting with solar panel tracking logic also, which is hard because the rotations happen over multiple joints and limited axis
eezeh got a good point here, you can offset the values after shortly before you display them
and to add to this, you can then manually make it appear as negative values
so for example, 0 to 180 would become -180 to 0
180 to 360 would be 0 to 180
just by remapping the positive values
well yeah it's a simple version of remapping in this case ๐
oh ok ๐
but it makes all the math so much easier
yeah, i'm building branches to check the values to transform them but so far the error remains, so i just thought i should ask all the gurus before i build some super complicated node tree to do something that can be done simply
yeah if you just want the difference then adding 180 to each one then subtracting will give you the difference in ห
that's not guaranteed
it might for unreal engine, but I know some engines have REAAAALY weird rotations
Can't get my Heat meter to update when i switch to the weapon, it becomes unhidden but loses its function 
unity just keep adding rotations for example
ABS(ABS(RotA)-ABS(RotB))?
so you can have -54642 degrees ๐คฃ
yeah luckily a rotator in UE is -180 to + 180
always wraps
sometimes annoying, many times useful ๐
are you using a flipflop? ๐
no im trying to find my glass orb to see what you did there that would cause such bug ๐
when you swap wea
same case here, wouldn't always work ๐
im just gonna show you the code
I see, actually I was also thinking some ABS solution but didn't try it yet... I'll try that and also the adding 180 method
in which example?
in case it's not clamped -180 to 180
this is all I did,
Surely you'd need to make sure you're working with a fixed range ๐ Normalize to range
its all the same and the two on the bottom are not cnnected
you are just setting the visibility here
well its not connected but i just noticed you did a funny cris cros
is it not connected on purpose?
no that was a mistake
whats teh "functionality" of you heat gun?
do you switch it off or store the gun at any point?
while the gun is firing the meter goes up until it overheats
yeah this code is for when i swap weapons
and whats the function to reduce the overheat?
it does it over time
does this still get called when you swap the weapons?
Result%180, no?
yeah the gun works, it's just not updating
or is it stuck in overheated state forever
have to fix the angles before subtracting, but yeah modulo will do the trick
wait, the widget that you display is not updating??
yes
aaah okay. can you show the widget then pls?
what do you use to draw information to display
Thanks guys for the input. I'll try
great, i mean the code ๐
hold
how does the little bar know it should update
due either you want help, then just show some screenshots
you know you can do stuff like this in an uncountable fashion of ways?
then show the swap script part
where do you reset the "is overheated" bool
where the fk did that screenshot go
you're not giving a lot to work with ๐
thank you eezeh ^^;
why only half the nodes on that screenshot
it's a lot of code
how does the UI get this value? how does it use it?
is it a binding? a function?
how does the binding work? or how does the function work?
etc...
give us context to work with ๐
it's bound to the CurrentHeat Variable
and not words, actual visual node structure
so we can help you debug ๐
this part would be interesting
because we want to steal your idea and become rich with that heat gun we then can implement into our own games, you know?
๐
uploading copied game to steam
its only "on conscruct"
he said it's bound, so it's not in the graph there
can you show the binding in that case?
i tried to have a custom update event and that didnt work
what did you hide ther
When the gun is swapped,
i suppose you must update this reference aswell
since the logic seem to work that way
It would be preferable to save the gun reference in the character, so that the UI can read the current GunReference from the character,
did you try disconnecting all the cables on your router and restart?
instead of making its own variable for it
Right now the guns are all children of a main gun parent that attaches to the First Person Char
Which is fine,
but i bet
you're spawning the new gun
with spawn actor from class
and you're probably setting the child actor to this new gun
not sure, never really worked with child actors
in any case, seeing the gun updated,
assuming that part works
you still fail to update the UI reference
What probably would work
Which is strange because ammo updates
is if you just save the child reference instead
but again... i'd rather see the gun ref saved in the char
and not in the UI
not really
it gets messy whenever you create several references to the very same thing
makes it harder to keep track of what you must update when
let me experiment
Hello. I'm currently trying to follow this guy's tutorial for linking the jump animation.. but he skipped the part where the 'is falling' variable is made
what variable is this?
Fixed one gun, now the other
i cant find out and im stuck like this
oh thats not a variable you have to make
๐
This fixes the rotations to always show difference in -180 to 180 range... now someone please tell me there is a less complicated way to achieve this?
can be combined
whats the output range? 0-360 ?
as i see it you can just modulo it?
I need -180 to 180 because player knows from + or - if roll left or right. This math i just think step by step where i need to get, if it can be simplified that would be great
modulo is the way to go for angles
I have never even heard about modulo, i am just beginner
it's basically the remainder after division
it doesnt enjoy negative numbers tho
examples:
5 % 10 = 5
15 % 10 = 5
10 % 10 = 0
-9 % 10 = 1
does it also go negative
oh
like that ๐คฃ
I just tested in excel , i had no clue x)
well it depends on implementation
I think unreal just goes negative like you would expect
-9 % 10 = -9
but I could be wrong
ok I can sort of understand from examples what it does, but looks like it it is just ABS subtract based on those few examples
modulo will effectively clamp your number
360 % 180 = 0
180 % 180 = 0
720 % 180 = 0
721 % 180 = 1
sort of, if you see it with a loop
Ok, I feel dumb but can't really get how it can be utilized here, where should I put this to simplify what I have
ok so your angle is always going to be > -360 right?
no it is between -180 or 180
IF Rot.X> 0 THEN
(%180)
ELSE
(%-180)
Assuming it behaves like the excel version
yeah but I mean the input
the input is also that range
๐ค then why do you need all that math
my way of thinking: if you just add +360 to any angle
then %360 you will have the positive version of your angle clamped to 0 to 360
because when these two things rotate in different rates, it doesn't always give you -180 to 180 input
but can give you like -150 to 210 if one of the actors is positive and the other is negative
can just skip that if you add 360 and modulo 360
select float, wow that looks like something could become useful
didn't know such things exist either
180 won't give you same angle ๐
range -180 to 180 becomes 0 - 360, modulo handles clamping
-50 will become 130 degrees
but i don't want 360
-50 in a range from -180 to 180 is equal to 130 in a range from 0 to 360 *
yeye but you just do -180 at the end
okay that hurt my brain for a second ๐
xD not gonna disagree there
it sounds wrong aswell
but meh, we'll see what works ๐
Currently working in the 0 to 360 range myself, trying to simulate a device as accurate as possible
some positioning device.. been a pain in the ass for along while
what kind of device?
A relative positioning device, not really related to ue4 ๐
Engine running with inductive sensors
This works, sheehs how simple... great that it works, I just can't read it lol
but that's quite a reduction in nodes... not a single if cause
i have a feeling this can also solve my solar panel tracking logic... assuming i first understand this node's true function haha
Thank you so much all of you for pointing out the way
Guys I need help with Displaying the Race Position of Racers
What am i looking at even
i can see there's some trial and error involved
you want the light trigger
i just took the first i found in a totally unrelated bp
Heyy, so, when I put my variable HealthIncreaseTimerName with the name IncreaseHealth inside it, that's where the problem is, it doesn't call me at all, but if I leave it disconnected from my variable as in this example it works
and you're sure the input string is correct?
Yes, in my variable HealthIncreaseTimerName, it is written IncreaseHealth
I don't understand why, it's extremely frustrating
Guess I shouldnt ask why you need it as a variable
I find that with a variable the code is much cleaner?
Works vs doesnt work, not sure that's where i'd put my energy ๐
no obvious reason why it shouldnt work tho if they are the same
you can try to input literal string, to see if that works ?
but.. it will be the same ๐
It works, but I want my variable xD
help, I tried to implement linetraces shooting mechanic, where I can shoot linetraces from the middle of the screen. But the linetrace location seems a bit off from my crosshair. Here's some method that I already tried.
https://cdn.discordapp.com/attachments/221798862938046464/922359861667303454/unknown.png
https://cdn.discordapp.com/attachments/221798862938046464/922359862015447060/unknown.png
https://cdn.discordapp.com/attachments/221798862938046464/922361299738959872/2021-12-20_12-32-42.mp4
did literal string work?
Yes yes
Soo
last question
are you modifying the HealthIncreaseTimerName elsewhere ๐
do a print string right before set timer by function name
or compare it to the literal string
literally, do a == between the strings
and print the result
The print string returns nothing
It sends me back false*
exactly
I had not put in the string ^^
xD geesh
Doesn't that make sense?
sounds like you're modifying the stringvariable
try to just promote a new variable from the literal name
it should be with the correct name alreadyu
it doesn't work anyway, kill me dude
Thanks anyway for the help !
no execution input, no text in the variable
does the track have a spline? If so you can use the distance from that
screenshot says otherwise
Still no execution wire
how is your code supposed to be executed
This is the execution flow
Ofcourse you need
No...
Whatever event that switches the state of the light
Things should as often as they can be vent driven, not tick driven
Yes you do
this part
the E
just wondered because i tried with some ESP32 + MPU9250 before
is your event for switching the light status
and yea, for world space positioning an accelerometer + gyro aren't enough
Mine is just relative rotation around a single axis using a incremental encoder. Not world position (sounds way more interesting than my setup really)
ah ok
for rotation a gyro works fine in my experience (at least the MPU9250)
but incremental encoder should do fine, too. if you have a fixed mount anyways
For mm precision? I'd be surprised if it were that accurate
probably not, more like "usable for gameplay" accurate ๐
we have to stop it with a relay due to cpu inaccuracy ๐
didn't we answer this question with multiple solutions yesterday?
"Is Light On" isnt updated by anything
https://www.youtube.com/watch?v=xYCCjotsrMg&list=PLZlv_N0_O1gYdhCvvMKGpCF6LCgBz9XeS&index=3&ab_channel=UnrealEngine
here you have a link to an unreal tutorial series that explains a checkpoint system which you could use
In this video we create our Checkpoint Blueprint so that we have something that players need to drive through during our race. We add all the components and script needed so that by the end of this video we can test our checkpoint out in the level.
(00:05) - Intro
(00:36) - Components
(04:54) - Variable Setup
(06:47) - Event Graph Functionality...
So assuming its default value is false, it would always go the false path of the branch, setting the text to what it currently is
This is inaccurate
the collision doesnt define the state of the light
you're mixing up the logic mate
Its the wrong way
the E is the trigger for switching the light state
if and only if already colliding
After the branch,
and set it to itself, with a NOT
so it toggles
this same variable can be used for the visiblity
๐ค what exactly are you creating
well I guess squize just gave you the full code haha
altho one thing: if you have multiple things being able to overlap be careful with a setup like this
@gentle urchin A Little help man?
The drawback of posting solutions i guess
You've been explained how to do it already :p
And given a link
Sorry.... But those were too much to take in and I didn't get a clear Idea @gentle urchin
I have checkpoints and stuff right but don't know how to calculate it
and sort the array accordingly
Once the calc is done, stuff it in a float array and just "get min from float array"
๐
calculating who's farthest is who's closest to the highest checkpoint
You can use a spline on the track to make sure people dont cheat if you want
only allowing progress while being this close to the spline
I'll try it with the spline... This is the hardest one yet
using a spline is probably easiest
there's nodes for getting distance along spline
so you can use that directly , or that in addition to checkpoints
I've tried with spline but there doesn't seem to be an easy way to get distance from a random position along the spline
you can only get the actual distance in float value from actual spline points so you would have to add and delete them...
checkpoints would probably end up being easiest to implement, you can always choose to have fake checkpoints
which don't have any visuals / logic besides having a location and index to track race positions
You can? wth
Am I just blind???
I thought so too... but testing it I couldn't find the correct node ๐ค
aaah with the input key
you must also manually set the distance on the spline
if im not mistaken... or maybe that was with my old method
Seem to be the old method yes. Cant see that im setting it anywhere atleast
Duration was the one i had to manually set
Its not very expensive either it seem. So for a few actors to call this on something close to tick should be fine i think
Since you guys are so familiar with rotations, any tricks to get Y-axis play nicely? It has this weird -90 to 90 limitation so it returns the same values twice on a circle
i don't know if this is the gimbal lock or such limitation of the euler angles
@humble vineGimbal lock. Do a float calculation before hand. If > 90 or <-90 then invert roll(andor)Yaw, set pitch to what you found before that passed 90 or -90 and use that value minus 90 or minus -90.
It's complicated, and annoying to do in blueprints. Welcome to Rotators. ๐
I can sort of live with -90 and 90 but it is bit confusing to see it flip, and it messes up my HUD graphic alignment indicators if I want to drive them based on that angle
That sounds pretty same to what I did with the other rotator before the guys here helped me simplify it to modula
You have to take roll into consideration for those if you're going to do that.
i had If branches for values over 180 and under 180 that roll in some cases returned when calculating together two separate roll differences, that guys here helped me to simplify to few nodes with modula
so if there's a way to handle this Y-axis with modula also, i tried some, but couldn't really figure it out
Roll checks shouldn't be necessary. You should just need to invert it depending if pitch goes over or under the 90 limits.
I'm doing space flying
I assumed as much.
so i need all the axis, in relation to other actor whom you dock with
the logic on the game works, just can't get the hud to display correct numbers
now i'm just lacking this Y-axis, which isn't that big deal if it doesn't work but sometimes you just want to have something completed
Oh, You're trying to rotate like a docked ship with a larger ship/station?
yes. you need to match all velocities, and angular velocities, and you can only dock in exactly same angle
logic works in game already but the HUD that's suppose to guide the player is bit haywire
What is wrong with it? It should all be done with local space vectors comapared to the ship most likely.
since ideally if you just match all the offsets to 0 you'd be able to dock, but when Y-axis returns 0 also on opposite angle maybe someone gets stuck wondering where the station is
everything is moving so it's happening in world space
But why? For UI relating to the ship, it should relate to the ship. It'll simplify the logic process considerably.
the UI calculates differences to the station
so it doesn't just show you what your ship does, but difference
since who cares if something is flying 18000 and you are flying 18100, only that 100 is important
The UI should probably just get a pointer to the ship and whatever the ship is trying to dock at. After you get the world space location of what it's trying to dock at, you can transform that into the local space of the ship. After that your math is significantly simplified.
So now everything works in relation to each other except the Y-axis
even the autopilot flies itself in correctly
that y-axis number is only important to the player for manual docking
everything else works with forward vectors, and look at rotations, the hud just tries to compare rotation values from two actors. and i tried transforming rotations both directions but it just never got it correctly, because internally the Y-axis seems to be limited to that -90 to 90. I guess I can always do with those > or < checks, I just thought maybe for this one also there is simpler solution
Hi, Iโve two flying pawn and Iโd like to spawn the second one next to the first one within the function setWorldLocation. Therefore I casted the first one in order to get data relative to its own pose, but nothing happen
how are you spawning the first one?
also dont cast, it being an actor is enough to get its location, no reason to load a bunch of useless things into the second pawn if all you need is a location
You need to construct in the hud itself
you could create an interface with a simple "EDrawText" function and attach it to your hud, then onactorbeginoverlap just activate it
and keep your logic for the actual event inside your hud
The first one is spawn at the beginning of the simulation. I just need the main pawn coordinates so in another BP I can pass them as argument for the SetWorldLocation
what is it spawned by?
We need a sticky, going over how casting is not "get" nor is it calling a function or an event nor is it anything other than a typecast.
there is one
issue is not watching it
The main drone is spawned due to a configuration file since Iโm working with the AirSim plug-in. Each drone has it own BP_flying_pawn. I just need to access to the main drone coordinate so i can teleport another drone via its BP
The problem is that I donโt know how to access to the main drone data
well whatever is handling your spawning is what should be able to get that data to your drones, since its holding a reference to them im guessing
Is there an another way to access the main drone location from another flying pawn BP? Sorry but Iโm new to UE
Well I could give you some terrible but probably working advice if you would like
you could give the main drone a tag
like "maindrone"
and then have the second one do get all actors of tag
and then get at index 0
and then getworldtransformation
Iโll try, thank you. I really appreciate it
Hello ! Is it possible to make an Event red box for an event that comes from a Variable ?
For exemple in the WeaponComponent class there are BlueprintImplementableEvents like OnStartAiming, I would like to do something when that event fires in the BP of my weapon.
How would I do that ?
I have a reference to the WeaponOwner and his WeaponComponent in my weapon BP
@woven moon you can either use an event dispatcher (dynamic multicast delegate in C++), or make the function accept a dynamic delegate as its parameter which would work like a callback
You create an event dispatcher in your object/component. You then do a "bind event" which allows you to create an event in the other blueprint, or you can directly create the event in your other blueprint if it is a component within it.
Ok thanks ๐
Then just make sure to call the event dispatcher whenever you need it to fire anything off to those that have bound to it.
@trim matrix "as HUD"
Hello, I am using the twin stick default project I can't seem to find how to stop the camera from following the ship I need help
On what class does the event/function "break house popu" exist? Did you make a custom HUD class called "HUD"?
If that's the case you should give it a more distinct name and things might make more sense
let's say I have a class for a magazine (which will hold ammunition as an integer), and a class where I have the reload nodes for a gun, where it simply sets ammo to a certain integer after reloading. How do I get the integer from the magazine into the reload node on the other BP?
Yeah I think there's already a built in class called HUD so now it's hard to tell that class and your custom class apart. Rename it
Cast node needs Object
Hi everyone! I decided to use the InterpTo Movement Component since it seems like I hate myself and couldn't have used a simple timeline to move to a location smoothly, I thought I figured how it would work but it seems like not since my code is making my actor snap after 1 second instead of going smoothly
note that I have both the actor and the component's ticks enabled
Idk lol. Here's the thing about casts. It takes an object and checks if that object is of a class, and then gives you a class specific reference if it succeeds, or if the object fails the check, then the "Cast failed" pin is executed.
Your overlap event produces an "other actor" reference. I haven't played with HUDs much but I don't think they're actor classes...? In which case the cast will always fail. @trim matrix
well I'll take this silence as "don't use that garbage"
I'm deleting the interpto movement component
I don't know much about HUDs. If I were in your position I'd look up an example of HUD BP communication. Like is the HUD managed by the pawn or player controller? Or is there a Get HUD node? Etc
Normally you use a "Create Widget" node to actually create an instance of a widget. The return value from that widget is the thing that now exists which you can reference, and store as a value to use later. You need that return value to reference the thing that you created. If you store that in the level blueprint, you'll probably not be able to use it very well as nothing (at least as far as I'm aware) can reference the level blueprint directly, so you have no means of referencing it elsewhere, which means all the logic for it would need to be contained within the widget.
You also cannot draw things outside of HUD's draw event usually.
Welcome to the world of widgets. It's a deep dark, and scary hole. And that's just the UMG side. ๐
What's the correct way to spawn in a second local player? Create player, spawn actor, then possess actor?
Lets not wander into slate forest ๐
You shouldn't need to do anything other than CreatePlayer. If your game mode is set up correctly it'll spawn and possess the correct pawn for your second player.
Too late. I'm about a full week's journey in.
Is it as dark as it looks from the outside?
Nah. It's honestly more like lighting a bonfire to light up dark scary things that turn into kittens.
How does it know where to spawn the second player?
Almost sounds tempting, if my plate of things to study/learn wasnt si full already
Handle it in the GameMode overrides. Where do you want it to spawn the next player?
Right now its spawning p1 at a transform location in the level bp and spawning p2 in a different transform
But im creating player and spawning actor based on a sub class
Selected in a previous level
any idea what's going on please it just occurred one time when i started the project and i have no idea how to fix it
You prob should derive a new class from the base :)
hmm
@trim matrix The SpawnDefaultPawnFor functions should be able to handle what you're after. There's two. They're called when a player is retarted, a player is "restarted" also when they're first spawned.
This is what I am currently doing:
Since the default pawn is bp_character_base, but the actual class that needs to spawn is a previously selected sub-class from a previous level. (Player 1 class variable and Player 2 class variable)
I hope this is not in gamemode
No, it's in the level blueprint right now
But seems like a lot of unneeded stuff. Without it though, player 1 spawns in as the default class (bp_character_base) with no mesh, in the wrong location, and player 2 doesn't spawn at all
Local multi?
Spawning of players is still probably best done in the gamemode
Eventually it'll either spawn player 2 as a player, or as an AI
I do it in the level because each player has a different spawn location, and the location could be different for each level. I could probably move both players on level load though but not sure if that would be visible once the level loaded.
but either way, I am not so sure that what I have is the correct way to spawn the characters in, but without the code it does the above (doesnt spawn player 2, and spawns player one with no mesh and in the wrong location)
Gm -> get all actors of class (spawn points) use tag to identify each players spawn if very different
Otherwise use the same spawnpoint and just offset them to each direction
Yeah, that would work for spawn location. But should I be doing something different for actually spawning the actors? I tried leaving it at default, but that's when the above situation happened and there was no p2 player being spawned.
Theres events in the gm for handling new players (being given a new playercontroller aswell), i assume this works exactly the same for local player aswell , altho i've never tried
So I'm essentially destroying the main actor that's spawning (bp_character_base), and respawning the correct class, then possessing it as p1, and then for p2 I am creating a new player, spawning the correct class, then possessing that with player 2. It works, but seems wrong.
That part is not necessary with a custom gm and your override
You can decide which chars to initially spawn, and hand them to the correct playercontrollers aswell
That's what I am trying to figure out. What am I supposed to be overriding? Because I am using a custom game mode right now, but without that code in the level blueprint, it's only spawning player 1 with the incorrect class, and player 2 isn't spawning at all even though there is a player 2.
Not at pc right now,
But check the avaliable events
They should be close to self explanatory, but if not sure just post the list here if you dont mind
Oh, I see 'event on restart player'
There is also one for handle new player or something along those lines
yeah I see that one, too. I'm assuming that may be for if a player joins mid-game?
I'll have to take a look at it and see if I can find out how they are used.
Thanks
Anyone ever work with parallax? Got a quick question.
You need to connect your cast to to something for one
As far as I can tell with that is that nothing is casting.
the object needs to be connected to something.
Like that.
I don't think you should be casting on tick either. Casting is pretty heavy.
I try to avoid event ticks as much as I can.
Use an AI controller and a behavior tree.
You need to make that reference somewhere then so you can access it.
On BeginPlayer -> 'GetPlayerCharacter', save to variable. Use that variable to reference later.
Casting on tick all the time is like asking for suffering
If you have a reference to the player, no. You should be able to use playerRef->getActorLocation no ?
Would be even naughtier if it's ||Get All Actors of Class on tick|| 
You could maybe put a collision box onto the actor you want to move to the player.
hmm so unless I am using it wrong, I still need to possess the actor that is spawned in via handle new player. This is definitely a lot cleaner, though.
Forgot a node...
Now that's what I call BP shitposting 
How many ms does it ate lol
Yea didn't drop anything at all, but I don't have much on the map, so....
^ thats what i was gambling on๐
Think you mean to connect the return value up to the Set Owner node too (unless you want the player to own your game mode)
Looked around for ways of making "modular clothing" or w/e you would wanna call it. From what I got you create the clothing piece with the same skeleton as your character and then you create a skeletal mesh from it and add that skeletal mesh component to your character, am I missing something?
@dawn gazelle Good catch on that. Although both players are local so I am not sure it would matter in this case.
You might want to create another #animation BP for the sub skelmeshes containing just "Copy Pose From Mesh" in the anim graph. This one's a bit expensive, but any form of anim dynamics would still works.
You can also use Set Master Pose Component function, but it effectively disables any physics simulations.
That code is so much cleaner and seems to work the same way. Now to just determine which player (1 or 2) is being spawned in so I can determine which spawn spot to use. I suppose player 1 will always have controller id 0 ?
Okay, I'm not using any physics at all so that doesn't matter. Why would I not be able to have them use the same AnimBP? Also is this approach very expensive overall?
No, because just using the same animBP could potentially desync the children skelmeshes.
Also it might be even more expensive than animBP with just Copy Pose From Mesh
Hi Blueprinters - I'm writing a c++ interface and I want to declare that "implementors of this interface will fire this event that you can listen to". Do I need a delegate for this?
Nvm i read the doc I linked and ur golden. !
I'll check it out when I am back at my desk
Oh, cool.
Am I right in assuming player 1 always has controller id 0?
I would think so
That's always the case, yeah.
Not sure how it works with two playercontrollers on one pc tho?
Maybe its easier to actually just have one and map inputs to two different pawns?
I think the player controllers would still split in local MP.
How do you differentiate the input events
Which one uses keyboard vs controller and whatnot
Wasn't sure if there was ever a case where player 1 got reassigned a new id. They do, yeah. When I use create player for player 2 it gives it id 1. Im not sure as I tested with two controllers but it seems input is per controller
Wasnt there also an issue with splitscreenwidgets?
In most cases, games don't differentiate KB and gamepad, but I heard you can get somewhere with Raw Input plugin and a bit of C++, getting the vendor ID and whatnot
If one uses keyboard and one uses controller it may cause issues since I think controller one is mapped to keyboard
But from my tests, 2 gamepads work correctly
Sweet. I've never tried , just imagined that could be trouble
There may be issues not identified yet, but when I tested if I punched on gamepad 1 player 1 punched only and gamepad 2 player 2 punched only.
Stuff like emulators managed to split KB and first gamepad by differentiating the device input "metadata", but that's something to do in C++ and not a mere BP.
Yeah i cant imagine getting away with pure bp project here
Yeah my game is designed to be played with controller so I'm not too worried about it
I'd be very surprised if so
Thanks for the suggestions guys. I'm glad im actually making meaningful progress on this project.
For some reason whenever i hear local multiplayer my mind goes directly to jazz jackrabbit
Jazz Jackrabbit 3 when
I'm only working on a fan made project so im not expecting aaa quality but it's nice to at least get in the habit of doing things efficiently
@hexed bone like where p1 and p2 aren't on the screen at the same time? Like mario and donkey kong?
Err wrong tag. I meant @gentle urchin
Yes exactly
Split 4 screen even.
I totally forgot that
Easier times when you could just hard map inputs
And not care about flexibility ๐
Hello, Is there a way I can utilize SpringArm to work on an attached Actor? my use case is picking up an item and attaching it to the player's actor, and I want that item to not go through walls, so I want to have some king of a spring action. SpringArm seems to only work on child components not attached actors.
Probably works if you attatch to the socket on the spring arm?
oh, let me try that now, thanks for the suggestion
Im not seeing how it would care about what is attatched to it really
Then again i didnt study the springarm class ...
I'd use a PhysicsHandle for that instead. The springarm is only intended for the camera and I'd use it only for that.
having trouble with a lock on system I'm working on. As you can see from the video, once I'm locked on if I move left/right I drift away from the enemy until I'm finally out of range.
Any help to get my character strafing correctly?
I'm calling a Look At event on tick while locked on.
I'll look into that as well, thanks!
there's no notion of unintended behavior here. What's happening that you don't want to happen specifically?
drifting away from target while only holding down left or right movement.
I'd like it to strafe in a perfect circle
@lyric relic this should get you started
doesn't seem to work :/ the "Test" is a reference to another actor, I get the print message correctly, but object is not stuck to the player
oh, checking your BP now
@lyric relic the feature you're trying to make is non-trivial. It took me about 2-4 hours just to get it working correctly.
these two vids gave me a rough idea to work with for my project. I had some specific requirements that you might not need so you might be off well with the videos alone
yea ๐ฆ since I switched from Unity to UE a few weeks ago.. and everything became really hard.. I wonder if it's a learning curve and I'll get used to it, or have to spend hours to do every thing that could be done with a few clicks in Unity :/
it totally is, it took me months to get over that curve
ok, how about this one (the most annoying thing I've seen so far), in Unreal can you refer to another component of another actor trivially? right now I'm doing a very ugly solution which is a new struct called ActorTagRef that has an actor and a tag, and have to resolve it manually every time to get a ref to that component. am I doing this wrong? or it's how it's supposed to be done ๐
In my experience, you don't really need to interact with an actor's components directly. Just talk to the actor and let the actor manage its own state.
There are methods to setup bp communication channels^^
Question would be what the usecase is, and if theres a better solution to achieve the same thing
yup, but I don't wanna create an actor subclass for every actor in my game, I wanna use regular actors with decorating components on them and be able to refer to those components from other actors
Why? Is it because you're trying to force the Unity workflow into UE?
I've got a third person and first person camera setup. When aiming the alignment is all off.
How do I make sure that when a player ADSses that they aim at the same exact spot that was in the middle of the screen before aiming down sights?
Makes sense. Toss me an example
not really, but to create a new class for every item or thing in my game, that's too much work, and the reason why there are actor components should be to decorate actors
why would i define a new actor type every single time, if I can decorate the base actor component to add new functionality
Depending on your definition of 'item' but in ue its usually handled by some inheritance setup
Actor > Item > BP_Sword, BP_Axe, BP_Bow, etc... - then just change the mesh. If you want to be more fancy, use Data assets.
(obviously a simplified example)
You can easily make components that handles their own states or setups, or communicate out to the owning actor
Ctrl W on the asset in the content browser to duplicate, then change the mesh.
Data assets, data tables .. many ways to rome
Yea I think I'll just need to get used to it, I wish I started Unreal years ago instead of Unity ๐ I honestly like it more, but my mind is still living in the Unity world
What's the use case? There's prolly an easy approach
You do realize that the direction from camera to AimPoint and the direction from character eyes to AimPoint are not the same direction, right?
simple use case, having multiple light switches that can do toggle different light components
Understandably. Luckily i did what you wish you did ๐ went straight for ue4 !
That's the essence of the problem of 3rd person aiming.
should I create a new light switch actor subclass for every one? why can't the switch component take a reference to a light component that it toggles
instead of a reference to the actor and having to do find component by class or tag
Create a switch actor, then just link the light to the switch through an exported variable.
Switch can ref a light component no problem.
Make a light component ref on it and set it.
when I create a light compoent variable on my Switch BP, in the editor I can't link it to any light component from the scene
Depends on how you want to link everything up tho.
the reference list is empty
As said, theres like a hundred ways to do anything
yeah and that's the exact topic of my question.
Some are good, some are less good
Other games handle this problem well too. E.g. PUBG etc.
Last resort is th infamous get all actors of class ๐
but I can't think of a good method to do so
I'm guessing ControlRotation is driving the 3pp camera? You need to trace down that camera to a point, then calculate look at rot from character head to that point, and that's your ADS rotation.
You can still approach this in an oop fashion. You could make a trigger that handles interact inputs for anything using bp interfaces. So you reuse this trigger to do things like toggle lights, doors, etc
Third person perspective aiming gets really tricky the further your two aimed directions diverge. You have a very large angular distance between your camera view Direction and your character Aim direction, so it's going to be very hard to make the stuff line up exactly.
Because the angle that the character is aiming will depend very much on the depth of the hit
I was hoping I could get away by just taking the locational and rotational offset between the cameras into account
is that just a flawed strategy?
When you go to aim down sights, you need to know the 3D point that the other camera was aiming at. Just the rotation won't be good enough
makes sense
Can you give an example of how to make a lightswitch component that has a function call "Toggle" that can toggle a specific light component? so in the level I can add multiple lights and multiple switches and just configure each switch with the corresponding light component it works on?
It'll all depend on the depth. The angles will be vastly different if you're aiming at something really close, but if you're aiming at something infinitely far away, they won't differ at all
without doing get components by tag/class
Honestly I would use tags. Tags are fast and efficient. And much safer than hard references
thanks @faint pasture . I'll explore that strat right away <3
Then you could do a many to one and many to many relationship as well
Right. It would just be the trigger, the actor in question and a bpi
Or actors
hold pls
ah, so you mean I can create a light bulb actor that implements an interface
yep
any actors you want
one sec
Have BP_Switch. Have a variable that references a light, make it instance editable. This allows you to select a light in the world with an eye drop like tool. Then, have an interface on the switch called like IInteractable. Have a function, Interact. Just turn the light on/off inside of that method when you implement it in BP_Switch. There, one blueprint, can work for any light in the world. Hard references aren't the end of the world.
that's my problem :/ I don't wanna end up with hundreds of actor classes in my game, since there's a component already that lives in the game and has the functionality and it is decorating an actor, why do I need to create a new class just to interface the logic to that actor component
UE is not Unity. Everything doesn't have to be a component.
but there's already a component in the game ๐ called light component, that was made to decorate any actor
what's the point in having to create a specific actor just to use the light component
There is also a point light actor. Maybe that's all you need.
It's still sitting on an actor. Just use an actor reference and at run time get it's light component
Components do not exist on their own. They are always inside of an actor
yea getting by tag is the solution i'm currently using, but I just wish there was a direct pointer to another component, not another "Actor" that all its purpose is to wrap around a component and bypass the call to it
That's not the only purpose of an actor
but it's the only solution to get an actor component ref
@faint pasture this isn't changing anything as of now. What am I missing?
should I rotate the capsule component instead? seems weird to me
alright, ready?
"Have BP_Switch. Have a variable that references a light, make it instance editable. This allows you to select a light in the world with an eye drop like tool." that shows an empty list for me :/
You don't need to live and die by components in Unreal. This is not Unity.
This is the code for your trigger
This is the code for the thing triggered
you need to make a bp interface, with your functions - in this case triggered
In both classes, in the Class Settings, you add the BP Interface
so now they use BPI as a message system between them
In the trigger, "MyTarget" is whatever you want it to be
its an actor variable, and that you can hook up in your level
if you want more than one, make MyTarget an array
thanks a lot for taking the time to create this example! my only problem is that I have to create a new actor subclass to use the light.
that does not matter for this setup, that sounds like for your needs
and I'm not taking about Unity now, it's more like an OOP thing
imagine you have a Car class and an Engine class that you can decorate the car with (once you add that engine to the car, it makes it logically a Car with Engine capabilities) now Unreal is forcing us to create a new CarWithEngine class just to refer to that engine from somewhere else
See how I now have this eye picker?
In the bottom right of the screen
You use that to select the light in the level
@midnight ravine how are you doing your aiming in third person anyway?
You should already have to be calculating the secondary rotations to be able to aim at the aimpoint, is your stuff working without doing that already?
@blissful grail oh that would be great! but mine is showing this, any idea what am I missing? I made it instance editable
It needs to be an object reference
arent you supposed to add the multiplied forwardvector to the other vector for a line trace?
in this example, sounds like you want to access the engine, which is what - a child actor attached to car? a mesh component?
a child actor component that contains some logic
Yes, I know what components are in OOP. But here's the dirty secret about production code. It ain't as pretty as scholars want it to be. Especially gamedev production code.
tbh in the car example above it makes sense OOP wise to use a subclass for the car
but there are other examples like the light bulb
You guys and your handmade levels. Don't go to deal with none of this s*** if everything's procedural LMAO
why would I need a new Lightbulb actor
just to act as a light component
@blissful grail completely agree
lol right you are, glad im proc gen
savage ๐
yup. I don't calculate a lot of stuff. All I do is shoot a trace from the camera into space and that's it. Wow, I phrased that in an unhelpful way...
And oop is pretty s*** anyway. Nice way to spaghettify your code base
So how does your character know what direction to aim to hit that same point that the camera is looking at?
I did that here didn't I?
mine is object ref :/ still not showing the picker, I'm using UE5 btw might be different there?
That's getting the aim point, how does your character know what orientation to aim at the aimpoint? It's going to be different from the camera orientation because the camera is offset
in Unity I can refer to any component in the entire game from anywhere, I don't need to define a new class in the game
@faint pasture
I have no clue why this portion works:
I plugged it in once by accident but somehow it gave me the desired result.
so to be 100% honest with you @faint pasture I don't know exactly how my aiming in 3PP works
Okay that rotation you calculate with the get look at rotation, that's what you want to use for your scope camera view rotation
In my case I just sent that to a variable, aim rotation.
yeah I tried to apply the same logic to my CalculateADSAimingDirection function
@willow phoenix his line trace is fine, he's just not using that rotation for his scoped camera. That's the problem
@lyric relic
im sure there is some revisement, but its not that much more
EDIT: Called by the parent of your subclass
So it goes Trigger > Parent > Subclass
Just save it to a variable. On tick, you should be setting that variable. When you fire, you just fire in that direction from the bullet spawn location
oh
wait
it's not the firing that's the issue
it's literally just that first moment when you switch from 3pp to 1pp and your aim is offset
the firing logic works fine
You can do the same in UE. You'd just get all actors in the world and then loop over them, checking the component type, and then only adding to a list if it is of a certain type of component. Not a lot of good reasons to ever need this kind of functionality, but it is there.
I'll try that. I was thinking I'd just have to do it one single tick. I don't wanna lock the player into that direction when they ADS.
@lyric relic ahem, in case you missed it #blueprint message
I don't think that is the issue. I still believe the issue is thinking in a Unity way/workflow, but trying to apply it to Unreal.
Is this a place I can post my blueprint and seek answers why it doesn't work. I am new to this server.
Yes.
I've been using UE for a month now, I hope I pass the learning curve soon!
used Unity for 8 years before that ๐
thus the struggle.. ๐
I've been using it for 7 years and I still learn new stuff all the time, like that you can't set a component reference in the editor evidently. At least not without C++
I've been using UE off and on since like 4.12, so I'm shaky in plenty of areas. My primary engine is Godot ๐ (but I have work to do in UE now, so, I'm quite happy)
btw. why the heck does unreals BP merging tool not resolve static meshs to mesh components but rather creates child actors for each?
is there a workaround? i'm aware that the actor could have custom settings, but still its annoying me
I have been trying to make a power jump of sorts while crouching. I tried this, but when i click space to jump while I am crouching it only un crouches
@faint pasture let me think this through one more time.
Problem: when ADSing the camera switches. Given that the cameras are at an angle to each other the resulting aimpoint is offset.
Solution: when ADSing, draw a linetrace from the first camera to whatever point in space it reaches and have the ADS camera rotate towards that point in space.
Correct so far?
how is that related to source control?
i'm talking about the editor feature to select actors in the level and merge them to a BP
@trim matrix I've been using BP since I started UE.. looking at unreal c++ code makes me wanna delete the engine till now xD
but I'm def. gonna try to switch parts of my BP to C++ later
I used c++ at work.. but the UE C++ is very dark and full of terrors
Let me guess, you're driving both camera rotations by control rotation?
@faint pasture yup
C++ ain't all that bad honestly. UE makes it pretty easy. There are some gotcha's of course, but it is very digestible.
just looking at the C++ macros ๐ฎ omg so scary lol
You'll want to update the control rotation to be the character viewpoint aim rotation right before doing the switch
oh, do I need to deactivate the flag, set the rotation manually and then activate it again?
oh
that's much more simple
any recommendations for an IDE that works well with UE? for me VS doesn't recognize the headers automatically
Or don't drive that camera by control rotation. That's the problem you have. The camera is moving but it is not changing angle to the new viewpoint, since the only thing that changes your control rotation right now is your mouse input
Not like you need to know them super well. You'll see that you use the same like 4 most of the time.
Rider
I heard about it, but someone was saying it's not good for debugging, is that true?
You're two options are Rider and visual studio pretty much. I prefer rider, but I'm not like a super league coder, I just hack s*** together in C++ to make it work
rider is for kid tho
I still find Rider to be much faster than VS + Resharper. Even VS2022.
Yeh notepad all the way
Whatever gets the job done. Its fast as hell and I haven't had any problems with it. Flip bits by hand with a scanning electron microscope if you want to be leet, but use the tool that gets the job done if you want to get s*** done
I stopped driving the FPP camera by that now. So all I need to change the rotation of is the pawn? I tried out the Set Control Rotation but this doesn't change anything.
also uhm... this is happening
I'm guessing I shouldn't do it via this node:
I don't quite understand the rotation of what I should change using what kind of node
The pawn should already be oriented by that aim rotation you calculate from the AIM point.
Remember you are juggling two rotations here. One rotation is of the third person camera, the other is of the pawn. They are not the same thing.
Idk what you're referring to with the aim point
Choose whichever one you want drive with control rotation but you can't drive them both.
do you mean the trace location of my first trace that I shoot from the TPP camera?
The AimPoint is the 3D point in the world where the camera line Trace hits.
currently I'm only driving the 3PP camera with control rotation.
so all I gotta do now is update the rotation of my Pawn to the aimpoint?
You going to update the rotation of whatever the scope camera is attached to, or even just the scope camera itself if you want.
that would be the mesh
which as we just talked about should be oriented correctly anyway
In our project we do it inversely, control rotation controls the character, while the camera just rotates to look at the AIM point. But it's up to however you want to do it.
Why would it be oriented correctly already, are you updating its rotation from the look at rotation towards AimPoint every frame?
if I do that then all I get is mumbo jumbo
I would start back at tick. On tick, Trace out of the camera and set a rotation called aim rotation which is the result of the lookout rotation from the character to the trace hit point. If the trace doesn't hit, then use the trace end point.
Then draw a debug line from the gun muzzle or whatever in that direction. Play around with it, make sure it is always aiming directly at the point that the camera is aiming
I'm sure you understand, but this is the problem you're dealing with here.
yeah
I'm just not entirely sure on how to actually make the FPP camera rotate the correct way. Even though I know where it should look at
You need to set that rotation whether it hits or not,. Select the hit if it hits, otherwise use the end point
my inintal thought was that if I were to reset the rotation on tick all the time then the player is locked in that rotation forever
You just need to give the first person camera the rotation that your calculating here. Not the control rotation. Because they will be different
and my thought was that I could just pass the correct rotation once and have the player control it no problemo after
You should be able to do that by setting control rotation
Okay then set the 1pP camera rotation to be aim rotation
this doesn't really change anything
hold on
so my trace is correct
I verified that much at least
Although that's going to get weird with trying to aim while scoped.
I would use control rotation for both cameras, but make sure you set the control rotation right before you switch cameras
when I ADS however, the camera does not rotate towards the trace
so
3PP: control rotation = on
1PP: control rotation = on
and set the control rotation on the Pawn before switching cameras one tick?
On ADS -> ControlRotation = AimRotation -> Change cameras
And always Trace out of your current camera
welp now im totally confused ^~^
And in fact you'll want to do the the inverse for getting back out of ads so the third person camera is aiming where the first person camera was
but I don't have to do any of this on tick, correct?
that idea just seems weird to me
maybe I don't the reason for why you'd need to adjust the rotation every frame
right, gotta think about that too.
one question
what does control rotation have to do with any of this?
I haven't really understood the concept of it.
urgh, anyway, I think I just gotta go pay someone to code this for me since I just really can't wrap my head around the weird rotations I need to do. I get the trace part but the what to rotate via which method... I'm just utterly lost on that part.
thanks for your help though! I appreciate it a lot.
Scenario for my question: I have a resource generator/building in a clicker type game that is generating a specific resource every second and this building has a price on it, that after each purchase is marked up by (Price*1,07). I have 3 buttons that help the player buy easier in later stages buy 1, buy 10, and buy 50. When I toggle buy 10 on, it should consider the markup and the proper price for 10 of those buildings. I cannot do just (price*1,07*10) because the base price changed each of those 10 times. Can anyone point me in the right direction here? I'm trying not to write a massive list of pricex1,07 back to back for 50 of them!
Control Rotation is just a special rotation variable that already exists and is typically meant to represent the view rotation of the camera / PlayerController. Lots of stuff can automatically hook into it like character and spring arm and cameras
oh
Add controller yaw and add controller pitch modify Control Rotation
consider it facing direction
so the control rotation is basically just the rotation you get by projecting a trace from the camera directly forward? kind of
Sounds like basic accumualtive interest math
You got it backwards. Control Rotation is typically the rotation the camera uses.
Chain of causality
Input -> change control rotation -> camera etc uses it
Sent a pm so we dont mess up Adriel/Zenahr_
so this would mean "Control Rotation is just a special rotation variable that already exists and is typically meant to represent the view rotation of the camera / PlayerController." would be (more precisely) "Control Rotation is just a special rotation variable that already exists and is typically meant to represent the view rotation of the PlayerController. The active camera usually follows the control rotation."
oh
that's why you wanted me to change the control rotation because that would automatically change the camera rotation
makes sense
Price = baseprice x 1.07^PurchaseCount
If you intend for it to be compounding
one thing I don't get with that. Why would you want to change the control rotation on tick? Wouldn't it be enough to just do it once?
kind of like a "reset" of sorts.
You do it once the frame you swap cameras
You do it every frame as you're constantly moving the camera around right?
i was wondering if anyone els came across this problem before and know what's going on? I'm trying to drag and drop a texture in to a texture slot and its not working for some reason
sorry to interrupt lol
I don't get that thought. I mean all I'm worried about is the initial offset between the two cameras. If I manage to mitigate that by resetting the control rotation on one single tick I wouldn't have to be worried about doing this over and over again, right?
again, the "reset" idea I was talking about earlier
or do I have something backwards
Right just do it once. If the transition is gradual between cameras it gets trickier.
On reset you just do the look at rotation from the location of the 3pp camera
I don't do any blends via the camera manager or anything like that
all I do is set one camera active and the other as inactive
So when the view moves it's aiming at the same spot in 3d space.
yeah the whole "and do this on tick" threw me off hard haha
I would handle the cameras and AimRotation seperatly
Just on camera swap, calc new control rotation, set it, swap cams
That will be AimRotation for the 3pp->1pp swap but not for the inverse so just calc it imo.
yeah
@faint pasture
the trace is correct and everything
but nothing really changes
Hmm quick question @dawn gazelle . Should a second player automatically be created if UE detects another input/gamepad, or do you still need to specifically create the character?
oh
....
hmm
weird
SEIZURE WARNING btw
@faint pasture do you know what's happening here?
all I do is ADS. I don't move the mouse an inch.
I know that when I get out of ADS the offset is additive because I don't do the inverse linetrace yet
but apart from that
That is wrong sorry......
the camera isn't aligned to the linetrace
although the trace seems to be correct
@midnight ravine your trace prolly ain't hitting the guy
@faint pasture
that's not the issue I think
the horizontal alignment is correct now
@midnight ravine show how you're driving the 1pp camera rotation
You're just using control rotation right?
Ooh yeah it's probably a logarithm expression unless you want a loop
yeah I think I do
Check that box
Learn about the compound interest formula and how to use it to calculate the interest on your savings, investment or loan.
can you tell me why this affected all of that? @faint pasture
requires some division
Before your camera was driven by whatever, idk. Now it's driven by control Rotation.
lmao
fair enough
@faint pasture you're right about my pawn not being registered by the linetrace. Does this have anything to do with collisionboxes? I thought the capsule always blocks traces
anyway, THANKS a lot. I can't believe I just spent +3 hours on this WITH help. I'd probably wasted a couple days and given up on the project altogether otherwise
It'll get tricky, as barely missing an enemy will cause a drastically different 1pp rotation than hitting them. You'll want to fine tune the max distance of your line trace so barely missing an enemy doesn't cause your shot to miss wildly. It'll be better if you move your 3pp camera closer to being in line with the 1pp one.
oh well at the moment no matter how accurate you target the pawns, the traces just don't reg
but yeah, that might become a problem, but the level design and etc. are set up in such a way that player won't ever try to get close to oneanother and the engagements are long range only. Good point for sure though
@amber cairn would buying 10 cost 13.816x as much?
That's trace channel vs pawn capsule, edit the pawn collision to block that trace channel.
beautiful!
It'd help to draw a debug point at AimPoint on tick until you're all set.
I think for your observation above I could for now just have a dummy collisionbox that's a tad bit bigger than the pawn mesh just for the camera switch calculations to work
oh I'm doing that already this whole time
Do a sphere trace instead
But beware that that might cause problems if people are trying to barely peek over ridges or whatever. It's an unsolved problem, there's no such thing as a perfect third person aiming system
is the performance tradeoff not a problem? I'm guessing not since you're suggesting it.
oh yeah, my game features shooting around corners so the "problems" become, ehem, "features"
In my game I run thousands of line traces per tick, a couple of them for your aiming system is nothing
I'll probably switch over to FPP-only if I ever think to release the game commercially
is your game released?
I kinda wanna see it haha
oh right... I totally forgot to mention it @faint pasture . The bullets in my game are projectiles. I literally only use the linetrace to tell the projectiles into which direction they should be fired, that's it.
Is it possible to get a hit normal in the local space of the object that was hit? Or easy to convert a worldspace hit normal to local?
I'm trying to make a key that only activates when a finger presses down on it (hit normal has +Z value w.r.t. key)
Inverse transform direction
@faint pasture Didn't know of that node! Thanks m8
Hello ! What is the proper way to do something after the level has been loaded ?
I'm trying this and it doesn't work
^^ use Begin event in the Level Blueprint ' Open Level Blueprint' in the ribbon bar in the editor..
This just binds it, AFAIK it doesn't call it
So just like call it on begin play
Actually I'm moving my Player to the position of an object when I come from Level A to Level B but it seems that when I do that my object in Level B is at 0 0 0 instead of the position it should be
Not sure why but it seems that when the BeginPlay is called in my level blueprint the object has not yet been placed properly
