当前位置:网站首页>Unity realizes rotation and Revolution
Unity realizes rotation and Revolution
2022-06-30 04:48:00 【Huangjiale】
Create two sphere, Then create a script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class zhuan : MonoBehaviour
{
/// <summary>
/// This is the object of the sub object revolution
/// </summary>
public Transform m_sphere;
/// <summary>
/// Sub object for rotation
/// </summary>
public Transform m_sphereA;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
// rotation
m_sphereA.Rotate(Vector3.up, Space.Self);
// revolution
m_sphereA.RotateAround(m_sphere.position, m_sphere.up, Time.deltaTime * 50);// This is used to control the speed of rotation
}
}
After creating the script, create an empty object , Drag code in , Then drag the two objects just created for rotation into 

Then run it
边栏推荐
- brew安装nvm报nvm command not found解决方案
- The role of break
- Learning about signals
- 0 foundation starts self-study unit notes control direction becomes larger
- Arrays class
- Equity interest [non DP]
- Connect to the database and run node JS running database shows that the database is missing
- Draw on screen border in Commodore 64
- IO stream, byte stream read / write copy
- 股票利益【非dp】
猜你喜欢

Royal Albert Hall, a popular landmark in London

Photon pun refresh hall room list

Pourquoi l'ordinateur n'a - t - il pas de réseau après l'ouverture du Hotspot win10?

Cheap SSL certificate abroad
![[FPGA] IIC读写EEPROM 的实现](/img/6a/36e9355058a90d98cffafcbaa1930b.png)
[FPGA] IIC读写EEPROM 的实现

Network layer protocol hardware

Check London attractions suitable for parents and children in winter vacation

A collection of errors encountered in machine learning with unity

IIS request SSL certificate

Dual domain SSL certificate
随机推荐
IO stream, byte stream read / write copy
Moore Manor diary I: realize the reclamation, sowing, watering and harvest in Moore Manor
SCM learning notes: interrupt learning
Introduction to some representations, neighbors and degrees of Graphs
What is multimodal interaction?
This connection is not a private connection this website may be pretending to steal your personal or financial information
Winter vacation parent-child tour, these new york attractions are not only fun but also knowledge
Sailing experience not to be missed in New York Tourism: take you to enjoy the magnificent city scenery from different perspectives
Is the Flink connector JDBC open source? Where can I download it
Thread safety and processing caused by multithreading
Pourquoi l'ordinateur n'a - t - il pas de réseau après l'ouverture du Hotspot win10?
Encapsulating JDBC tool classes
Malignant bug: 1252 of unit MySQL export
Redis implements SMS login function (I) traditional session login
Marvel fan welfare: Singapore Madame Tussauds Wax Museum Marvel 4D experience Museum
Cheap SSL certificate abroad
Implementation of one interview question one distributed lock every day
File system and directory operations
输入输出及中断技术——微机第六章学习笔记
Equity interest [non DP]