I’m new here so I don’t have any experience yet. I have a problem. I built up a floating platform for my first game, but when I put the player on, the floating platform goes on but the player is left without moving. What I want is that both move together. How I can solve this problem?
A CharacterController doesn’t have complete physics so it doesn’t get pushed by moving surfaces, although it handles moving into a collider correctly. You need to move the object in sync with the platform. This can be done simply by adding the platform’s motion vector to the character or by parenting the character to the platform as long as he is standing on it.
hmmmm… odd behavior… I did 2 tests… first a first person controller… this code worked perfectly…
function Update(){
var block=transform.parent.transform;
block.position += Vector3(0, 0, 0.05);
}
I then tried it with a third person controller and found that it didnt behave the same way… so… I created a trigger box on top of the platform, then applied this code to the trigger box (of course the parent of the trigger is the box, so they move together)
private var originalParent : Transform;
function OnTriggerEnter (other : Collider) {
originalParent=other.transform.parent;
other.transform.parent=transform;
}
function OnTriggerExit (other : Collider) {
other.transform.parent=originalParent;
}
function Update(){
var block=transform.parent.transform;
block.position += Vector3(0, 0, 0.05);
}
duplicate the object, turn off the mesh rendering. In the collider click the isTrigger button. Attach the trigger to the original object, resize it, the add the code to it.
I have been in unity for about 2 weeks. Finally got a login for this place (they get targeted as spam so it was hard) So I am trying to learn all this stuff too… lol
Now I have a duplicate object on the original object. The game works perfectly but the duplicate object is fully visible but it isn’t opaque.
You can see it in the screenshot:
Hi all, i found this thread similar to something i faced lately, i’m trying to use 3d skeleton motion capture rotations to animate an avatar, how can i manage joints absolute rotations ?
I used the script you put I am having the same issue and i folloed all your steps but nothing happen the platform still moves from under my character. What may be wrong here?