x


Camera twitching problem

Hello, fellow developers. I've been trying to create a point-and-click based game involving physics (i.e. explosions) but I'm running into some problems that I'm not sure how to solve.

The root problem is with the player itself: though it has a rigidbody, it is unaffected by my attempts at pulling all colliders with rigidbodies using OverlaySphere. The Use Gravity box is not checked, which I assume is the reason this is happening. However, ticking that box leads to the primary problem: The camera's twitching back and forth, while moving slowly downwards.

I'm using a very simple camera script, which might be the problem as well. Basically, it's fixed to a positional difference, and then updated to keep that difference.

var target:GameObject;
private var curPos:Vector3;

function Awake(){
curPos = transform.position;
}
function Update () {
transform.position = Vector3.Slerp(transform.position, target.transform.position + curPos, Time.deltaTime);
}
more ▼

asked Oct 25 '11 at 06:04 PM

Umbra gravatar image

Umbra
11 1 1 1

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2996
x1787

asked: Oct 25 '11 at 06:04 PM

Seen: 599 times

Last Updated: Oct 25 '11 at 06:04 PM