what ClockworkOcean said… as always… though here’s a really neat trick that someone posted here or on YouTube which works surprisingly well… attach your first person arms (or other items you are carrying) to a spring arm with DoCollisionTest enabled… the spring arm will bring the arms backwards… if it works it’s an easy fix and it looks quite nice & smooth, you could even do one spring arm for each arm… just ensure that the spring arm is to the furthest extent (and the arm and tool/weapon etc is backwards from it
Hello everyone, i have a problem. How to make your arms move toward you when approaching the wall? Like in trepang2(- YouTube). I asked this question on the other forum, but these solutions didnt help.Some guys wrote about ik animations, but how to use them. Also one guy sent me this code, but didn’t explain what it does.
That code is in the right ballpark but you also need to actually move the gun, or the arms.
Basically, what you’re trying to do is a trace from the front of the gun to see if anything is in the way. If so, move the gun back. If you want some code that will work with your pawn, you’ll need to post some pics of the blueprint ( so people can see the structure and component names ).
Also maybe mention if you do have an animation to move the gun back.
EDIT: Incientally, of couse any easy way is to just make your player collision capsule bigger
Then it’s like NorthStar say above…
ClockworkOcean make collision bigger isnt what actually need))) Problem is how to move your hands gradually(like this - YouTube). What kind of pics do I need to send? Sorry for my mistakes, I don’t know English well
Hello thanks for help, but you can describe the method in more detail.
You could also just bake your animations as a 2D image in your mesh editing software and put it onto your screen in UE4.
I’m not sure if you could do this but you might be able to make a material for your weapon that goes through all other materials, so even if your weapon is behind something it wouldn’t look like it is in front.
ok… let me break it down a bit more… a Spring Arm component will naturally shorten itself when it touches an object with collsion… bringing your arms smoothly back with it… and lengthening as the space allows
- add a Spring Arm
- set it’s length to the length of the arms
- rotate it in the forward direction
- check set Collision Test to ‘on’
- add your arm mesh as a child of the Spring arm, moving them so the final point (fingers,carried object) is at the farthest point of the spring arm
- adjust Spring Arm rotation lag and position lag settings to personal taste (this will give the ams some nice, natural lag in front of the the camera)
Ideally, I’d use two spring arms (one for each arm). You might still see some clipping with one spring arm…
Thank you very much. But my hands have the same mesh
ok… try with just one spring arm…in this case, I’d make the Spring Arm longer than the arms… in other words… put the relative location of the arms further back than the end of the spring arm (it will be, like -50 in X relative location for the arms static mesh)
OMG it works, can’t believe my eyes, thank u again. But i have one bug(- YouTube), if u know how to fix it pls help
your welcome… looks quite nice… well done!
The reason there is still a little clipping is that the parts of your weapon are beyond the length of your spring arm when you angle it downwards. I’d suggest adjusting the following
- moving the weapon back further from theend spring arm (further in -x relative), so it intersects with the wall earlier and moves it back sooner.
- lowering the weapon (-z relative axis)/increasing the spring arm height (=z relative azis) so the trace is something halfway between the sights and muzzle (because the iron sights stick up)
- (this one is more complex) consider locking the spring arm in pitch at (0 degrees in world) but keeping the arms free… this would require a bit of thought but is doable
- For fun, try playing with the Spring arm rotation and position lag values… the smoothing might give you interesting visual results