Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c9ea944

Browse files
committed
Smoothly move a gameobject
1 parent 4e92323 commit c9ea944

File tree

69 files changed

+1010
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1010
-147
lines changed

‎Assets/Scenes/ui animation Sample Scene.unity.meta‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Assets/Scripts/AssetBundles/AssetBundleLoader.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ IEnumerator DownloadAndCache(string bundleURL, string assetName = "")
8484
}
8585

8686
// now download the actual bundle, with hashString parameter it uses cached version if available
87-
www = UnityWebRequest.GetAssetBundle(bundleURL + "?r=" + (Random.value * 9999999), hashString, 0);
87+
www = UnityWebRequestAssetBundle.GetAssetBundle(bundleURL + "?r=" + (Random.value * 9999999), hashString, 0);
8888

8989
// wait for load to finish
90-
yield return www.Send();
90+
yield return www.SendWebRequest();
9191

9292
if (www.error != null)
9393
{

‎Assets/Scripts/Camera/MarrtsSmoothedMouseLook.cs.meta‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using UnityEngine;
2+
using System.Collections.Generic;
3+
using System.Collections;
4+
5+
//Script for moving a gameObject smoothly
6+
7+
namespace UnityLibary
8+
{
9+
public class PlayerMovement : MonoBehaviour
10+
{
11+
//attach the gameobject that you want to move
12+
public CharacterController controller;
13+
14+
public float speed = 5f;
15+
16+
void Update()
17+
{
18+
float x = Input.GetAxis("Horizontal");
19+
float z = Input.GetAxis("Vertical");
20+
21+
Vector3 move = transform.right * x + transform.forward * z;
22+
23+
controller.Move(move * speed * Time.deltaTime);
24+
25+
//Rotate clockwise
26+
if (Input.GetKey(KeyCode.E))
27+
{
28+
transform.RotateAround(transform.position, Vector3.up, 100 * Time.deltaTime);
29+
}
30+
31+
// Rotate anticlockwise
32+
if (Input.GetKey(KeyCode.Q))
33+
{
34+
transform.RotateAround(transform.position, -Vector3.up, 100 * Time.deltaTime);
35+
}
36+
37+
}
38+
39+
}
40+
}

‎Assets/Scripts/Camera/PlayerMovement.cs.meta‎

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Assets/Editor.meta‎ renamed to ‎Assets/Scripts/Docs/Mesh.meta‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Assets/Scripts/Docs/Mesh/MeshExample.cs.meta‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Assets/Scripts/Docs/UnityEngine/CullingGroupExample.cs.meta‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Assets/Scripts/Editor/ContextMenu.meta‎

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Assets/Scripts/Editor/ContextMenu/BoxColliderFitChildren.cs.meta‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /