- Home /
Collision,physics and animation problem?
I have this code here: private var red_right_left_moved=false;
private var red_left_right_moved=false; private var red_left_right_moved2=false;
private var red_back_front_moved=false;
function Update () {
var screenCenter = new Vector3(0.5F, 0.5F, 0);
var ray = Camera.main.ViewportPointToRay(screenCenter);
var hit : RaycastHit;
//right left 1
if(Input.GetButton("Fire1")&& red_right_left_moved==false){
if (Physics.Raycast (ray, hit, 1000)) {
if(hit.transform.tag=="red_right_left"){
hit.transform.animation.Play("anim1");
red_right_left_moved=true;
}
}
}
....etc....
The goal here is that the animated box that i moved should collide with the character controller but it doesn't. It collides after the animation end, but i want to push my character if the box is moving. How can i do that?
Your answer
Follow this Question
Related Questions
Character animation/ragdoll problem 1 Answer
Animate Physics doesn't work 0 Answers
Questions about physics based combat (animation + collision, hinge joints++) 0 Answers
Getting collisions when using an animation to move an object? 2 Answers
How to stop first person player from walking through animated door 1 Answer