Z Depth Expression

For questions about using Classic.

Post » Sun Sep 11, 2011 6:38 pm

Hello I'm trying to do a space shooter 3D, I'm for 4-5 hours looking here and there, but I don't found anything.
What I need I think is simple for who's understand math.
An expression to move the depth of a 3d model slightly.

This is the image, I think the rest I can handle with them.

But the simple thing as math always stucks me, LOL.

Thanks by now.
Posts: 22
Reputation: 705

Post » Sun Sep 11, 2011 7:58 pm

Here's a basic solution(i'm assuming you mean the z position?)

Your 3d object has a setting > Properties > Settings > Z (underneath Depth)
This will propably set at zero, unless you have already changed it.

Give your 3d obect a private variable called 'zpos', and set its value to the objects initial 'Z' setting.

+ System: Start of layout
-> 3dthing: Set 'zpos' to 0   (or whatever its currently set at)

+ Button: On Button clicked   (I'm using a button to move it)
-> 3dthing: Add 10 to 'zpos'

+ System: Always (every tick)
-> 3dthing: Set Z to 3dthing.Value('zpos')

So everytime you click the button, the 3d object will move 10 units.

Hope this helps

(Nice graphics!)

chrisbrobs2011-09-11 20:14:13
Posts: 1,215
Reputation: 7,872

Post » Sun Sep 11, 2011 11:24 pm

Perfect chrisbrobs!
In my search I found a tank sim yours! Very good work!

As my idea was the sky moves not the ship I made some changes using your idea:

This solved!
Thank you!italoand2011-09-11 23:25:23
Posts: 22
Reputation: 705

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests