【animeA】【攻略】制作一个导弹

功能效果展示

image

思路分析

我们可以利用碰撞事件,当角色触碰到导弹是播放一个爆炸特效,并且将导弹自身销毁。

功能搭建

1.首先我们需要一个导弹模型,可以在工具箱搜索missile

image

选择第二个导弹模型

image

将其重新调整和使用WeldConstraint连接两个部位

image

2.编写导弹下的服务器脚本如下

script.Parent.Touched:Connect(function(avr)
if avr and avr.Parent and avr.Parent:FindFirstChild(“Humanoid”) then
local Ex = Instance.new(“Explosion”)
Ex.Position = avr.Position
Ex.Parent = game.Workspace
end
end)
while true do
wait()
script.Parent.Velocity = script.Parent.CFrame.lookVector * 20
end

好了,接下来我们开始游戏,当导弹碰撞到角色时,就会产生爆炸效果,把角色炸飞了。如果有什么问题或者有更好的实现方式,大家可以在下方积极交流讨论,我们也会参与进来和大家一起分享经验,期望能和大家共同进步~~

1 个赞
关于我们    加入我们    条款    隐私政策
©2021 Roblox Corporation、Roblox、Roblox 标志及 Powering Imagination 是我们在美国及其他国家或地区的注册与未注册商标。
粤ICP备20013629号