Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Sheridah on September 12, 2013, 04:34:47 AM
-
Hi all,
I came across this video where I guy sort of explains how to work with layered animations. Is there anyway I can do this with help of Playmaker?
Thank you :)
-
Hi,
Yes, Have you studied the examples on Mecanim on the playmaker wiki?
https://hutonggames.fogbugz.com/default.asp?W1031
bye,
Jean
-
Yes I have but it doesn't explain the specific example of the videolink that I included. I want my character to touch walls when she comes in close proximity with her left or right hand.
thanks :)
-
Anyone?
-
Hi,
actually, it's all there for you. In the IK example on PlayMaker samples, instead of manually turn on/off ik, you turn it on and off as the user gets close to a wall.
also, you only trigger IK for the arm in question, not for all limbs.
Approach this using small steps.
1: can you modify the IK example to only IK one arm, the rest would remain totally fine and under mecanim animation control
2: can you switch from one arm to the other. that is, you have two events, one to toggle IK on the right arm, and one to toggle IK on the left arm
3: can you trigger that event based on raycasting ( us a simple cube that you move around the character so that raycast finds it
4: can you moe the IK end effector on the raycast Hit position
if you can do all this, then you are set :) each of these steps are really manageabl. Howevr don't hesitate to ask question on these particular steps as you go, I'll assist.
Bye,
Jean
-
Thank you for breaking it into small digestable steps. I seem to get stuck at the raycasting part. I'm afraid that it will have significant impact on my performance since my game is already very heavy. Are there any other possible methods?
-
hi,
not really, RayCasting is the way to go here. you only need two raycasting, one for each arm. It's not going to affect si much to your game perf.
I would however definitly study why your game is slow, and use the profiler to improve what's affecting the perfs, maybe it's a shader, or the use of a method that can improved.
bye,
Jean
-
So I decided to let the matter rest for a while since it was extremely frustrating and not working ;)
Yesterday I started working on it again and I've completed all the steps but I do have a few issues:
4: can you move the IK end effector on the raycast Hit position.
I did this using storing the position of the hit in a variable. I moved the effector using the stored position with a move towards but although it moves towards the correct position, her hands moves high above her head and won't change.
-
Hi,
Yes, of course, there is not restrictions as to where an IK position can be really.
I think you are having a problem of IK enabling, mayb you don't enable the right limb? can you double check with the demo provided on the wiki?
bye,
Jean
-
I managed to fix it by changing the offset of the IK. Thank you for your help! Everything works like a charm now ;)
-
Changing the offset wasn't the solution after all. It turned out that the scale of the parentobject of my character was more than 1. Unity assumed that the same would be true for my charactermodel. By changing it back to 1 everything now works perfectly.