last day (17 days later) » 

11:11 AM
0
A: How can i turn the camera to left and right in unity for a sphere?

ReparemanAlright, so if I'm understanding you correctly, you want the ball to move in relation to which direction the camera is currently facing. As well as you don't want to have to hold down "Q" or "E" while you move your ball with WASD controls. So there are a few things that I'd like to mention here,...

 
im on skype doryyn , my photo is orange . if you got time we can talk there, i would really apreciete
 
It's usually better if the problem hasn't been resolved to discuss it here, so that others can benefit in the future from the answers supplied.
 
sure if you want to solve the prob like this, il update the code to see my problem
 
I edited my answer to hopefully better answer your question. If I'm still off, let me know and maybe supply some more specific details of what you want answered. Sorry if I'm just really not understanding.
 
well that helped but now the ball moves forward so slowly...i dont understand why ... i press the up arrow moves so slowly..i press the down arrow or left or right and moves fast ..normal like she used to...i change the camera with Q and i press forward the same...moves slowly..but if i press right or down or left moves fast...
 
11:11 AM
I'm not really sure what to tell you about that. None of the code I gave you relates to how fast it moves in any direction. I would start putting in some debugs and see what's going on with it. Based on the code here, I can't tell you what the problem is.
 
i changed from this : if(referencedCamera != null) { float miscaOrizontal = Input.GetAxis("Horizontal"); float miscaVertical = Input.GetAxis("Vertical");Vector3 miscare= referencedCamera.transform.TransformDirection(new Vector3(miscaOrizontal ,0.0f,miscaVertical)); rigidbody.AddForce(miscare * viteza * Time.deltaTime);}
to this : if(referencedCamera != null){float miscaOrizontal = Input.GetAxis("Horizontal"); float miscaVertical = Input.GetAxis("Vertical");Vector3 miscare = new Vector3(miscaOrizontal,0.0f,miscaVertical); rigidbody.AddForce(miscare * viteza * Time.deltaTime);}
and the ball moves forward like she used to ..with that speed..but the controls doesnt change if i change the camera with Q ..the controls remain the same like the game is with camera 1 ..on E .. that s the problem..something there with that referencedCamera.transform.TransformDirection i think..is just an opinion...
 
Right, the ball controls won't change now, because what TransformDirection does, is it takes the vector3 from local space to world space. So it converts your local Vector3 to one that can be used in the world instead. So when you apply that to the ball, the addforce, applies the world space Vector3 to the force. So that's how you get the change in controls. I'm not really sure why you're getting a speed difference. That honestly shouldn't be happening. Debug out the values, and see if they're different, and what may be causing the difference.
 
i dont know how to do that...please you are my only hope...this is a big project for me..
 
Try watching this tutorial. Has to do with rolling a ball around from Unity. Take what they tell you and see if you can solve the problem. Else, copy and paste the entire class in an edit to the question. But watch the tutorial video first. unity3d.com/learn/tutorials/projects/roll-a-ball
 
if there could be a way to X2 speed up when i press upArrow i dont know ..anything..something.. i tryed with debug to show me the movement...and if i press forward is 0.0 , -0.9 , 0.5 and i press backwards is 0.0 , 0.9 , -0.5 but with speed i mean i can see her moving like she used to..but not when i press forward..is the same ..value..and for right and left is 1.0 , 0.0 , 0.0 and -1.0 ,0.0,0.0 moves normal..
i watched that when i started to build this
i will modifi the code in the question
 
11:11 AM
Well you have equal and opposite values for your varying directions. Which seems to be what it should be getting. So are you sure that you're not just looking at it from a weird angle where it just "Looks" like it's moving slower in a specific direction?
 
i know is so wierd...i have this box and i cant move her...i used to move her ...but now the ball just doesnt have that power when i press up arrow..if i press other arrows is allrite
if i could video this il upload it on youtube i dont know how
here i updated the code textuploader.com/o285
 
Start with a code update. Copy and paste the entire class. I'll look it over, but no guarantee that I can find the problem. Also make sure that there is no slant or anything on your platform.
 
wont let me here dont know why some speeling error...so i put here textuploader.com/o285
i also have this class textuploader.com/o28d this is for cameras ..
 
Level the camera out if it's angled down. I have to get back to work, so any further help will need to be later. If it's angled down the force is actually pushed partially to the floor and that could be the problem.
 
yep that s the problem .. wow your really great at this
allrite sure we will talk later... to try to make this game work... my angle of camera is like this x = 59.67914 y = 0 and z = 0..so thats why the ball is goin like that..she moves into the ground somehow..well i cant change the camera..i want the camera to be just like in a rts game up in the sky and with x a little rotated to the ground so i cant see the sky...i wonder if i could give the ball an X from that camera and the second camera..an x = with 0 that would be great...
 

  last day (17 days later) »