#blueprint

402296 messages ยท Page 787 of 403

warm sky
#

Is there a difference in performance between 'event dispatchers' and 'bind to events'?

sonic crescent
#

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?

brazen merlin
sonic crescent
brazen merlin
sonic crescent
#

my Bp Child variables have been reseted after cleaning my BP variables into categories.

brazen merlin
#

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?

sonic crescent
#

yep defaulted

brazen merlin
#

oh dang, that def doesn't seem right

sonic crescent
#

checked things are uncheck, value set to 0, empty slot, etc..

brazen merlin
#

nah i getcha

sonic crescent
#

it it a total mess

brazen merlin
#

you dont have source control?

sonic crescent
#

sure my game is totally broke

brazen merlin
#

nah, like perforce

sonic crescent
#

i don't know what is that

brazen merlin
#

maybe there is a recently saved version of your parent/child classes in the autosaves folder

#

you know, before the categories

sonic crescent
#

how to bring it back?

brazen merlin
#

go find them in autosaves and replaced them lol

sonic crescent
#

ah drag n drop

brazen merlin
#

autosaves are litterally just backed up copies at certain times

sonic crescent
#

i will try that

brazen merlin
#

gl

#

otherwise im not sure what to tell ya

sonic crescent
#

rip

#

or something like that

brazen merlin
#

pretty much

#

a bummer though, categories shouldnt though that so i dunno if its a bug or something else

sonic crescent
#

i discover that i'm not alone...

brazen merlin
#

ah so its an engine bug

sonic crescent
#

a very serious show ender bug

brazen merlin
#

just tried it, doesnt happen on my end, 4.26.1

sonic crescent
#

thx.
i'm paralyzed.

#

maybe better to sleep.

#

byebye

brazen merlin
#

gn

warm sky
brazen merlin
warm sky
#

Yeap

#

Via cast

brazen merlin
#

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.

warm sky
#

Would you know if there is a difference in performance and resource usage?

brazen merlin
brazen merlin
#

more in how often it is called maybe, but the technique is merely that

brazen merlin
#

indeed

warm sky
#

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

brazen merlin
#

๐Ÿคท

warm sky
#

So yea I'm going to go r this event dispatcher thing a go

brazen merlin
#

good luck, i hope it solves the error

untold dust
#

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

steep heart
#

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.

sonic crescent
# brazen merlin go find them in autosaves and replaced them lol

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?

brazen merlin
#

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

sonic crescent
#

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...

brazen merlin
#

from what you mentioned before all of this, it sounded like it was just a matter of setting your child bp with params again

sonic crescent
#

What's the point to bring back an old version if the childs can't point on it...*

brazen merlin
#

the error also sounds like you renamed the parent class name?

sonic crescent
#

They are saved with 'date' on it. i must keep that?

#

i tried to rename all asset like it has to be

brazen merlin
#

mine have "_Auto" suffixed to them, dunno about date

sonic crescent
#

do you remove "auto", when you bring them back?

brazen merlin
#

yeah

sonic crescent
#

i have done that

#

but the childs don't recognize it.

brazen merlin
#

you saved over the parent class?

sonic crescent
#

i will try to go back to the original blatted version

#

i saved nothing

brazen merlin
#

........alright

sonic crescent
#

just drag&drop, renamed, restart

brazen merlin
#

well, probably shouldnt do this while engine is running

barren relic
#

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

brazen merlin
late lynx
#

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

barren relic
#

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

brazen merlin
# barren relic

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?

barren relic
maiden wadi
#

Sounds like the Guns mesh has it's own arms then?

barren relic
#

yes, but they all do

#

only this child has this problem now and it didn't before

maiden wadi
#

If the Guns mesh has it's own arms. You need to remove the others arms mesh.

barren relic
#

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

light token
#

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?

brazen merlin
#

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

willow phoenix
#

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...

โ–ถ Play video
light token
#

Alright I'll look into using state machines

#

Thanks a lot!

willow phoenix
#

and weighted spawn tables could be an interesting thing to look up too if im guessing correctly what you want to do ๐Ÿ˜‰

light token
#

Will do! Thanks for the help!

humble vine
#

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

willow phoenix
# humble vine Rotation problem... I have two actors that are rotating, at different speeds, an...

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...

timber knoll
humble vine
timber knoll
#

just make all rotations use positive values

humble vine
#

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

willow phoenix
#

eezeh got a good point here, you can offset the values after shortly before you display them

timber knoll
#

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

willow phoenix
#

or just substract 180?

#

or am i misstaken

timber knoll
#

well yeah it's a simple version of remapping in this case ๐Ÿ˜›

willow phoenix
#

oh ok ๐Ÿ˜„

timber knoll
#

but it makes all the math so much easier

humble vine
#

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

silk temple
#

yeah if you just want the difference then adding 180 to each one then subtracting will give you the difference in หš

timber knoll
#

that's not guaranteed

silk temple
timber knoll
#

it might for unreal engine, but I know some engines have REAAAALY weird rotations

barren relic
#

Can't get my Heat meter to update when i switch to the weapon, it becomes unhidden but loses its function Caustic_Think

timber knoll
#

unity just keep adding rotations for example

gentle urchin
#

ABS(ABS(RotA)-ABS(RotB))?

timber knoll
#

so you can have -54642 degrees ๐Ÿคฃ

silk temple
#

yeah luckily a rotator in UE is -180 to + 180

#

always wraps

#

sometimes annoying, many times useful ๐Ÿ™‚

willow phoenix
barren relic
#

no

#

are you telling me to try it?

willow phoenix
#

no im trying to find my glass orb to see what you did there that would cause such bug ๐Ÿ˜„

barren relic
#

when you swap wea

timber knoll
barren relic
#

im just gonna show you the code

humble vine
#

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

gentle urchin
timber knoll
#

in case it's not clamped -180 to 180

barren relic
#

this is all I did,

gentle urchin
willow phoenix
#

its all the same and the two on the bottom are not cnnected

#

you are just setting the visibility here

barren relic
#

yeah

#

they should retain their functionality though ThinkThinkThink

willow phoenix
#

well its not connected but i just noticed you did a funny cris cros

#

is it not connected on purpose?

barren relic
#

no that was a mistake

willow phoenix
#

whats teh "functionality" of you heat gun?

#

do you switch it off or store the gun at any point?

barren relic
#

while the gun is firing the meter goes up until it overheats

#

yeah this code is for when i swap weapons

willow phoenix
#

and whats the function to reduce the overheat?

barren relic
#

it does it over time

willow phoenix
#

does this still get called when you swap the weapons?

barren relic
#

yeah the gun works, it's just not updating

willow phoenix
#

or is it stuck in overheated state forever

timber knoll
willow phoenix
#

wait, the widget that you display is not updating??

barren relic
#

yes

willow phoenix
#

aaah okay. can you show the widget then pls?

#

what do you use to draw information to display

humble vine
#

Thanks guys for the input. I'll try

barren relic
#

Hud Widget

willow phoenix
#

great, i mean the code ๐Ÿ˜‰

barren relic
#

hold

willow phoenix
#

how does the little bar know it should update

barren relic
#

it's connected to a variable

#

in the heating script

willow phoenix
#

due either you want help, then just show some screenshots

#

you know you can do stuff like this in an uncountable fashion of ways?

barren relic
#

it's working until i swap

willow phoenix
#

then show the swap script part

#

where do you reset the "is overheated" bool

#

where the fk did that screenshot go

barren relic
#

the meter is the only thing not working

#

after swap

timber knoll
#

you're not giving a lot to work with ๐Ÿ˜›

willow phoenix
#

thank you eezeh ^^;

timber knoll
#

why only half the nodes on that screenshot

barren relic
#

it's a lot of code

timber knoll
#

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 ๐Ÿ˜…

barren relic
#

it's bound to the CurrentHeat Variable

timber knoll
#

and not words, actual visual node structure

willow phoenix
timber knoll
#

so we can help you debug ๐Ÿ™‚

willow phoenix
#

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?

#

๐Ÿ˜„

barren relic
gentle urchin
#

uploading copied game to steam

willow phoenix
#

its only "on conscruct"

timber knoll
#

can you show the binding in that case?

barren relic
#

i tried to have a custom update event and that didnt work

willow phoenix
gentle urchin
willow phoenix
#

what did you hide ther

gentle urchin
#

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,

willow phoenix
gentle urchin
#

instead of making its own variable for it

barren relic
#

Right now the guns are all children of a main gun parent that attaches to the First Person Char

gentle urchin
#

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

barren relic
#

setting child yes but not spawning

#

unless that's just how it works

gentle urchin
#

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

barren relic
#

Which is strange because ammo updates

gentle urchin
#

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

barren relic
#

The guns are in a database that the char has as a ref

#

if that helps

gentle urchin
#

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

barren relic
#

let me experiment

forest forge
#

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?

barren relic
#

Fixed one gun, now the other

forest forge
#

i cant find out and im stuck like this

barren relic
#

oh thats not a variable you have to make

forest forge
#

oh

#

how can i link it tho?

#

from the getmovementcomponent

#

to the other one

barren relic
#

drag out from movementcomponent

#

and search isfalling

forest forge
#

ah got it

#

thanks!

barren relic
#

๐Ÿ‘Œ

humble vine
#

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?

gentle urchin
#

can be combined

#

whats the output range? 0-360 ?

#

as i see it you can just modulo it?

humble vine
#

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

timber knoll
#

modulo is the way to go for angles

humble vine
#

I have never even heard about modulo, i am just beginner

timber knoll
#

it's basically the remainder after division

gentle urchin
#

it doesnt enjoy negative numbers tho

timber knoll
#

examples:

5 % 10 = 5
15 % 10 = 5
10 % 10 = 0
gentle urchin
#

-9 % 10 = 1

timber knoll
#

oh

#

like that ๐Ÿคฃ

gentle urchin
#

I just tested in excel , i had no clue x)

timber knoll
#

well it depends on implementation

#

I think unreal just goes negative like you would expect

#

-9 % 10 = -9

#

but I could be wrong

humble vine
#

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

gentle urchin
#

modulo will effectively clamp your number

#

360 % 180 = 0

#

180 % 180 = 0

#

720 % 180 = 0

#

721 % 180 = 1

timber knoll
humble vine
#

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

timber knoll
#

ok so your angle is always going to be > -360 right?

humble vine
#

no it is between -180 or 180

gentle urchin
#

IF Rot.X> 0 THEN
(%180)
ELSE
(%-180)
Assuming it behaves like the excel version

timber knoll
#

yeah but I mean the input

humble vine
#

the input is also that range

timber knoll
#

๐Ÿค” 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

humble vine
#

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

gentle urchin
timber knoll
gentle urchin
#

yepp

#

if you add 180*

humble vine
#

select float, wow that looks like something could become useful

gentle urchin
humble vine
#

didn't know such things exist either

timber knoll
#

180 won't give you same angle ๐Ÿ˜›

gentle urchin
#

range -180 to 180 becomes 0 - 360, modulo handles clamping

timber knoll
#

-50 will become 130 degrees

humble vine
#

but i don't want 360

gentle urchin
#

-50 in a range from -180 to 180 is equal to 130 in a range from 0 to 360 *

timber knoll
#

yeye but you just do -180 at the end

humble vine
#

ok ok, i'll go experiment with these and see what i can get

#

thanks again guys

timber knoll
gentle urchin
#

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

timber knoll
#

won't this just do the trick?

spark steppe
gentle urchin
#

Engine running with inductive sensors

humble vine
#

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

timber knoll
#

modulo takes some time to get used to ๐Ÿ˜…

#

it's a really powerful node tho

humble vine
#

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

karmic shadow
#

Guys I need help with Displaying the Race Position of Racers

gentle urchin
#

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

digital lantern
#

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

gentle urchin
#

and you're sure the input string is correct?

digital lantern
#

Yes, in my variable HealthIncreaseTimerName, it is written IncreaseHealth

#

I don't understand why, it's extremely frustrating

gentle urchin
#

Guess I shouldnt ask why you need it as a variable

digital lantern
#

I find that with a variable the code is much cleaner?

gentle urchin
#

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 ๐Ÿ˜›

digital lantern
#

It works, but I want my variable xD

steep heart
#

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

gentle urchin
#

this works

#

so

gentle urchin
#

sounds like a typo then

digital lantern
gentle urchin
#

did literal string work?

digital lantern
#

Yes yes

gentle urchin
#

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

digital lantern
#

The print string returns nothing

gentle urchin
#

meaning its false

#

they're not equal

digital lantern
#

It sends me back false*

gentle urchin
#

exactly

digital lantern
#

I had not put in the string ^^

gentle urchin
#

xD geesh

digital lantern
#

Doesn't that make sense?

gentle urchin
#

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

karmic shadow
#

Explain it please

#

its not a straight track

digital lantern
#

it doesn't work anyway, kill me dude

gentle urchin
#

then im out of options ๐Ÿ˜›

#

ditch the variable.

#

solved

digital lantern
gentle urchin
#

no execution input, no text in the variable

gentle urchin
#

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

spark steppe
gentle urchin
#

is your event for switching the light status

spark steppe
#

and yea, for world space positioning an accelerometer + gyro aren't enough

gentle urchin
#

Mine is just relative rotation around a single axis using a incremental encoder. Not world position (sounds way more interesting than my setup really)

spark steppe
#

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

gentle urchin
spark steppe
#

probably not, more like "usable for gameplay" accurate ๐Ÿ˜„

gentle urchin
#

we have to stop it with a relay due to cpu inaccuracy ๐Ÿ˜›

timber knoll
gentle urchin
#

"Is Light On" isnt updated by anything

timber knoll
# timber knoll didn't we answer this question with multiple solutions yesterday?

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...

โ–ถ Play video
gentle urchin
#

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

timber knoll
#

๐Ÿค” what exactly are you creating

gentle urchin
#

like this -ish

timber knoll
#

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
#

^ definetly

#

but thats another story

karmic shadow
#

@gentle urchin A Little help man?

gentle urchin
#

The drawback of posting solutions i guess

#

You've been explained how to do it already :p

#

And given a link

karmic shadow
#

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

gentle urchin
#

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

karmic shadow
#

I'll try it with the spline... This is the hardest one yet

gentle urchin
#

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

timber knoll
#

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

gentle urchin
#

Wha?

#

im constantly getting distance on spline

timber knoll
#

You can? wth

#

Am I just blind???

#

I thought so too... but testing it I couldn't find the correct node ๐Ÿค”

gentle urchin
timber knoll
#

aaah with the input key

gentle urchin
#

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

gentle urchin
#

Doesnt the warning/error say ?

#

Not sure what that even means

humble vine
#

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

maiden wadi
#

@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. ๐Ÿ˜„

humble vine
#

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

humble vine
maiden wadi
#

You have to take roll into consideration for those if you're going to do that.

humble vine
#

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

maiden wadi
#

Roll checks shouldn't be necessary. You should just need to invert it depending if pitch goes over or under the 90 limits.

humble vine
#

I'm doing space flying

maiden wadi
#

I assumed as much.

humble vine
#

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

maiden wadi
#

Oh, You're trying to rotate like a docked ship with a larger ship/station?

humble vine
#

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

maiden wadi
#

What is wrong with it? It should all be done with local space vectors comapared to the ship most likely.

humble vine
#

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

maiden wadi
#

But why? For UI relating to the ship, it should relate to the ship. It'll simplify the logic process considerably.

humble vine
#

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

maiden wadi
#

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.

humble vine
#

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

wary shadow
#

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

smoky marsh
#

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

acoustic tundra
#

You need to construct in the hud itself

smoky marsh
#

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

wary shadow
faint pasture
#

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.

smoky marsh
#

issue is not watching it

wary shadow
# smoky marsh what is it spawned by?

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

smoky marsh
#

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

wary shadow
#

Is there an another way to access the main drone location from another flying pawn BP? Sorry but Iโ€™m new to UE

smoky marsh
#

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

wary shadow
#

Iโ€™ll try, thank you. I really appreciate it

woven moon
#

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

earnest tangle
#

@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

dawn gazelle
woven moon
#

Ok thanks ๐Ÿ™‚

dawn gazelle
#

Then just make sure to call the event dispatcher whenever you need it to fire anything off to those that have bound to it.

tight schooner
#

@trim matrix "as HUD"

wary sparrow
#

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

tight schooner
#

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

lilac haven
#

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?

tight schooner
#

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

unreal quail
#

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

tight schooner
#

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

unreal quail
#

well I'll take this silence as "don't use that garbage"

#

I'm deleting the interpto movement component

tight schooner
#

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

dawn gazelle
#

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.

maiden wadi
#

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. ๐Ÿ˜„

trim matrix
#

What's the correct way to spawn in a second local player? Create player, spawn actor, then possess actor?

gentle urchin
maiden wadi
#

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.

gentle urchin
#

Is it as dark as it looks from the outside?

maiden wadi
#

Nah. It's honestly more like lighting a bonfire to light up dark scary things that turn into kittens.

trim matrix
gentle urchin
#

Almost sounds tempting, if my plate of things to study/learn wasnt si full already

maiden wadi
#

Handle it in the GameMode overrides. Where do you want it to spawn the next player?

trim matrix
#

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

hazy flame
#

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

gentle urchin
hazy flame
#

hmm

maiden wadi
#

@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.

trim matrix
#

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)

gentle urchin
#

I hope this is not in gamemode

trim matrix
#

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

gentle urchin
#

Local multi?

trim matrix
#

Yeah

#

With no split-screen

gentle urchin
#

Spawning of players is still probably best done in the gamemode

trim matrix
#

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)

gentle urchin
#

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

trim matrix
#

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.

gentle urchin
#

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

trim matrix
#

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.

gentle urchin
#

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

trim matrix
#

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.

gentle urchin
#

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

trim matrix
#

Oh, I see 'event on restart player'

gentle urchin
#

There is also one for handle new player or something along those lines

trim matrix
#

yeah I see that one, too. I'm assuming that may be for if a player joins mid-game?

gentle urchin
#

Generally whenever a player joins

#

At the start , middle or end :p

trim matrix
#

I'll have to take a look at it and see if I can find out how they are used.

gentle urchin
trim matrix
#

Thanks

unkempt quartz
#

Anyone ever work with parallax? Got a quick question.

trim matrix
#

You need to connect your cast to to something for one

unkempt quartz
#

As far as I can tell with that is that nothing is casting.

#

the object needs to be connected to something.

#

Like that.

trim matrix
#

I don't think you should be casting on tick either. Casting is pretty heavy.

unkempt quartz
#

I try to avoid event ticks as much as I can.

trim matrix
#

Use an AI controller and a behavior tree.

#

You need to make that reference somewhere then so you can access it.

gentle urchin
#

'Get player character' exists

#

Globally accesssible

trim matrix
#

On BeginPlayer -> 'GetPlayerCharacter', save to variable. Use that variable to reference later.

icy dragon
#

Casting on tick all the time is like asking for suffering

trim matrix
#

If you have a reference to the player, no. You should be able to use playerRef->getActorLocation no ?

icy dragon
#

Would be even naughtier if it's ||Get All Actors of Class on tick|| kappa

unkempt quartz
#

You could maybe put a collision box onto the actor you want to move to the player.

trim matrix
#

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.

dawn gazelle
#

Forgot a node...

icy dragon
gentle urchin
#

Probably 0

#

engine flexes muscles

dawn gazelle
#

Yea didn't drop anything at all, but I don't have much on the map, so....

gentle urchin
#

^ thats what i was gambling on๐Ÿ˜…

dawn gazelle
meager spade
#

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?

trim matrix
#

@dawn gazelle Good catch on that. Although both players are local so I am not sure it would matter in this case.

icy dragon
trim matrix
#

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 ?

meager spade
icy dragon
#

Also it might be even more expensive than animBP with just Copy Pose From Mesh

white raptor
#

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?

gentle urchin
trim matrix
#

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?

gentle urchin
#

I would think so

icy dragon
gentle urchin
#

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?

icy dragon
gentle urchin
#

How do you differentiate the input events

#

Which one uses keyboard vs controller and whatnot

trim matrix
#

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

gentle urchin
#

Wasnt there also an issue with splitscreenwidgets?

icy dragon
#

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

trim matrix
#

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

gentle urchin
#

Sweet. I've never tried , just imagined that could be trouble

trim matrix
#

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.

icy dragon
#

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.

gentle urchin
#

Yeah i cant imagine getting away with pure bp project here

trim matrix
#

Yeah my game is designed to be played with controller so I'm not too worried about it

gentle urchin
#

I'd be very surprised if so

trim matrix
#

Thanks for the suggestions guys. I'm glad im actually making meaningful progress on this project.

gentle urchin
#

For some reason whenever i hear local multiplayer my mind goes directly to jazz jackrabbit

icy dragon
#

Jazz Jackrabbit 3 when

trim matrix
#

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

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 ๐Ÿ˜„

lyric relic
#

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.

gentle urchin
#

Probably works if you attatch to the socket on the spring arm?

lyric relic
#

oh, let me try that now, thanks for the suggestion

gentle urchin
#

Im not seeing how it would care about what is attatched to it really

#

Then again i didnt study the springarm class ...

midnight ravine
mental bobcat
#

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.

lyric relic
midnight ravine
mental bobcat
#

I'd like it to strafe in a perfect circle

midnight ravine
#

@lyric relic this should get you started

lyric relic
#

oh, checking your BP now

midnight ravine
#

@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

lyric relic
#

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 :/

mental bobcat
lyric relic
#

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 ๐Ÿ™‚

blissful grail
#

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.

gentle urchin
#

Question would be what the usecase is, and if theres a better solution to achieve the same thing

lyric relic
blissful grail
#

Why? Is it because you're trying to force the Unity workflow into UE?

midnight ravine
#

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?

gentle urchin
lyric relic
#

why would i define a new actor type every single time, if I can decorate the base actor component to add new functionality

midnight ravine
gentle urchin
blissful grail
#

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)

gentle urchin
#

You can easily make components that handles their own states or setups, or communicate out to the owning actor

blissful grail
#

Ctrl W on the asset in the content browser to duplicate, then change the mesh.

gentle urchin
#

Data assets, data tables .. many ways to rome

lyric relic
#

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

faint pasture
faint pasture
lyric relic
#

simple use case, having multiple light switches that can do toggle different light components

gentle urchin
#

Understandably. Luckily i did what you wish you did ๐Ÿ˜„ went straight for ue4 !

faint pasture
#

That's the essence of the problem of 3rd person aiming.

lyric relic
#

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

blissful grail
#

Create a switch actor, then just link the light to the switch through an exported variable.

faint pasture
lyric relic
#

๐Ÿ˜ฎ oh how

#

I must be missing something then ๐Ÿ˜ฎ

faint pasture
#

Make a light component ref on it and set it.

lyric relic
#

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

faint pasture
#

Depends on how you want to link everything up tho.

lyric relic
#

the reference list is empty

gentle urchin
#

As said, theres like a hundred ways to do anything

midnight ravine
gentle urchin
#

Some are good, some are less good

midnight ravine
#

Other games handle this problem well too. E.g. PUBG etc.

gentle urchin
#

Last resort is th infamous get all actors of class ๐Ÿ˜„

midnight ravine
#

but I can't think of a good method to do so

faint pasture
brazen merlin
faint pasture
#

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

midnight ravine
#

is that just a flawed strategy?

faint pasture
midnight ravine
#

makes sense

lyric relic
faint pasture
#

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

lyric relic
#

without doing get components by tag/class

faint pasture
midnight ravine
#

thanks @faint pasture . I'll explore that strat right away <3

faint pasture
#

Then you could do a many to one and many to many relationship as well

brazen merlin
#

Or actors

lyric relic
#

ah, so you mean I can create a light bulb actor that implements an interface

brazen merlin
#

any actors you want

#

one sec

blissful grail
#

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.

lyric relic
#

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

blissful grail
#

UE is not Unity. Everything doesn't have to be a component.

lyric relic
#

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

blissful grail
#

There is also a point light actor. Maybe that's all you need.

faint pasture
#

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

lyric relic
#

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

blissful grail
#

That's not the only purpose of an actor

lyric relic
#

but it's the only solution to get an actor component ref

midnight ravine
#

@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

lyric relic
#

"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 :/

blissful grail
#

You don't need to live and die by components in Unreal. This is not Unity.

brazen merlin
#

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

brazen merlin
#

its an actor variable, and that you can hook up in your level

#

if you want more than one, make MyTarget an array

lyric relic
#

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.

brazen merlin
#

that does not matter for this setup, that sounds like for your needs

lyric relic
#

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

blissful grail
#

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

faint pasture
#

@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?

lyric relic
#

@blissful grail oh that would be great! but mine is showing this, any idea what am I missing? I made it instance editable

blissful grail
#

It needs to be an object reference

willow phoenix
brazen merlin
willow phoenix
lyric relic
blissful grail
lyric relic
#

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

faint pasture
#

You guys and your handmade levels. Don't go to deal with none of this s*** if everything's procedural LMAO

lyric relic
#

why would I need a new Lightbulb actor

#

just to act as a light component

#

@blissful grail completely agree

brazen merlin
midnight ravine
faint pasture
faint pasture
lyric relic
faint pasture
# midnight ravine I did that here didn't I?

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

lyric relic
#

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

midnight ravine
#

@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

faint pasture
willow phoenix
faint pasture
#

In my case I just sent that to a variable, aim rotation.

midnight ravine
#

yeah I tried to apply the same logic to my CalculateADSAimingDirection function

faint pasture
#

@willow phoenix his line trace is fine, he's just not using that rotation for his scoped camera. That's the problem

brazen merlin
midnight ravine
#

I thought I was

faint pasture
midnight ravine
#

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

blissful grail
midnight ravine
brazen merlin
blissful grail
#

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.

pastel terrace
#

Is this a place I can post my blueprint and seek answers why it doesn't work. I am new to this server.

blissful grail
#

Yes.

lyric relic
#

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.. ๐Ÿ˜„

faint pasture
#

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++

blissful grail
#

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)

spark steppe
#

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

pastel terrace
#

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

midnight ravine
#

@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?

spark steppe
#

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

lyric relic
#

@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

faint pasture
midnight ravine
#

@faint pasture yup

blissful grail
#

C++ ain't all that bad honestly. UE makes it pretty easy. There are some gotcha's of course, but it is very digestible.

lyric relic
#

just looking at the C++ macros ๐Ÿ˜ฎ omg so scary lol

faint pasture
#

You'll want to update the control rotation to be the character viewpoint aim rotation right before doing the switch

midnight ravine
#

oh, do I need to deactivate the flag, set the rotation manually and then activate it again?

#

oh

#

that's much more simple

lyric relic
#

any recommendations for an IDE that works well with UE? for me VS doesn't recognize the headers automatically

faint pasture
#

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

blissful grail
lyric relic
#

I heard about it, but someone was saying it's not good for debugging, is that true?

faint pasture
#

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

spark steppe
#

rider is for kid tho

blissful grail
#

I still find Rider to be much faster than VS + Resharper. Even VS2022.

brazen merlin
faint pasture
#

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

spark steppe
#

yea, rider is awesome

#

gentoo + rider :p

midnight ravine
#

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

faint pasture
#

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.

midnight ravine
#

Idk what you're referring to with the aim point

faint pasture
#

Choose whichever one you want drive with control rotation but you can't drive them both.

midnight ravine
#

do you mean the trace location of my first trace that I shoot from the TPP camera?

faint pasture
#

The AimPoint is the 3D point in the world where the camera line Trace hits.

midnight ravine
#

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?

faint pasture
#

You going to update the rotation of whatever the scope camera is attached to, or even just the scope camera itself if you want.

midnight ravine
#

that would be the mesh

#

which as we just talked about should be oriented correctly anyway

faint pasture
#

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.

faint pasture
midnight ravine
midnight ravine
faint pasture
#

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

midnight ravine
faint pasture
#

I'm sure you understand, but this is the problem you're dealing with here.

midnight ravine
#

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

faint pasture
# midnight ravine

You need to set that rotation whether it hits or not,. Select the hit if it hits, otherwise use the end point

midnight ravine
#

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

faint pasture
midnight ravine
#

and my thought was that I could just pass the correct rotation once and have the player control it no problemo after

faint pasture
midnight ravine
#

3PP: control rotation is on
1PP: control rotation is off

faint pasture
#

Okay then set the 1pP camera rotation to be aim rotation

midnight ravine
#

this doesn't really change anything

#

hold on

#

so my trace is correct

#

I verified that much at least

faint pasture
#

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

midnight ravine
#

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?

faint pasture
#

On ADS -> ControlRotation = AimRotation -> Change cameras

#

And always Trace out of your current camera

midnight ravine
#

welp now im totally confused ^~^

faint pasture
#

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

midnight ravine
#

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

midnight ravine
#

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.

amber cairn
#

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!

faint pasture
midnight ravine
#

oh

faint pasture
#

Add controller yaw and add controller pitch modify Control Rotation

amber cairn
#

consider it facing direction

midnight ravine
#

so the control rotation is basically just the rotation you get by projecting a trace from the camera directly forward? kind of

gentle urchin
faint pasture
#

Chain of causality
Input -> change control rotation -> camera etc uses it

amber cairn
midnight ravine
#

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

faint pasture
#

If you intend for it to be compounding

midnight ravine
#

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.

faint pasture
#

You do it every frame as you're constantly moving the camera around right?

lapis violet
#

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

midnight ravine
#

again, the "reset" idea I was talking about earlier

#

or do I have something backwards

faint pasture
midnight ravine
#

oh yeah no

#

it's literally a hard swap of cameras

faint pasture
#

On reset you just do the look at rotation from the location of the 3pp camera

midnight ravine
#

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

faint pasture
#

So when the view moves it's aiming at the same spot in 3d space.

midnight ravine
#

yeah the whole "and do this on tick" threw me off hard haha

faint pasture
#

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.

midnight ravine
#

yeah

#

@faint pasture

#

the trace is correct and everything

#

but nothing really changes

trim matrix
#

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?

midnight ravine
#

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

amber cairn
midnight ravine
#

the camera isn't aligned to the linetrace

#

although the trace seems to be correct

faint pasture
#

@midnight ravine your trace prolly ain't hitting the guy

midnight ravine
#

@faint pasture

#

that's not the issue I think

#

the horizontal alignment is correct now

faint pasture
#

@midnight ravine show how you're driving the 1pp camera rotation

#

You're just using control rotation right?

midnight ravine
faint pasture
midnight ravine
#

yeah I think I do

faint pasture
midnight ravine
#

well

#

thanks LMAO

#

doing the inverse calculations will be easy now

amber cairn
midnight ravine
#

can you tell me why this affected all of that? @faint pasture

amber cairn
#

requires some division

faint pasture
#

@amber cairn

#

That might be it

faint pasture
midnight ravine
#

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

faint pasture
#

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.

midnight ravine
#

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

faint pasture
#

@amber cairn would buying 10 cost 13.816x as much?

faint pasture
midnight ravine
#

beautiful!

faint pasture
#

It'd help to draw a debug point at AimPoint on tick until you're all set.

midnight ravine
#

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

midnight ravine
faint pasture
#

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

midnight ravine
#

is the performance tradeoff not a problem? I'm guessing not since you're suggesting it.

midnight ravine
faint pasture
#

In my game I run thousands of line traces per tick, a couple of them for your aiming system is nothing

midnight ravine
#

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.

earnest mango
#

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)

earnest mango
#

@faint pasture Didn't know of that node! Thanks m8

woven moon
#

Hello ! What is the proper way to do something after the level has been loaded ?
I'm trying this and it doesn't work

rancid ocean
#

^^ use Begin event in the Level Blueprint ' Open Level Blueprint' in the ribbon bar in the editor..

smoky marsh
#

So just like call it on begin play

woven moon
#

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