Engine Version
CocosCreator v2.1.2 version can not be lower than 2.1.1
Show
Two platforms a jump box, which you can do by horizontal version of 3D to run cool yo!
Production process
Create a new project, then add platform (Box)
Material
New material, specify a color.
In the property there dragged
then you might see is black, do not panic, add a light.
Operation keys: hold the mouse mid-drag Alt-bit rotate the camera.
2D, 3D can click to switch
Grain
Here I am on the Internet the way down a map
Right assert a new material, selected mode, to check the map
and then to the player node (Box)
collision
3D physical impact yet, but there are 2D, our cool running in a plane, then with the original physical system can ah!
To add a rigid platform, the box collision, the collision component size was adjusted to 1, 1 (otherwise too)
Player box also note a static one is dynamic.
New Script, simulate a jump
const {ccclass, property} = cc._decorator;
@ccclass
export default class Test extends cc.Component {
@property(cc.Node) player: cc.Node = null;
onLoad () {
let p = cc.director.getPhysicsManager();
p.enabled = true;
}
start () {
this.scheduleOnce(() => {
// 3秒后模拟跳跃
let v = this.player.getComponent(cc.RigidBody).linearVelocity;
v.x += 300;
v.y += 200;
this.player.getComponent(cc.RigidBody).linearVelocity = v;
}, 3);
}
// update (dt) {}
}
How, there is no urge to do a physical 3D parkour game!
O (∩_∩) O ~~
Add my blog :( QQ group inside the project, the group has a file oh)
706 176 551
We learn together!
O (∩_∩) O ~~