#blueprint
1 messages ยท Page 345 of 1
It may be easier to just spanw a giant collision box instead trying to detect the hit by the swing.
eventually the goal is to make melee combat system like chivalry 2 or mordhau uses
I'll just try to address issues as they occur
Whats the method?
Video doesnt explain how its done.
For me, I baked the animation data. Basically just record the swing in editor time by slicing the attack frame.
Then its all just replaying the data at run time so doesnt matter 2 fps or max fps.
But ofc the issue is i have to bake every single attack animation.
an old picture of the system
i just used custom object channel overlaps for my attacks
Something similar I do, i just went with tace on the mesh itself instead of using channels
its fine until it isnt and it will most likely notify you when you start missing things ye
so far it's been pretty efficient, had a few problems double/triple hits i think i worked it out
instead of a bunch of traces, i'm already eating up the game thread
i also just need it close enough so i'm not too worried about it
it's all good and fun for me lol
Ain't about collision though, its about the ammount of sample.
You got start and end but how will that go if the sample is not big enough that you only got those two points? It will end up as a straight line insteas an arch.
i append the line trace each tick
Hello,
i am trying to make a fairly complex ranged combat system for an RTS style game. So i am trying to have performance in mind.
Currently using a "Damage system" component but i am struggling to figure out how to make the internal calculations modular when pawns with different statistics fight each-other. I know how to take statistics from the attacker into the BPC but not how to do it with the defending target.
The goal is to have different pawns with different statistic being able to engage one another.
simplified Example:
Pawn 1 does 200 damage and has 100mm penetration while also having 150mm armor and 1000 health.
Pawn 2 does 350 damage and has 125mm penetration while having 50 armor and 1000 health.
My question now is:
Is it possible? Could this be a viable system? If so how to do it? If not what is the alternative?
Not insanely confident in UE5 yet so use as much "baby language" as possible.
Ty in advance
you just do the maths
create the formulas and tweak the numbers
its up to you where to resolve it
you can get the hittarget back to the damage dealer and resolve it with a function or interface. and interface the calculated damage
you can also pass the attack parameters to resolve them with the defender
and you use whatever method for the variations of character stats on runtime actors
i made a system where the character applies their stats to the weapon actor. and the weapon actor combines the stats with its own. and interacts with an interface or a component that resolves the damage
I feel like HealthComponent with all the functions for calculating 'end' damage would be best.
Event with Damage(damage amount, penetration) then you check armor on and do calculations.
The other way I think it's worse if every spell would have to first take armor of the target and calculate how much in the end it deals.
It's pretty simple, if you already have exact system with mind and you want to have penetration, armor or other buffs debufs then it's easy implementing that. Worse if you don't have solid idea yet ๐
im making a name tag and i want it so it sets an image in the name tag to thare players Pfp on oculust is thar eny way i can do it or even just what country they live on
You'd have to use whatever OSS you're using to query that information.
just have some function somewhere that can be passed all the relevent data and crunches the numbers
It can be as simple as a hp component that gets interacted with via HPComponent.TakeDamage, and as complex as you want
just have the attacker compile whatever numbers together to pass a message containing whatever you need (raw damage, penetration, hit angle, phase of the moon), and with that + the defenders stats you can resolve the combat
hey does anyone have any good resources for how to use the 'attach actor to component' node? I am trying to make a modular weapon system for swords, maces, axes etc but I can't find any good resources for it
@worthy peak before the attaching you will need to create your equipment component.
If i were to do it, i would have equipment component (actor comp) hold an array of data that specify which weapon to spawn and which socket it should be attached to (if static mesh).
Then on initialize or equipped just get the data, spawn the actor / mesh component and attach it appropriately.
There's like many ways to do the equipment system, there is no one right answer and that would be game specific.
You can always fallback to the simple form if you just start. Have data that you can pull in the actor component.
The rest is just spawning and attaching the weapon when called upon (i.e when equipped a weapon)
If anyone has experience unmapping keys with the enhanced input system, I could use your help. I've successfully got it looping thru all the widget rows finding the control of my choice (hard-coded to forward in this case), passing in an empty key, then firing the "unmap" node. It SHOULD print the control's display name and then "unmapped from NULL" or something, but it still lists the key that was supposed to be unmapped. I can't find much info on the "unmap player key" node, it seems like it should just do the opposite of "map player key", but it's giving me nothing to go on, doesn't spit out any failure reason, and the node is firing
ah I see, yeah this is the part I'm stuck on, I have them attaching together but they kinda... helicopter off. And if I just turn off the physics for the blade then it just stays still and doesn't move with the handle (I'll send screenshots and a video of testing in a minute)
Well attaching is one thing, physich another.
I dont touch physich but you can look at the documentation and check out physich constrain.
yeah, I ended up trying to use the physics constraint to get them to attach together but they just helicopter off ;-;
@worthy peak but why do you want to apply physic when it's being hold by the character?
I'm making this for a vr game, so I would want you to be able to pick up, drop, and put weapons on weapon mounts. I just did this in a 3rd person template so I could test how to attach objects together since I've not done that before
Don't default VR template already handle grabbing objects? You can just look at how they do it.
the vr template does have grabbing objects by default yes, but I was finding it hard to look back at the default code to use. I'll probably have a look back at the template's code to try and see how they did it.
that's your best bet tbh.
look at the part where it grabs the object and obviously just don't call the logic that let go of the object as long as the sword is being hold.
thank you very much, I'll have a look back and see how I go :)
How can I control a specific bone in a SkeletalMesh in and ActorBP?
the SkeletalMesh already has an AnimationSequence, I just want to programatically control the Head bone to look at things
You do normally control that in the animation bp.
The anim bp in turns read from the bp where it should be looking at.
The node to control your bone is transform modify bone.
Can I use an AnimBP at the same time as a AnimSequence tho?
No, but why would you use anim sequence for a character
You can play montages
Which still usses anim bp.
Its more of a prop, with a looping idle animation, hence the sequence
Anim bp with idle anim will do that.
you can feed an anim sequence into a modify bone node in the animBP to manually control the head while the sequence plays
Have a component that spawns a ball that snap at nearest character.
The anim bp simply get the ball location from its owner then transform the head bone to look at the location.
Thats how I get my npc head to look at closest character.
So this AnimBP works for the sequence, but how do I access it in the ActorBP to provide the facing rotation?
Read from the owner, you initialize the owner at the instance the anim bp is created.
right click > type in "property access" and you can directly retrieve a rotation var from the player BP
AnimBPInitialize -> Get Owner -> Cast To W/e your character is -> Set the reference.
Then every tick in anim BP -> GetYourCharacter-> Get me the location of where I should be looking at.
then in the anim BP you can run a function that calculate the look at rotation based on the head location and the target location.
the result is what you feed to the transform modify bone
Also add interpolation for a nice smooth rotation.
took a bit to realize the AnimBP graph isnt the EventGraph -.-
otherwise this looks like itll work!
thanks for the help!
im very new to ue5 and i made a menu in my vr game for pavlov and i made it so when u open the menu the Tablet the menu (widget) is on scales open and when u close menu scales down
but it does not seem to work
are you setting the NewScale3D somewhere? otherwise you are just feeding constant value.
Hi! ๐ I need some help in Unreal.
Iโm trying to play a ticking sound that triggers based on a rotating mesh โ kind of like a clock tick each time the rotation passes a certain angle. The mesh is simulating physics, so Iโd like the sound to play in sync with its rotation changes. Any tips on how to set this up in Blueprints?
Play the sound after each interact or when you fire the event to change the rotation, or is it a constant update?
Hi, thanks for your respond. I want the sound to update with the speed of the rotation. The higher the rotation speed, the faster the ticking sound.
what is the current code, my suggestion is to change the play speed when the rotation increases
The same variable that makes your static mesh rotate with a certain 'speed' should be used to play sound, maybe on Set Timer By Event (loop 0.2s) , and the 0.2s variable you would plug the 'speed'. A bit of math so it fits like the faster the speed, the more often the loop repeat.
I did something similiar a few months ago. It wasn't for physics objects nor do I have any info on how scalable it is but it might give you a starting point.
The logic is on a component so I implement the event dispatcher on the main actor to play the sound.
Does anyone have 15 minutes to help me build a simple blueprint for VR? I want to basically have material swatches that once selected they apply a material to a sculpture. I already have the tracing work but I dont know how to start with this section. Maybe someone could help me or point a video/online forum where I can find some info about it
Hey, when doing Set Actor Location and Rotation, Location works but not Rotation, it's so weird
it's not about the Yaw value being wrong because it just does not override my rotation at all
like I can turn around a bit, the rotation won't be reset at all
that's what my character is like
any ideas? ๐
It's a character. It's rotation is overridden from it's controller's ControlRotation.
oooh okay thanks
If you've gotten a ref to the target (I assume from your trace) you should just be able to set its material. Which bit are you struggling with?
Would it be okay if I private dm you?
Hello I'm the bottom of the character? I want to detect the soles of the feet. Any good tips?
detect what about them
Where they are? Use a bone or socket location
for what purpose ?
That's how I'm testing it right now
When I put it at the 0 0 0 point, the shoe exactly pierce the floor, so I want to detect the shoe soles through wire frames or scannedepth
so you want something like ik foot stuff ?:
yeap
๐ฅ Movement Tutorial Link: https://www.youtube.com/watch?v=q-nxHRPyee0&t=922s
๐ฅ UE5 Manny IK Using Control Rig Tutorial Link: https://www.youtube.com/watch?v=1wf0lTDJyiU&t=69s
In this beginner-friendly Unreal Engine 5 tutorial, learn how to implement Leg Inverse Kinematics (IK) and Feet Rotation for custom characters. Master the art of cr...
make a socket attached to the foot bone
so the socket can be right at the sole
so when i pick up objects, the lighter objects are the heaviest, and the heavier objects are the lightest. i understand that these nodes want a smaller number for harder stiffness and stuff, but im not sure how i can do that with the Get mass node. is there a way to like... reverse how the node works or something?
if i have an editable int variable in a gameplay cue โ and im adding the gameplay cue in another blueprint โ am i able to access/change what the editable int variable is in the other blueprints
make it like stiffness is a value / mass
Is there a way to copy the Location & Rotation from the Transform and paste it into the [ Set world location and rotation node ] in one copy/paste or do i have to do all 6 values one at a time
when i start unreal engine, it goes to the last project. how to i get it to start up from the project select screen instead?
Thanks a lot to everyone that helped me you really helped me get rid of my metal blockage and figure this out! I got it from here!
but i cant get the math to work
what math ?
im trying to get actors to spawn in a line in front of the player...
but cant get the math to work
they don't
one constant stiffness and damping should work for your use case, maybe make it a bit nonlinear if you need to pick up stuff ranging from 1kg to 1,000kg but that depends
Eh? What are you opening?
so an even line like the center is where the player is ?
SpawnPos = StartPos + (EndPos - StartPos) * Index / Count
yeah working on iot
I open unreal engine shortcut, and it defaults to the last opened project ๐
Use the .uproject file, it should be in Documents/Unreal Projects/(your project folder)/... I don't know what's up with your launcher, you might have the wrong thing set as the shortcut. For example, if you pinned the project to the taskbar, instead of the UE launcher. I just pinned the Epic Games Launcher, and go from there, clicking on launch on the engine, but that's mainly when I create new projects.
dividing doesn't do anything and makes it all wonky and worse
deleting the other 2 makes it not work to how i want, and has no affect on what im trying to fix, what can i do to like reverse how those nodes work.
I'm trying to create the death of a player where I place the enemy in front of them, they lift them up, choke and snap their neck. I have it set up on timelines to set the location and rotation of the player camera and then enemy hands IK attached to the camera. Now I'm trying to figure out the best way to set the rotation of the camera yaw to simulate snapping the neck, such as interpolating the yaw minus 90 degrees, but I believe the yaw is 0 to 180 clockwise and 0 to -180 counter clockwise, so I'm not sure if setting the world rotation of the camera is a good idea. Is there a simple way to do this?
Maybe Lerp 0 to -90 and set that to Add Local Rotation for Yaw?
attach camera to the head bone
is this essential in the UI blueprint that will control the enhanced input remapping?
enhanced input subsystem > add mapping context?
If you must use timelines, make it additive
the rotation isn't the result of the timeline, it's the result of the rotation at start + the timeline output
That's not something I want to do. I have it on multiplayer where I want the clients to have there own death sequence and the other players see something else
Position = StartPosition + TimelineOutput
Rotation = CombineRotators(StartRotation, TimelineOutput)
then your timeline can just roll and it'll work
after testing this seems to work fine
so when i pick up objects, the lighter objects are the heaviest, and the heavier objects are the lightest. i understand that these nodes want a smaller number for harder stiffness and stuff, but im not sure how i can do that with the Get mass node. is there a way to like... reverse how the node works or something?
Why do you keep asking the same question? You shouldn't be changing your parameters based on what you pick up, at least not at first
you only need to turn up strength for very heavy stuff if the parameters you settle on don't manage the large stuff satisfactorily
because whenever i get a answer, they don't elaborate on anything leading their answer to be completely useless. cough
Do you understand how stiffness and damping interact with the mass of a physics object?
sitffness makes it so when you stop moving it, if it wobbles a bit or not, and damping makes it so it has weight all throughout you moving it
Not really.
Stiffness is how much force to output based on how far the thing is from where you want it to be.
Damping is how much force to output based on how fast the thing is moving relative to your target position.
Choose a damping about 0.1 to 0.3x your stiffness, and choose a stiffness that makes medium weight stuff feel good. Get that going first, then consider dynamically changing your values based on weight, that would only be necessary for non-realistic stuff like being able to pick up a car.
okay, but what would i do to change the values based on weight?
thats my issue.
what? there will be different objects with different weight that i pick up?
Yes, but why do you want that to change the values? Do you want everything to feel exactly the same when picked up?
the damping and stiffness is what makes it feel heavy?
thats how the weight is applied?
A downward force or drag would be better I think
the ratio between the stiffness and weight is what makes it feel heavy.
Moderate stiffness, low weight -> instant response
Moderate stiffness, medium weight -> slightly lagged response
Moderate stiffness, high weight -> very lagged response and drooping
Have you got it to work at all with constant parameters?
but why? this stuff does EXACTLY what i want already
yeah like gravity for example
which already exists
You want light stuff to be easier to move than heavy stuff, and super heavy stuff to be almost impossible to move, right?
well i need a way to change the values each time i pick up a object with a different weight
this is my issue.
I've already said dude, different items with different weight.
What are you actually after
??
OK, how should a light thing and a heavy thing differ when picked up?
im confused. if its very heavy i won't be able to pick it up and id maybe be able to drag it or wobble it, a light thing i can pick up and even throw
i'm confused what you want me to explain?
it will already do that if you just set your parameters to sane numbers
no need to read its mass at all
No it won't, they will all be the same weight lol
is the physics mass different on these different things?
dude, the stiffness and damping is what i do to make the weight, actually happen when picked up
Yes, i just said that.
different items with different masses
that i will be grabbing.
if they're all tossable then just turn your stiffness and damping down
there will be a point at which the light things will be tossable and the heavy things won't be
your stiffness is probably hella high
๐คฆโโ๏ธ alright, lets ignore this part and focus on the part that i need help on.
^
the part you need help on is understanding what's going on under the hood
No?
changing the values will defeat the purpose, that will make it act the same no matter the mass
meaning all will be tossable or none will be
๐คฆโโ๏ธ sure
anyways
^
there isn't gonna be a max mass
several people will be able to help pick up objects
Then a constant force will be best based on mass
A component that adds the force most likely
how do you do it, and what does it do.
Add a force on tick, but I would try what was suggested with the damping first
i tried to divide the getmass by 80, and heavy objects don't move at all which is fine, but light objects with a mass of 5 seem so heavy for no reason
It will be a stronger force for heavier things when you pick them up
I can't say it a million times tho lol
1000/mass
Or even 5000
Or even 10000
okay but i tried 1000 and even 10,000, and heavy objects are soo light now
Right then you multiply that number by another number
...
Can you read formulas ?
Multiply the result of the division by a constant
10, 100, 1000
Try different numbers
Well I'm just telling you how to reverse what you have
The answer to your question how to reverse it
In reality there's probably better way to do this
I think I know the root of the problem
soft constraints changed in the ue4 -> ue5 upgrade
they don't respect mass any more
I had to change my suspension setup from using soft constraints to linear motors
yeah Stiffness = SomeNum/Mass and Damping = SomeSmallerNum/Mass will do it
If Epic's code did what it says on the tin you wouldn't hvae to do this but they broke soft constraints when switching to Chaos
i believe i got it to work anyways, i just wish i could make it so it didn't wobble around as much when lighter though.
tune the damping
both angular and linear?
yes
in this case you need to set both to be SomeNumber / Mass or SomeNumber / MomentOfInertia because Epic's stuff doesn't work like it should
am i able to manually change the stiffness and damping on objects though? or is a physics handle only thing
usually that's just handled in a spring/damper system but Chaos is still buggy i guess
because outside of this, the physics for the objects are kinda scuffed
you can use physical materials to tune how much things bounce if that's what you're asking
ah ok
Or you can just use a constraint and linear and angular motors then you won't have to tweak anything. You're having to change the parameters on the fly becuase soft constraints (which the physics handle uses under the hood) are broken
also, id like to see if you know how to do this, when i grab objects, im just teleporting my hand (the skeletal mesh) to the location, but instead, i want to physically anchor the hand on the object
so that even if the object has lag, it will still stay anchored to the object
if that makes sense.
you'll have to be keeping the hand at the same relative position WRT the object, not based on your aim
aim -> physics handle target point
Object transform -> hand point
well also, if i move my hand through the ground or wall, it will detach in a way
so thats why i want to make it anchor instead of just moving it
is the hand a bone in a skeleton?
no, i just made the arm/cord part
the hand is untouched as im still making the final mesh
this is just a test rig.
I mean what is the hand, a component on its own or part of the body?
if it's just a free component you can just attach it to the grabbed thing
component on its own.
just attach it then
its a skeletal mesh that i put in a blueprint, and dragged into my character hierarchy
what do you mean?
Just the hand or the hand + arm?
hand + arm, the whole thing that you see that moves towards the object.
show the skeleton
yeah you'll just have to move the hand per frame
however you're doing it right now where you keep it moved to the aim point
so theres no way to actually anchor it to the object though?
yeah
its just moving to the location of the object.
all anchoring is is "move to stick with the thing"
Just instead of moving the hand to where you're aiming per frame, move it to a point relative to the grabbed object.
Maybe some traces before you grab
oh alright.
he has a trace on grab, just need to cook up a RELATIVE location vs the grabbed thing
rotate/unrotate vector are your friends
or transform / inverse transform vector
or just attach some scene component to it and snap the hand to that per frame, it'd be easier
What are some of the gotchas / downsides of event dispatchers? They seem more efficient than 'OnTick' for a lot of stuff, but just curious on the drawbacks or thing to watch for / overuse, etc.
can be awkward to dispatch all the things and if it's a thing that's gonna happen all the time anyway it might literally be faster to just tick
updating hp bar, probably tick, especially if you have regen
Circular callbacks. Things calling things that call things that call things. And in general things that broadcast a lot because it's associated state gets set a lot. They can end up causing very deep callstacks for what should be simple setters sometimes.
updating your name, probably a dispatcher
Ah, awesome, thanks.
They're great for when your problem is in the shape of "X wants to know when something happens in Y, without Y knowing or caring about X"
Event Dispatchers aren't really a replacement for on tick behaviour.
You have a few main ways of doing things, I'll give a super basic overview of them:
- On Tick - This thing in this class must happen every frame (Things like movement code)
- On Timer - This thing in this class must happen periodically, but doesn't need to be every frame or at super frequent intervals (Things like spawning an enemy every second)
- Custom Events - This other specific thing (or the class I'm in), that I know what type it is, needs to do this specific event (This could be something like reloading a weapon, or talking to an NPC)
- Interfaces - I want this other specific thing to perform this behaviour, however I don't care what type it is, or whether it even implements that behaviour necessarily. In other words, functions classes can choose to implement without the caller needing to know it's full type information (This could be something like finding out what faction an item, building or NPC belongs to, but you don't necessarily care if something doesn't belong to a faction, because that's normal)
- Event Dispatcher - Something important has just happened to me, however I don't need to know everyone that wants to do something with that information. They need to know about me, so they can listen to me, but I don't care what they do with the information. In other words, you can think of a radio station. The radio station broadcasts music or whatever, but they don't need to know about every individual listening. The individuals that care and know about the station can just tune in when they wish. (This could be something like broadcasting that your inventory has changed, so your UI can update.)
The main downside with event dispatchers, as with a lot of other things using hard references is dependency chains, A knows about B, which relies on C, etc. I'd always advise making base classes for those things to avoid it. That, and what Authaer said, you can cause some knock-on effects.
I always start thinking.... "Am I making this purposely too complex?"
The simple approach is usually close to correct IMO
And try to keep references flowing in one direction
UI knows about state, state doesn't care about UI.
Pawn knows about its HPComponent, the HPComponent doesn't know anything, it just broadcasts when its hp is gone.
Etc.
Attribute changes on delegates give me nightmares.
most often, probably. If it's stupid and it works, it's not stupid, that's something to remember about less than desirable practices. A common one for example is UI bindings. They're not great for a lot of use cases, but by the same token if you're making a small little game, it probably doesn't matter a whole lot.
Do what you need to do to get things done (just do that with people pointing out inefficiencies if you need help with that in mind)
UI binding can be totally fine
is the thing gonna change quite a bit? Just bind it and be done
Thanks everyone! ๐
Yeah you get a lot of people doing it for stuff that doesn't, but even then in the grand scheme of things if it's not an identifiable issue, it's not an issue :P
You'd maybe want dispatchers in the mix for a big complicated UI like EVE or WoW, but if it's just health bars and a bit of ammo just bind or tick. It might actually be more performant.
For sure I'm very guilty of optimizing before I need to optimize. And, needing to remind myself to 'get it done' and adjust as needed.
hahah. I also find myself trying to make 'everything' modular and dynamic... and, sometimes you just have to get messy.
Currently mostly using for UI.
When equiping another weapon (RPG) the equipment manager component sends out a message saying equipment was updated, so that appropriate other components, health, stam, mana, can do what they need to.
There's also the development cost to think about, if it's small enough, is it even worth the time to do it Properlyโข? I'd argue probably not in a lot of cases.
I mean if it's some portfolio work or something complex or just something you're using to learn good practice, there's a strong case for doing it right, but if you're just trying to get a game out there corners get cut all the time
Also proper isn't always just the thing that results in the least amount of computation
especially in C++ land
People thing a square root is slow, it's much much faster than a cold memory read
Sometimes(all the time) you have to commit warcrimes to ship a game. If you spend time constantly modularizing and making stuff more dynamic, literally nothing will fit together. You gotta find some shit somewhere to glue stuff together. Sometimes it's more important to have a heaping pile of shit that resembles what you want that you can polish up to be nice than it is to have a lot of shiny parts that don't do shit.
On this topic, is this bullshit?
official epic site
is binding just a tick -> read or is it actually a callback?
Not to mention there's those cases where chasing most performant leads you down the bad path. I'll never forget the branchless clamp guy that made an ASM clamp that was slower than FMath, because compiler optimisation
I have always been lead to believe that bindings are evaluated every draw, so I would say yes
Yeah, they've always been on tick.
Was a big confusion/ myth for me for a while, when I first started.
People telling me, and just trusting there statements
Gamedev has always been and always will be a field of smoke and mirrors, if it can be blagged, a corner can be cut or something done perhaps not as well as it should be, then it will be to save time and money :P
Branchless programming in event driven programming just doesn't work. Not really. There are some functions it helps. But in general it's an ECS style of programming that doesn't really work outside of it.
Learned a good bit of smoke and mirrors in a borderlands 3 DLC recently, there's this train that appears through very brief portals, too brief to analyze the "scene" on the other side of the portal, which happens to be a screenshot from borderlands 2 ๐คฃ
Some may call that an easter egg, I call that time saved
I come from a system engineering / administration world. Networking / server stuff. All the dev stuff is still foreign to me.
Have heard the term MVP recently and was soo confused. Eventually asked and was informed... minimal viable product that could be shipped.
Avoid too much feature creep / over optimization when it's not required, etc.
doesn't help that googling UMG Binding leads you to an Epic page that lies to you lol
It's especially annoying as everywhere else bindings exist is based on property updates that I've seen so far
UMG bindings, with the exception of the TooltipWidget, are all ticked. The exception as a whole to this is the MVVM plugin which does use that system, but is actually event driven.
It seems like that'd actually be a useful property in the engine
How is the MVVM plugin? Is it one of those "it's cool, but it's 3 years from being recommended to ship with it" type things
the capability to bind any old function to the update of any UProperty
I still don't get WTF a MVVM is. I get what a model and view are, but what the hell does a controller or viewmodel actually DO?
I'm still getting used to it, personally. It's nice. But it's a mental rework and I still don't use it in personal projects yet cause it needs groundwork.
The model is the abstract chess game, the view is your chess client, what the hell is a viewmodel?
The view model is what handles the functionality, it's the logic that happens when a button is pressed, that uses the data. It's just something that ties the data to what the user can do on screen
Model is your game code. Character's health.
View is your UI. Healthbar.
Viewmodel is the intermediary that listens for character health change and notifies the UI
So in one of my recent projects the view will call "save" on the view model, which will dump the data in the model to whatever format
I've been curious, got stuck in wpf land for a considerable while so it reshaped the way I think about UI, would be less painful swapping about ๐
ok so the common UMG approach just rolls the view and vm into the umg widget as a mashup of the two i guess
Yeah you could think of the standard approach as the umg designer being the view and the event graph being the view model and model combined
It's essentially an object that connects the game and UI and sits between them. UI doesn't know about Game. Game doesn't know about UI. They on'y know about the Viewmodel.
Wait until they add services into the mix
The benefit is that it doesn't matter what changes the viewmodel. Testing code, game code, handset values, wtfever. You can visualize your UI from that Viewmodel.
goddamn web devs ruin everything smh
One other benefit is that it can cache delegate calls.
Kinda like that one myself. Cause fuck delegates and attributes.
It's weird, I hate webdev, but like appdev which is just webdev with a coat of C# paint lmao
Yeah. Cause there's no need to set health 30 times a frame, and update the UI 30 times. UI draws at the end of the game frame, so no point setting the value until just before that.
ok I think i got it
it's like a smaller toy model of whatever you care about that both UI and state can just dump whatever data into and it sorts it out
seems nice to work with but awful to make from scratch
More or less, yeah.
What's the learning curve for CommonUI like, and how decent are the resources for it?
I always liked UI in Unreal the least, but I'm approaching an avenue that will need controller navigation in UI
I hate UI but I love UMG for actually making cool looking shit. My personal style is just to world space everything that can be. The ideal game has zero screenspace UI
Like I said. I'm 50/50 on it. I like it. But I still don't see the value early on unless you're on a biiig project and need the iteration without gameplay cause you're waiting on the other code to be done or whatever.
Just takes too much time to set up and make sure everything affecting the VM is running their special calls for it and eh. I'm lazy, and I like things to work when I'm prototyping. It goes on tick until I care enough to put something else there.
Been working on learning some UI materials for a little boomer shooter side project thingy, UI mats are actually quite fun.
It's meant to look like a livestream so maybe tone down the distortion but yeah it's been fun
Learning curve is pretty shallow I feel. I think the biggest thing is fully subscribing to the idea though.
That looks neat
That's hopeful at least. How's Lyra as something to learn from?
It's an opinionated idea where HUDs and Menus dictate the control types as Activatable Widgets.
You're in an FPS or TPS game and on the HUD activatable widget you pass back Game as your input config.
You're in an RTS and on the HUD activatable widget and need game and UI controls so you pass back All for both.
You pop up an options menu activatable widget and don't want to throw grenades while in it, so you set it to Menu.
This basically ditches ALL SetInputMode calls in the project. Because rather than managing it, the "leafmost activatable widget" dictates it. This solves issues like... You're in the FPS game which is GameOnly, you open your inventory which is GameAndUI, but then open an options menu which is menu only. You die in the options menu and your inventory closes. You back out of the options menu and your last input mode before that was GameAndUI on the inventory that is no longer there, so what do you do? Solves that.
The other major reason for it is gamepads. It moves an invisible cursor around to the center of the focused widget. Causes hover and click code for gamepads to act identical to a mouse, much less annoying coding. The activatables previously mentioned also generally set a default focus target so you can maintain focus in menus and such easier.
This was fun UI to make
or rather the thing to make the projector effect from the UMG
Interesting, so it sounds like something that's a potential pain to setup, but definitely has its rewards. I might have to give it a shot in a test project, I've put it off long enough ๐
On this. Lyra is pretty good to learn from I think. I would specially check out the main menu for ease. You can clearly see it simply pushing widgets using PushContentToLayer calls.
But looking at Lyra, you also have to check out the CommonGame stuff. That's the PrimaryGameLayout widget which allows pushing widgets to layers generically from basically anywhere in game. I VERY strongly recommend giving it a good look because it's a very useful system. But it is a pain in the ass to learn how to set up, because it needs a few things to work in a blank project. Off the top of my head you need a CommonGameInstance, CommonPlayerController, CommonGameViewportClient, and you have to hand set the UIPolicy in your.. DefaultGame.ini?
Useful to know. I can deal with some growing pains if it's worth it in the end. Thanks ๐
You can see this same thing in Lyra's DefaultGame as well.
They didn't make it a dev setting for some reason. ๐คทโโ๏ธ
What is the projector effect here?
Just some surface shader I made
it's on a box but I want to eventually make it work on arbitrary meshes
just calculates view ray entry and exit point and accumulates a few samples through the path
convert world space to projected uv space -> sample texture -> bit of brightness math for the projection angle -> sum up -> additive color
for my game project I want all the UI to be holograms
Huh, neat effect.
Here's it in motion
That is amazingly done. ๐ Just need some very subtle like gentle light jitter?
Thanks, yeah it needs some grit. Also might help cover up the dithering
@plush ridge I just want to let you know that from the job post you made in #freelance-jobs , nobody can neither dm you or add you as friend because you have both disabled. I was interested in the job so that's why I tried to message you but discord didn't allow me to ๐
This is a cool idea. You'd need to flip the widget though. If you're wanting something else to add, see if you can have objects block the projection if they walk through the rays.
Amazing work though, how long did it take to setup?
is there any difference between intvector2 and intpoint?
One may have more BP helpers, but I don't think so.
ait
oh ye one might more likely take vector operations
just asking incase there was something big and known
Took me a night or two to do, don't recall. Blocking the projection would be quite a bit of work, it might be easier to use light functions and volumetrics at that point.
This is just mostly to sell the projector effect
Anyone has any tip for figuring this out? Is there anything built in for scaling the WidgetComponent as we are zooming in/out, or I have to implement something like event dispatched OnZoomEventChange and bind to it in the WidgetComponent and set it's scale on each level for example? I want it to get smaller as we zoom out, as well as stay in the same place above building and not 10meters above it as on 2nd screen.
are you talking about the line render?
The health above the building it shouldn't get bigger when I zoom out and it should stay in the 'center' of building.
I know it renders on the screen so I'm thinking if is there any built in setting to click to make it work or do I have to make custom logic for that
that will lower the health bar and make it smaller scale on zoom out etc.
so it looks like it's actually sticking to the building a nd not floating 10 meters above it
im sure there is a scale for widgets in several places, you could change that based on the zoom level
expose the scale into it the same way you expose the health points
in regards to position, do you project it to world space from screen space already?
Screen because World looks ugly
i guess there is no point if its perma orto iso
hmm, do you mean no point using World projection?
yeh, yet ๐
when using ortho camera?
im thinking a wellconfigured anchor would help with the position
But scaling 2D elements to reflect the distance to a 3d object is wack because it might not look like you want it to.
im humouring it as far as i can. expose the zoom level to the widget and find out how widgets can scale cause i lost that from the stuff i remember
Well, this is what I have in mind to make Camera broadcast ZoomChange and Widget to bind to it and on Each Level set a custom scale that will work lol, but was wondering if maybe there is already something magical in engine that would make it work before I go into that
a tip for the scale. design the hp bar to look good in the max zoom level
cast
how do you expose the life value?
life value? this is in HealthModule that adds HealthBar to WidgetComponent
so how does it know the health?
I'm not sure if I understand the question? ๐ is it relevant to the general scaling issue?
in the context of
actor with life > widget(actor with life . life)
yes because the same way you expose life to widget, you can expose scale to widget
as a way of explaining you dont need dispatches here
i have HealthModule with health, there you can damage/heal and after that it's event dispatcher OnHealthChange which widget binds to
oh i see you already dispatch
HealthModule creates widget and adds it to WidgetComponent
um doesnt feel like il learn how to do this any time soon
i havent worked too much with dispatches so i cant tell how they differ from casting when doing multiple instances
im trying to make ai move to serten palce
Short answer is no, there's nothing built in. It's not to difficult to set something up. Like you said, having an OnZoomEvent type of event dispatcher can be a good approach and allow the widget to then adjust itself.
Thanks, just needed to hear before I start implementing this ๐
ok il wacth that
i was trying to learn on my own but tutorials might help a bit
its more like documentation, that video in particular is great for casting.
Where is the logic? AI controller?
@hollow flower
Considering how you currently set yours up in the screenshot, i deduce you need the video i sent first.
then you can watch the one for "ai move to" here https://www.youtube.com/watch?v=B6KK0WaZwLI
A good tut on blueprint basics would help
Your doing a few things wrong here
this kind of thing takes time to learn, have you ever program before ?
no im trying for years but every time just gave up and get back into it
Hey, I want to create touchscreen controls for Windows. Previously, I used the Touch Interface, but I think that only works when building for mobile. So I wanted to use widgets, basically like what they did in the Vehicle Template in version 5.6.
However, it doesnโt work as I expected. Theyโre using a "UI Thumbstick" for the widgets, and for some unknown reason, it moves the camera around by default, even without any custom implementation.
Also, I donโt see an option to use textures as icons. It was very easy to do that with the Touch Interface. Do you know how to implement custom joystick in widgets?
could anyone help me make a blueprint for these ineractable material swatches so that when i press one of them their material is applied on the cone. I am pretty lost and dont have much experience with blueprints in vr
have you ever changed material dynamically ?
No the thing is in my office i only work with ue for cinematics but now we have to do this vr project and its fallen onto me and i never did anything like this and cant find any resources for this specific action online. Ai hallucinates a lot when I try to use it to guide me
well what i would do personally is write a function on the player bp that sets the cone material
that would be the first thing
pass in a material to the function, and it sets the cone to that
then when you interact with the thing, you can get material, and set the cones material to the one that you selected
definately doable
thank you very much thats already way more info than I found by myself, will dive into these! I really appreciate the help, cheers โค๏ธ
you just need a reference to the cone, and you get the reference to the mat actor when you trace it or click on it
theres a node: get material, and a node: set material
on the mesh
What I need are resources on how to create a button that, after being pressed, can be moved around with constraints, similar to how the center of a thumbstick works.
Do you know of any tutorials for similiar systems? I don't have much experience with widgets.
Or do you know why in vehiclew template project "UI thumbstick" doesnt work by default, but when Im using it in my projects its moving my camera around even if I didnt implement any logic?
" Unreal Engine can detect single touch input on Windows touchscreens" <-- this is what the googles says about it
nah, I've been testing it on my touch screen and using two fingers simultanously is not a problem
but I have problem that this thumbstick ui implemented itself...
so it works, but the widget isn't responding ?
in any case, to do something like this you would get the mouse x and mouse y when you click, this is your origin, then subtract the new location from the origin
and when you let go of the mouse, snap it back to origin
can anybody help with this? This is a full auto fire mode for a gun and it SHOULD block you from spam clicking and shooting faster than the allowed firerate but it doesnt really work, if im holding LMB while its auto shooting and i start spam clicking LMB then i can all of a sudden shoot faster than the firerate
nop, you can still outclick the firerate :(
Dont use delay use absolute time : no clicking allowed before absolute time is reached.
this is all you need
replace hello print string with events/functions
im guessing the auto firing would be the event/function then? because now it only shoots semi-auto
i have an unusual first personfov problem where i use Virtual Plane to create a scope mask (projects texture in screenspace perspective corrected for a 3d target in the world). but it doesnt get affected by the custom first person fov. can i somehow correct for the fov in either the blueprint or the material?
so you want to press and auto fire, but restrict it ? i'm not understanding that
i'm just confused ig
like in every game you can hold to shoot at let's say 600 rpm but at the same you can also spam your mouse to shoot but it of course can't go above the 600rpm
i may have just done it, i replaced LMB input with an enhancedinputaction with this Hold trigger
before that i also used this but i didn't know the hold was set to 1 second so there was a delay which i didnt like
yeah now i cant outclick the gun's auto fire but also thanks for this, its a lot shorter than what i had before
Why does this not work on construct but it does on beginplay?
Hello,
i would like to find a system that lets me know the rotation of an "enemy pawn" compared to a "friendly" pawn that is looking at it.
The result of that that system is supposed to help me figure out if the pawn is looking at the other pawns front(red), side(yellow) or rear(green).
I don't think i can use an impact normal as that would be affected by the targets shape?
Ty in advance
hi, is it possible to make a point light ignore certain objects ?
dot product
"The dot product, also known as the scalar product, is a mathematical operation that takes two vectors and returns a single scalar value. It essentially measures how much two vectors point in the same direction"
use the lighting channels
yeah ijsut saw that, is there a way to change the default value of it for all objet ?
all have channe 0 by default
can ic hange to 0+2 by default?
just uncheck it on the mesh you want to ignore the light
idk much about it tbh
aye
Hey, that's strange, I enabled DMs to avoid this - can you see if yours is disabled? I also couldn't DM you
ohh I think I had it disabled for this server, not sure why
try now
sent!
hey, so i have a problem where when i grab the ground in my code, and walk away or move, the hand just starts spazzing out.
i believe this is because my current code is in a event tick, but I kind of need to keep it there to check if its grabbing the ground or a object. what can i do to fix this?
(grab point is the impact point of the break hit point.
well for one thing the video isn't doing anything, it won't let me play it for some reason ?
and that bit of code is all your doing ?
WHen is grab point set?
what event
Legend! Ty very much!
What does this "warning" mean? I've just binded an event to this dispatcher and it's returning the values properly.
i think it means if you edit the array it won't be the reference so it won't alter the array
No. its just what makes the hand teleport
im talking about how its just setting the anim instance to the grabpoint in a event tick
thats the main part of what im talki ng about
when you hold left click.
input action.
do you want me to send over more? and what part would you want me to send.
works for me.
just a bug with discord.
ok so your setting the point in the animation, and in the animbp your using that point to move the bone ?
Yep
ya i just tried again it works
and the problem is it's jumping around ?
its spazzing out, yes
but only when i move or look around
where do you set grab point ?
i believe this is because its in a event tick
ill show a image
so this is how im getting it
its impact point.
do you just want to press a key to shoot out the arm or something ?
it shoots at something, checks if its a object or not, if not, it does this code
to make it grab the ground like a harpoon or grapple gun
when does this run ?
it should run when you press the grab key
but executes this code in a event tick
that shouldn't be an issue
where else do you alter grab point ?
and your sure this runs on grab clicked only ?
also vinterp will make this look way better
hm, ok
i don't believe anywhere else
thats not normally how you pass to an animation also
Why?
in the animbp try get owner -> cast to player
then get the variable that way
so you don't need tick
in the anim bp? what would this do, also heres what the anim bp looks like
the animbp acts like a tick
however it was doing the same when it was a cord instead of a skeletal mesh
what does the event graph in the animbp look like ?
thats where i usually get and set the variables
because this is already running and designed for it
so you can skip the tick
atleast i think so
i just showed you?
ohhh
double click event graph
nothing
but that shouldn't affect anything
as
it was doing the same with a cord component
if you are only setting grab point here, and it only runs on grab then idk the problem
it should be fine imo
try a restart first thing
then show me that it's on the grab event
and are you holding down the key ?
what do you mean?
ok so it doesn't do it when you just press ?
only when you hold it down ?
yep
makes sense
but your using started and you figured that would be fine right ?
what does the IA look like ?
yeah, its how tutorials with telekinesis/grab in air work
what are you running off completed ?
this looks fine
put a print string comming right out started
does it keep firing when you hold down the button ?
you don't have any triggers geez i missed it
add a trigger
and select pressed
i just did that
and now it wont fire
its like it executes the entire code for half of a millisecond
i see it trying to play the animation but it instantly goes back before you can even see it
should i edit the threshold?
add another one released
just did, it works fine, but still has the same issue
so is a print string firing on each press ?
yes, it only fires it when i click press
it doesn't spam the print string like its repeating
yes
ya save everything
you can reopen the same project i think
but close it
and reopen it
the idea is to clear it out
a fresh start
still doing it.
search for set grab
you must be setting this somewhere else i think
where do i search for blueprints
what does the note say in the transform bone ?
tools, find in blueprints
just found out this parts useless
this is the one connected to the tick
but i think the one in the main code is fine, right?
this one is fine
this one you want
the other one wherever it is
you had three of them
so it was bugging out
just use one
the third one is for grabbing the object
if your setting this value multiple times this will cause the issue
set it after you draw the trace
after the trace
set it on hit
as far as the third one, what does that lok like
it only executes the other set anim bp when its true
dw
and i just unplugged it from true, it does the same
so now your only setting it one place ?
or your confusing me
you got three different settings of the same thing
so
there is a branch
it checks if youre grabbing a object
if you're not, it will execute the code for grabbing the ground
if it IS grabbing a object
it will execute this code
its in the event tick
ok so get rid of the one where you set grab point
no you set grab point thats fine
but at the end you set the anim instance variable
take that out
this one at the end to the right
ok so use that one, but unplug the tick
and see if it bugs out at all
if so your booleans are probably flipping back and forth
i already tried to use that one only and remove the tick one, it did the same
that doesn't make any sense
idk somethings wrong here obviously
if you press the key once
it prints hello once
and you set the grab point once
it should not keep moving
you must be setting it more times
the only other place im setting the anim grab point, is here, and its ONLY if your grabbing a object
maybe something with the transform bone in the animbp #animation might know more about it if thats the problem
which i tried to disconnect this and it still spazzed out
no because this happened previously when i used a cord component instead of a skeletal mesh
ok well it's a process to figure out the problem and it could be many things
only people can help with what you show
im plugging a print string into both the anim bp thing and the grab point
to test if they are the same values or tstay the same
it doesnt change even when i walk around
when your grabbing something nothing happens ?
i disconnected all the booleans, it still does this.
its when im grabbing the ground
yes what you need to do set the target anyway
can you clear the target ?
clear the target when though?
alright, should i clear anim bp aswell?
idk what that means
no
nvm just cleared both in the same thing, it just teleports them to 0 0 0
and it doesnt work anyways
it still spazzes out
see here you set target location
of the physics handle
thats for the object location though
it's probably still bouncing back to that
you want to disable it, or clear the target
when you do the floor code
thats all i can think is the issue tbh
i can see that
you unplugged it
i'm saying the phys handle probably has a target set
which is going to
and you don't set the target on the false branch
you just set the anim point
yeah
the true branch shouldn't have anything to do with it though
as its always gonna go to false
but your physics handle is still on and working correct ?
shut it off on false
turn it on on true
when do you grab componenet ?
what do i do here
only on true ?
after i set the stiffness and damping and stuff
nothing, don't do that
get the physic handle reference, drag out and release component on false
is this when you press the key ?
doesn't work still
hold, but yes
show what you did
and when you grab a component its fine or does the same thing ?
when i grab a componenet and move it does the same thing....
just found that out....
wait
it only does it when i walk backwards
or side to side, but its less
i would ask if you using the variables correct in #animation i know you literally said no
but i think it might have something to do with the problem, and if not, then atleast you know for sure
i don't believe it has to do with that
rather
my viewport
the skeletal mesh and the character itself
i think its in the details panel
hi, how to make E (tap) -> Func1 and E (Hold) -> Func2 and make these IA not overlapped eachother, if player hold then hold and Tap will not triggered
https://www.youtube.com/watch?v=MN-0otRNmZI Might help.
but i want these functions will not overlapped
now i using Hold and if press E its fires first func and after that threshold the seconds func runs
Check the second comment down on that video as you'll need to add another boolean so the release code doesn't always trigger.
- In the Holding code, just after the True branch after the Delay, set a Boolean variable (in my case 'Self Heal') to True.
- In the Released code, just after the Set Is Holding to False, check if the variable you set above (in my case 'Self Heal') is True or False.
- If it is True, set it to False. If it is False, continue with your Released code.
Hello everyone. My problem is this. I want to drag this BP rigdoll character on the ground and hold it like an item and drag it. How can I do this? thank you everybody
This is exactly what I was looking for, thank you so much
why does unreal lag when i look up at the sky?
Gotta render each planet in the galaxy. ๐
Pls help. Why am i missing stop montage node on my graph of my character BP ?
It was there literally 30 min ago, what could i've done so it's gone now ?
"Why does {thing} lag when {description}?" Always leads to "Unreal insights profiling can tell you what you need." ๐
does anyone know the name of this velocity? im a absolute beginner and cant find the exact same velocity component. and also falling if possible
Drag from the character and type get velocity.
Show what you have.
If you want to break the vector component, you need to right click the pin (yellow in this case) and select split/break.
i tried a few and couldnt find the one with return value xyz
this was it thank you!
and for the falling event, since its says "custom event" we cant really know can we?
What is your goal, aside from the tutorial you are following?
Right click empty space and type add custom event.
For a fall damage, i will just look for the apex event ( an event called when the character reached the highest z? ) save the heigt then on landed just check the delta between the apex z and the current z.
If the character falls more than certain treshold apply damage.
@fallen dirge not sure how you want to apply your fall damage but checking the z axis position of the character when it just start to fall and when it stop falling is the easiest to get "how high does this character fall"
Has anyone tried printing an array of text in their UI Widget on initialized with a for loop and notices it only executes once? I had an array like this ['asd', 'efg', 'hij'] and only ASD prints.
If I do an array of strings or ints the rest of the array fully prints out
its so bizarre
Show your code
Sure. It's a bit of a mess
well not really but here. The code is pretty simple..
its literally just a for loop printing
if I try to print an array of text it only prints one element
strings and integers are okay though
I've restarted the editor and did a re-build thinking maybe something got cached that shouldn't have but that didn't resolve it
Is there a way to have a camera that's not a subcomponent of the pawn? So I can more directly script its location.
Camera manager would be the rihght place to look at
Its got an event that decide where the camera is looking at
How do you get a particular camera to be assigned to a particular viewport/player controller? Other than attaching it to a possessed pawn.
Hey, I was wondering, is there any way I can get all widgets in a tile view ?
@radiant pebble
like this?
as in browser tabs?
if it is just drag it back in like browser tabs
then isnt it the exact opposite?
if i understood it correctly
ignore me if im wrong lol
Like, i have a tile view I fill with data blueprint which create a widget for each blueprint
but then, I'm trying to get all widgets
get children?
none of them exist here
oh nvm, it's a view...
yeah
get list items likely?!
this should return the list of data BP, but RN it's also empty
if widgets aren't displayed then its not in the array. and since I'm trying to make a "select all button" this will not work
there isn't guaranteed to be a widget for each element
the list view only generates widgets for what's visible
When you scroll down, what happen to the first widgets then ?
haha ok
the question is if you really want a list view to begin with
they only really are worth to deal with when you have hundreds of elements
Yes, that's exactly the case
Anyone know whats wrong here ?
bassically trying to when the actor is spawn it's push in a sence in it's X direction but at the moment after it's spawned it seems to just stay in place
I do have phyics enabled as well
it's fine seems i needed accel change to be ticked
Hello everyone. I'm using a post process volume to apply an outline effect, with custom depth to exclude some actors from being outlined. Everything works ok, except for Niagara. I did check the "Render Custom Depth Pass" and used the right stencil value in my niagara emitters, but it doesn't seem to make a difference. Particles still render the outline. Does anyone know how I can make niagara work properly with custom depth?
Hry Im creating stopwatch for my racegame and I want to start it after pressing button on different widget. What is the most efficient way to trigger "StartStopWatch" event?Currently I have this logic inside my stopwatch widget. Should I move "update stopwatch" logic to the vehicle pwan class?
Im asking because I wanted to use an interface to send a message from one widget (where the start button is) to the "StopWatch" widget, but "Get All Widgets Of Class" in the event construct doesnt return valid reference
Stopwatch should be an actor, or a component somewhere like GameState or PlayerState. Then your widgets can access it easily and tell it to start/stop/reset and read it's time.
Need more context. What class is this input in?
its my character controller
Put a print on this and run it. See if you get prints that the input is even working.
i want player to be able to zoom it with ortho width
it not works the "zoom"
You didn't put a print on it. In fact you just disconnected the execution line to the only thing that would work.
print?
You replied to the message.
is print a variable?
PrintString node. Connect one on the MouseWheelAxis node and see if it prints.
im a dummie with blueprints
Right click the graph and search for PrintString or PrintText, either work.
You need to hook up a component to that SetOrthoWidth too.
Anyone know why this might be happening, when the metors are well being sent through space they seem to all together here and there drop in velocity whether it's a frame dip I'm not sure but seems bit odd
looking at fps it stays nicely at 60
hmm actually it might be the editor viewport camera causing it cause it doesn't seem to do it looking through player camera
Camara component (wrote on the Ortho Width Node)
im dumb @maiden wadi
You need to find and retrieve your camera component (from the camera manager, if you are in the character controller) then plug it to the Target input of the Set Ortho Width node
probably not dumb, is this bp on your character ?
drag out the camera and plug that into target
I already done that but din't work
Are you doing this inside Camera Component / Camera Pawn?
yeah
Is there a way to add a button or a method to a UFunction node such that I can inspect the node params and run a call in editor function? I want to have a helper method to generate some data assets based on the settings in the node.
Think: BPNode SpawnAnItem(FString ItemName) -> Right-click or details menu -> button with : CreateItemDetailsAsset(node reference or some such thing)
Any ideas on how to do this or something similar?
yes
did you fix it? you need to plug the camera from the viewport on the left to that Set Orth Width node and it should work
i done it but din't solved
btw axis value returns +1 0 or -1
so you are not really changing any orth wit hthese small number
you shoul do like multiply X ZoomRatio (x100) for example
and have variable that you store Current Zoom (500 700 1100
tbh i would interp
yea you need to put then it on event tick, i can give you my solution in 4-5h
when i come back
its really nice
whats it look like now ?
i done this, but it just sterns the width to 500, i pressed R to Restart my level
0.0 * 1.0 is 0.0
If you can give me a step by step guide to do it from scratch, I will be very grateful.
and what exactly are you clamping ?
the ortho width
not how you would do a zoom btw
hmm, well i know what your trying to do atleast, but this isn't the way to do it
yeah , I want to do a simple zoom with the ortho width of the orthographic camera
by looking at what you have i would suggest maybe some blueprint tuts
because 0 * anything is zero, and i can see you don't know how clamp works
clamp clamps the value between the range
you inputted 0.0 and clamped it
yeah
so it would be the minimum
for instance if you put instead of 500, 1000
it would goto that
what you want is to keep track of the current zoome
do you want to the zoom to stick ?
or just zoom while your holding a key or something ?
no, just a simple orthographic zoom to my character when rolling mouse wheels
like the sims
the sims 1
indeed
so you can use this node
the mouse wheel axis
drag out from the axis value and do compare
keep it at zero
what happens is up is 1 or -1, and down is -1 or 1
it's flip flopped so one or the other
yes 1 is up
-1 is down
so with the compare you have the execution for if you scroll up or down
it starts with the ortho width at 500
create a variable calle ZOOM, make it a float
set the zoom to 500 as default value
you want it smooth right ? because finterp is the best way its on tick
done
yes plz
now make another variable ZOOMSPEED
set it to like 5 or 10 for now
you can adjust this later
done too
ok so off the compare > add zoomspeed to zoom
so get zoom, add zoomspeed, set zoom
and on < do the same but subtract zoomspeed
so your basically setting this variable up or down
depending on when you scroll
and after both of them connect them both to a set
where you clamp it
lol
this alright?
this yes but plug zoom into it
and then do a set zoom
and plug the result of the add into it
?
yes, this one one the > from the compare
and then the same thing but zoom - zoomspeed
on the < from the compare
hi
from both zooms do another set zoom but clamp it first
i think i miss something
you need to watch a video about blueprints
part 1
part 2
and then you got yourself a smooth af scroll
i didn't test it but it should work, let me know if you have problems
see here how i'm clamping the zoom value because i've added or subtracted so i want to make sure it stays in bounds
i use interp all over the place for zoom, rotation, movement. whatever i can lol
it smooths it out so you don't get that snap when you scroll
dude i first of all, thank you, but when testing it, it automatically reduces the width to 500, and when you move the mouse up, it increases the width, but moving it down does not reduce it again
wrong video
You're multiplying on one side and subtracting on the other.
you should be adding on the top not multiplying
now the flowers can grow
very dumb question that probably won't get answered (and I can't find the answer to anywhere) but does anyone know how to detect the player doing a 360 degree motion on their keyboard/gamepad
you could probably do this by keeping track of the axis and checking if they fire in order within a given time
interesting thing to try to detect
Trying to add the spin jump from mario sunshine to my 3d platformer
Everything's there except I realized I have literally no idea how to detect the motion
just one final question, how can i invert zoom axis?
flip the lines comming out of compare
nice
you can also reverse the addition and subtraction
or build it to be more settings and flip with two booleans or something
nice
smooth af
smooth is a little slow, but it's not a problem
set the interp speed
thank you 2 for all
that controls the speed of the interp