|
Hello, i got this script, but it don't work as i need..
it works, but it is spawning crate somewhere in space :D I have that script attached in Main Camera of 2D Platformer tutorial... So i need to make it like this: You will play as normal. Then you click somewhere, and crate will spawns. It will get your mouse x & y (z = 0) and then spawns it. Crates are spawning, i can see, they are falling down, but i cant see the crates... Only in hierarchy. Help me! Any solutions?
(comments are locked)
|
|
"it don't work" aside from being an abomination of the English language is also not very explicative. It tells neither how it failed to work nor in what context. Instantiate does not take a ray as a position. You should try:
or more than likely
(comments are locked)
|
|
Hello sorry, but i haven't much time before... now: I want to spawn a crate - where i click with my mouse. I want only X a Y axis, Z will be 0 (side platformer game). I want to click & then spawns a crate (in air) and then it falls. So i attached that script to main camera & it gives me this error: This error matches the answer written by skovacs1. You are feeding the Instantiate function with a Ray where it expect a Vector 3. Try one of the solutions given by skovacs1.
Dec 07 '10 at 06:13 PM
bjarnefisker
(comments are locked)
|
|
I have rescripted it:
Now it works, but it is spawning crate somewhere in space :D I have that script attached in Main Camera of 2D Platformer tutorial... So i need to make it like this: You will play as normal. Then you click somewhere, and crate will spawns. It will get your mouse x & y (z = 0) and then spawns it. Crates are spawning, i can see, they are falling down, but i cant see the crates... Only in hierarchy. Help me! Any solutions? please, help me!
Dec 07 '10 at 08:32 PM
pocikanec
You're posting your follow-up questions as answers to your original question. Please add additional information and any follow-up questions you have either as comments or as edits to your original post instead.
Dec 07 '10 at 09:40 PM
Jesse Anders
edited... now it shows in first post
Dec 07 '10 at 10:22 PM
pocikanec
(comments are locked)
|
|
This is a very old question I know but maybe some one will find this helpful. This works for me... Should work - attach to main camera
}
(comments are locked)
|
